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 Haiasi, 04-25-2024, 06:53 PM
                  2 responses
                  16 views
                  0 likes
                  Last Post Massinisa  
                  Started by Creamers, Today, 05:32 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post Creamers  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  12 responses
                  1,785 views
                  0 likes
                  Last Post Leafcutter  
                  Started by poplagelu, Today, 05:00 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post poplagelu  
                  Started by fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,407 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Working...
                  X