Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Need more Camarilla pivot levels in NT8

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Hello tamago168,
    I've added new 7th levels, here you get the zip file.
    Attaching snapshots for reference, would help while importing.
    Hope it helps!
    Attached Files

    Comment


      #17
      Hello tamago168,

      Originally posted by tamago168 View Post
      Getting to know C# is too overwhelming for me. I believe there're more users like me who would like to see additional Camarilla levels, otherwise there wouldn't be so many of them (used for different strategies) on TradingView. Hopefully someone can provide an enhanced script here.
      There are not typically step by step guides for the exact logic, but there are general training videos for getting started and becoming familiar with C#.

      Below I am providing a link to a forum post with helpful information about getting started with NinjaScript and C#. Be sure to watch the 'Automate Your Trading with NinjaTrader's Strategy Builder' and then 'NinjaScript Editor 401 training videos.
      https://ninjatrader.com/support/foru...040#post786040
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by s.kinra View Post
        Hello tamago168,
        I've added new 7th levels, here you get the zip file.
        Attaching snapshots for reference, would help while importing.
        Hope it helps!
        Hi Kinra,

        I don't see R7, S7 in this zip file. Is it the right one?

        Comment


          #19
          Hello tamago168,
          Yes, its the right one & I just downloaded it from here & re-checked it contains R7 & S7. Hope you followed all steps correctly while importing. If you're using any templates for this indicator, you need to remove & add it again or go to indicator settings & reset from bottom right. Just in case you're still having issues, you can remove it and add again, I am attaching the .cs file. Hope it helps!
          Attached Files

          Comment


            #20
            Originally posted by s.kinra View Post
            Hello tamago168,
            Yes, its the right one & I just downloaded it from here & re-checked it contains R7 & S7. Hope you followed all steps correctly while importing. If you're using any templates for this indicator, you need to remove & add it again or go to indicator settings & reset from bottom right. Just in case you're still having issues, you can remove it and add again, I am attaching the .cs file. Hope it helps!
            Hi Kinra,

            It works great except that I corrected formulas for R5, R6, R7 and S5. Thank you very much for your time.
            Click image for larger version

Name:	NT8 7LevelCAMs.jpg
Views:	368
Size:	20.1 KB
ID:	1172135

            Attached Files

            Comment


              #21
              Hello tamago168,
              There are 2 versions for calculations, I call it expanded camarilla for the one I used. You need to use the one that suits your requirements including what works best in your markets / instruments. Hope it helps!

              Comment


                #22
                How would I shade the area between 2 levels? For example, I'd like to shade the area between R3 and S3.
                Also, how would I add level labels for each pivot line?
                Thanks!

                Comment


                  #23
                  Hello GoldBands,

                  Thanks for your post.

                  The Draw.Region() method could be used to color the area between two values, such as R3 and S3.

                  See this help guide page for more information about Draw.Region() and sample code: https://ninjatrader.com/support/help...raw_region.htm

                  Level labels could be custom-rendered on the chart using SharpDX in OnRender.

                  See the help guide documentation below for more information about working with SharpDX and OnRender().

                  Using SharpDX to Custom Render Objects: https://ninjatrader.com/support/help..._rendering.htm
                  OnRender(): https://ninjatrader.com/support/help...8/onrender.htm

                  Also, you could view the SampleCustomRender indicator script that comes default with NinjaTrader which demonstrates using SharpDX and OnRender() to custom render objects on a chart. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the SampleCustomRender file.
                  Brandon H.NinjaTrader Customer Service

                  Comment


                    #24
                    Thanks, Brandon. Appreciate the help.

                    Here's an other question. I am modifying the Carmilla pivots and have added the CPR to it. All is good. The only issue is that at the end of the day, the lines get all crazy as they are re-calculated and make their way to their new location. Is there a way to have the lines stop painting and then start at the new location without having to draw the line from the old location to the new? I've tried using dots which don't have that issue but they just don't have the same visual impact as lines do.

                    Thanks!

                    Comment


                      #25
                      Hello GoldBands,

                      Thanks for your notes.

                      The plot values are being recalculated and assigned the recalculated values at the beginning of a new session so the change in the plot that you mentioned would reflect the new value that was recalculated at the start of the new session.

                      The documentation in the code of the script states that on the first bar of the session, the code calculates and sets pivot levels once per session on the first bar of the session.

                      Then, the script just duplicates levels per bar. Since the calculated pivot values at the first bar of the session are different than the plot values during the previous session, this plot difference will occur.

                      Something you could consider is to not assign a value to the plots during the times that the market is not in session. For example, creating a Time Filter that checks if the time is within the session hours and assigns values to the plots only during those hours.

                      Creating Time Filters: https://ninjatrader.com/support/help...on_builder.htm
                      Last edited by NinjaTrader_BrandonH; 09-26-2023, 07:56 AM.
                      Brandon H.NinjaTrader Customer Service

                      Comment


                        #26
                        Thanks, but the link you sent me is how to create the filter from the wizard when starting a new indicator from scratch. Can you pass along some code on how to do it? Thanks.

                        Comment


                          #27
                          Hello GoldBands,

                          Thanks for your notes.

                          The Strategy Builder could be used to create a Time Filter using the steps seen in the help guide documentation linked on post # 25.

                          Once you have the Time Filter set up in the Strategy Builder, you could click the 'View code' button to see the generated syntax in a NinjaScript Editor window.

                          That said, I have attached a reference sample demonstrating the use of Time Filters to plot values only during certain timeframes for you to review.
                          Attached Files
                          Brandon H.NinjaTrader Customer Service

                          Comment


                            #28
                            I got the drawRegion working. How can I add the color and opacity as parameters so it's not hardcoded?

                            Thanks!

                            Comment


                              #29
                              Hello GoldBands,

                              Thanks for your notes.

                              You could create user-defined input properties in your script if you would like certain values to be defined in the Properties section of the Indicators window when adding an indicator to a chart.

                              The Strategy Builder could be used to create user-defined inputs on the Inputs and Variables screen and then you could click the 'View code' button to see the generated syntax for creating those inputs.

                              See te help guide documentation below for more information.

                              Understanding the Inputs and Variables screen: https://ninjatrader.com/support/help...er_screens.htm
                              NinjaScriptProperty: https://ninjatrader.com/support/help...yattribute.htm
                              Creating User-Defined Input Parameters: https://ninjatrader.com/support/help...d_input_pa.htm
                              Working with Brushes: https://ninjatrader.com/support/help...th_brushes.htm
                              Brandon H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PhillT, Today, 02:16 PM
                              2 responses
                              6 views
                              0 likes
                              Last Post PhillT
                              by PhillT
                               
                              Started by Kaledus, Today, 01:29 PM
                              3 responses
                              10 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by frankthearm, Yesterday, 09:08 AM
                              14 responses
                              47 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by gentlebenthebear, Today, 01:30 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post gentlebenthebear  
                              Started by PaulMohn, Today, 12:36 PM
                              2 responses
                              17 views
                              0 likes
                              Last Post PaulMohn  
                              Working...
                              X