Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using ChartBars.To/FromIndex with AddDataSeries Issue

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

    Using ChartBars.To/FromIndex with AddDataSeries Issue

    Hi, I modified the print statement in the code snippet example in NT8 Help for "ChartBars.FromIndex" to print the index, high and low of the first and last candlesticks with the viewable range of the chart canvas area. The information is correct when there is only one dataseries (in this example, a 15 minute chart).

    However, when I added a dataseries (e.g., 3 seconds) to my 15 minute chart, the index information is still correct (i.e., for the visible 15min bars on the chart) but the highs and lows correspond to those of the added 3 second chart (i.e., non-visible data series).

    Is there a way to determine the high/low/open/close/volume information for the visible/primary bars series (15 minutes in this example) when there are 1 or more added data series?

    Thank-you.

    #2
    Hello REI140205,

    I am not able to reproduce this behavior.

    Below is a link to a video and attached is a test script.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea. I added the 3sec data series using "AddDataSeries(Data.BarsPeriodType.Second, 3)" in State == State.Configure. I attach a pic showing my ES12-20 15 minute chart scrolled to far left with 0 to 124 bars correctly identified but the highs of the 1st and last viewable are incorrect for the 15 minute bars (I added blue dashed lines at the highs shown in the output window). I will extract this from my main indicator and put it into a simple indicator that can be shared.
      Attached Files

      Comment


        #4
        Hello REI140205,

        Try using the script I have provided, and use the exact steps as shown in the video I have provided.

        Are you experiencing different behavior than what is shown in the video when taking the same steps?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea, here is the simplified indicator and a pic summarizing the different results I get depending on whether the one line of code that adds the 30sec data series is kept or commented out. My overall goal is to be able to access through code the HLOC & Time & Volume info for the viewable bars on the chart (starting with the Highs for the first and last viewable bars). In this example, my primary bars are 15 min and I add a 30sec data series via code.

          Thanks for all your help!
          Attached Files

          Comment


            #6
            Hello REI140205,

            Unfortunately, the information in the screenshot is not enough to identify an issue. This is why I have provided a video with the Data Box open, and I have provided the script.

            If you are stating that the script I have provided you does not work as shown in the video, I would like to schedule a call with you so that I may test the test script I have provided you on your end and confirm the behavior is different.

            The Bars will always refer to the bars used by the script. As demonstrated in the video I provided you, this matches the ChartBars.FromIndex and ChartBars.ToIndex, even when multiple chart bars are added to the same panel.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Sorry Chelsea, we must have our wires crossed.

              The script you provided worked. However, it was somewhat apples-to-oranges to my concern. Your script does demonstrate that the correct information (as seen in the data box) is stored somewhere, but my concern was that using code to add a 2nd data series changes the data returned by the indicator from being correct to incorrect (i.e., bar info for the added data series not the primary series is now returned).

              I provided a screenshot of my output AND the corresponding indicator so that you could try to reproduce the issue at your end. I attach the sample indicator again (you might not have seen it because all attachments don't always show in responses on the forum).

              Can you please run the indicator I provided (with and without the added 2nd data series) to see if you can reproduce the issue.

              Thank-you.
              Attached Files

              Comment


                #8
                Hello REI140205,

                I do see the output in the output window in your screenshot, but the date and time of the bars on the chart are not shown, similar to how I demonstrated in the video, so we cannot compare the date or times of the bars on the chart. We cannot see what data series are on the chart in that panel.
                So we can at least confirm that some information is printing to the output window. We cannot confirm, if these match the date and time of the bars on the chart.

                Thank you for providing a script to test.

                I have tested the script you have provided, and this is working as expected.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Dang. Short of us doing some sort of screenshare so that you can run that indicator on my computer, I don't know what else to say. Like the screenshot I last provided, I get the data for the non-visible 30sec bars.

                  Comment


                    #10
                    Here it is on 15minute with 5minute added using same indicator. Databox is correct. Bar index (49) on 15min is correct. But the output info corresponds to 5min dataseries, for both High and Time values (the High for the 5min bar with magenta arrow is 3473.5). As well, it is nonsensical to have a 18:05 timestamp for a 15min bar.
                    Attached Files

                    Comment


                      #11
                      Hello REI140205,

                      To confirm, the behavior I have shown in the video I have provided is the correct behavior you are expecting, however as you take the exact steps shown in the video the behavior is different?
                      Are you using the latest release 8.0.22.2? (Help -> About)

                      If you right-click the chart and select Reload All Historical Data, are the same values showing?
                      If you open a new chart, is the behavior the same?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks Chelsea, new chart and reload all historical data did not work. Update from 8.0.20 to 8.0.22 did work!!

                        All good now. Thanks again.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        656 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        371 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        109 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        574 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        579 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X