Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RTH High Low Open and GLOBEX High Low Open

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

    RTH High Low Open and GLOBEX High Low Open

    I'm using a 24 * 7 trading hour chart. I would like create high, low, open levels for globex, and high, low, open levels for the RTH. How can I do so? Thanks.

    #2
    Hello AdeptistJune,

    You can add a data series using a different TradingHours template.

    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)





    You can use variables to track the highest high or lowest low. Below is a link to an example.
    https://ninjatrader.com/support/foru...96#post1113896
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      I wrote the adddataseries like this: AddDataSeries("ES 03-22", new BarsPeriod {BarsPeriodType = BarsPeriodType.Tick, Value = 100}, "Overnight");

      The script only works when I add it to a 100 tick chart. Is there a way I can write the script so that it will plot on any chart I add the script to?

      Thanks.

      Comment


        #4
        Hello AdeptistJune,

        The added series is a 100 tick series, but I would expect this to work with any primary bar type.

        Are you printing the Time[0] and BarsInProgress to the script and finding that BarsInProgress 1 is not updating OnBarUpdate()? (Is this print at the top of OnBarUpdate and not within a condtiion?)

        May I have the output from the prints saved to a text file so that I may take a look?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I think I did it correctly.
          Attached Files

          Comment


            #6
            Hello AdeptistJune,

            The BarsInProgress is not printed so we would not be able to tell which series the time stamps are for.

            Try:

            Print(string.Format("{0} | BarsInProgress: {1}", Time[0], BarsInProgress));
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Here's the attachment
              Attached Files

              Comment


                #8
                Hello AdeptistJune,

                This output is showing BarsInProgress 1 but is not showing BarsInProgress 0.
                12/13/2021 8:29:58 AM | BarsInProgress: 1

                Have you put the print at the top of OnBarUpdate? Is the print in a condition?
                What is the primary series of the chart?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  If it's not too much trouble, can I just send you the code? I don't think I'm doing this properly. Thanks.

                  Comment


                    #10
                    Hello AdeptistJune,

                    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
                    1. Click Tools -> Export -> NinjaScript...
                    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
                    3. Click the 'Export' button
                    4. Enter a unique name for the file in the value for 'File name:'
                    5. Choose a save location -> click Save
                    6. Click OK to clear the export location message
                    By default your exported file will be in the following location:
                    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
                    Below is a link to the help guide on Exporting NinjaScripts.
                    http://ninjatrader.com/support/helpG...-us/export.htm

                    Once exported, please attach the file as an attachment to your reply.

                    (You could also create a test script with only the AddDataSeries() and print if you want to keep the other code private)
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Here is the script. Thanks so much for helping.

                      Comment


                        #12
                        Hello AdeptistJune,

                        You are only seeing prints for BarsInProgress 1 because you have the print in a condition that requires BarsInProgress to be 1. Line 66. Remove this condition and it will print for all BarsInProgress.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Hello, Chris,

                          I can't get the code to work on anything other than a 100 tick chart. Am I suppose to take out the the BarsInProgress or keep it? Thanks.

                          Comment


                            #14
                            Hello AdeptistJune,

                            If the code is in a condition to only process when BarsInProgress is 1, then the code will only be run when BarsInProgress is 1. The primary series is BarsInProgress 0 which will never run, because of the condition you put the code in. This is why in post #4 and post #8 I have asked that the code is not in a condtion and at the top of OnBarUpdate().

                            Have a look at this video where I remove the condition.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Good morning,

                              Thee video you posted doesn't work. It continues to process and not play.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              605 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              351 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              561 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X