Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicators don't plot to the most current bar on the chart

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

    Indicators don't plot to the most current bar on the chart

    If I add a chart of IBM or any symbol with only 1 indicator on it - a CCI(5).

    Using the daily chart, but it doesn't matter what time frame.

    The indicator doesn't plot on the last bar of the chart. It stops 1 bar back.

    Not only that, I think inside my strategy, it is calculating a value, that is not correct.

    How do I fix this?

    I have included a picture.
    Attached Files

    #2
    Hello DaFish, per default the scripts / studies would be run on CalculateOnBarClose = true, that means they would not include the intrabar values of the non finished last bar on the chart, however you can set this property to 'false' to get a value for this bar, too, it would then use every tick seen to update the value as the bar progresses.

    Comment


      #3
      Hi Bertrand, thanks for the very quick reply.

      In the picture, I am using a basic vanila chart, with the standard CCI indicator - no customizations. The chart is a DAILY chart - so the bar is finished.

      Under these conditions, I was expecting CCI to be plotted on the last bar.

      I have made NO changes - this is the way NT came when I installed it. My question still stands: why isn't the CCI plotted on the most current daily bar on the chart?

      I do have my own strategy where I will use CalculateOnClose = false and check that today with intraday bars.

      Comment


        #4
        Yes, correct - that would be expected for default - the daily bar you show is not finished yet, it would only be if the open tick of the next one would be received >> NT is an event based framework and not one based on time. Thus to see the value on the very last not yet closed bar, use CalculateOnBarClose = false, please.

        Comment


          #5
          Hi Bertrand. The CalculateOnClose=false is also not giving me what I am expecting.

          See new pic. The chart's indicators are just not being calculated on the current bar.

          Can you provide a picture of a chart that DOES calculate the indicators on the current bar and what you did to make that happen please?

          Thanks a lot. I will try to see if I my strategy is actually returning the right values, but my signals don't seem to be working correctly... that could be my logic though.
          Attached Files

          Comment


            #6
            Please check with any of the default supplied indicators on your chart, for example a SMA or CCI - with CalculateOnBarClose set to false they will include the current bar in the output.

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Please check with any of the default supplied indicators on your chart, for example a SMA or CCI - with CalculateOnBarClose set to false they will include the current bar in the output.
              HI Bertrand, thanks a lot. You are correct. I added a

              CalculateOnBarClose = false; in the initialize, but that didn't get it.... I needed to modify the properties as well on the indicator in the GUI and THEN the indicator drew properly.

              Issue closed.

              Comment


                #8
                Thanks for letting me know, glad to hear - correct if you changed it in the code, you would then need to apply a fresh instance of the script, to see the setting used in the GUI.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X