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

I don't see the last value of an indicator

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

    I don't see the last value of an indicator

    What i mean is that i don't see the value of any indicator for the last bar in the chart.
    I discovered that programming another indicator in weekly bars, but when i tried to prove with something as simple as "Plot0.Set(Close[0])" i don't see the last close.
    I selected another indicator (propietary, not mine: ATR) in daily bars for the sp500 and the last value that i can see is "28,33" that corresponds to april 2nd (not april 3rd).
    I suppose i have something bad configured.

    ¿Could you help?

    Regards,
    jr.

    #2
    Fixed problem.
    I changed "CalculateOnBarClose" to false and although it didn't run at the beginning, NT restarted (with an error) and after that, everything works ok.
    regards,
    jr.

    Comment


      #3
      I still don't understand why the last bar on the chart is not considered as "closed".

      Comment


        #4
        Originally posted by yuvalw View Post
        I still don't understand why the last bar on the chart is not considered as "closed".
        The bar is closed only when you have a first tick for a new bar

        Comment


          #5
          I agree with you.

          Comment


            #6
            i agree with yuvalw. The indicator - or oscillator - must oscillate. If the last tick of the last bar is X, it should be considered the close. If one second later there is one more tick X' then this should be considered the new close so the oscillator should change its last value. That's all, i think.
            Nevertheless, once understood how this runs, it's ok for me too.
            regards,
            jr.

            Comment


              #7
              Great you got it working jrbolsa, you're correct the behaviour is determined with the CalculateOnBarClose setting - http://www.ninjatrader-support.com/H...BarClose1.html
              BertrandNinjaTrader Customer Service

              Comment


                #8
                The doc says (on CalculateOnBarClose) :
                "When indicators or strategies are running on historical data, OnBarUpdate() is only called on the close of each historical bar even if this property is set to false."

                I am allways using historical data and still I need to change CalculateOnBarClose=False in order to get the last value of any indicator...

                Originally posted by NinjaTrader_Bertrand View Post
                Great you got it working jrbolsa, you're correct the behaviour is determined with the CalculateOnBarClose setting - http://www.ninjatrader-support.com/H...BarClose1.html

                Comment


                  #9
                  yuvalw,

                  In a historical backtest it does not matter which CalculateOnBarClose setting you choose because it will always be using it as true. It is always accessing the latest value at any point in time of a backtest.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by wzgy0920, 04-20-2024, 06:09 PM
                  2 responses
                  27 views
                  0 likes
                  Last Post wzgy0920  
                  Started by wzgy0920, 02-22-2024, 01:11 AM
                  5 responses
                  32 views
                  0 likes
                  Last Post wzgy0920  
                  Started by wzgy0920, 04-23-2024, 09:53 PM
                  2 responses
                  49 views
                  0 likes
                  Last Post wzgy0920  
                  Started by Kensonprib, 04-28-2021, 10:11 AM
                  5 responses
                  193 views
                  0 likes
                  Last Post Hasadafa  
                  Started by GussJ, 03-04-2020, 03:11 PM
                  11 responses
                  3,235 views
                  0 likes
                  Last Post xiinteractive  
                  Working...
                  X