• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

straegy analyzer graph does not display the last day 'drawline' output

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

    straegy analyzer graph does not display the last day 'drawline' output

    my straegy analyzer graph does not display the last day 'drawline' output even though the output window shows valid plottable values for that day? [ie] i was expccting the 'OnBarUpdate' script code to be executed that one last time but that apparently does not happen?
    is that to be expected or am i probably doing something wrong? is there a work-around if my code is ok?

    #2
    CORRECTION to my original post

    CORRECTION
    the output window shows data only up to the next to the last day. but still, my question remains the same [ie] shouldn't the 'onbarupdate' code have been executed on the lastday?

    Comment


      #3
      Hello joemiller,

      Thank you for your post.

      I see the same behavior on my end. While a trade can be closed on the last bar and even Print() can be called on the last bar, the Drawing Objects do not appear to draw on the last bar of the backtest.

      I will follow up with development on this item and follow up with you here with additional information.
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Thanks a whole lot Patrick, that takes a load off me.
        I was just about to send the following message, which just says I am still investigating the problem and in addition confirms what you just said [ie] that the Print() function works fine on the last day.

        below is the message I was about to send-------
        "after considerable debug coding I am confident that the 'onbarupdate' code is not working properly on the last day. display of the last day's info is the crucial info needed for the following new day.
        I am going to put additional code in the 'onbarupdate' code to see if maybe it is being entered on the last day but 'drawlines' are not being completed. seemingly unlikely but it's worth further investigation." the Print() function works for the last day.

        Comment


          #5
          every drawline object is displaced one bar to the left ?

          it appears that every drawline object is displaced one bar to the left [eg] when I tell it to
          draw a segment from one bar back to the current bar it draws it from 2 bars back to one bar back...which might explain why there is no drawline object on the last day.
          i'm not sure about all that. I am super busy with other things at present but will get on it again soon as possible to check it out some more. just want to give an alert about what I think I have seen.

          Comment


            #6
            Hello joemiller,

            Thank you for your reply and for this information. This is expected behavior.

            OnBarUpdate is called when a new bar appears and is being created and not when a bar closes. (Typically both happen at the same time).

            However, since there is not a new bar that is being opened the last OnBarUpdate call never happens for the last bar.

            Changing the script to CalculateOnBarClose false, allows the OnBarUpdate to call for the last bar.

            However, changing CalculateOnBarClose will introduce things that must be addressed in the script such as which bar is BarsAgo 0.

            Below is a link to the help guide on CalculateOnBarClose.
            http://www.ninjatrader.com/support/h...onbarclose.htm

            Also, I am including a link to the help guide on Multi-Time Frame & Instruments. In the section 'How Bar Data is Referenced' there is information about BarsAgo.
            http://www.ninjatrader.com/support/h...nstruments.htm


            Please let me know if this does not resolve your inquiry.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              thanks all...problem resolved i think

              thanks all...problem resolved i think

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Grantx, Today, 08:22 AM
              0 responses
              3 views
              0 likes
              Last Post Grantx
              by Grantx
               
              Started by Swing123, Today, 08:21 AM
              0 responses
              3 views
              0 likes
              Last Post Swing123  
              Started by lunardiplomacy, Today, 07:57 AM
              0 responses
              3 views
              0 likes
              Last Post lunardiplomacy  
              Started by Tagliareni, Yesterday, 08:10 PM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by SDaCosta30, Today, 04:19 AM
              2 responses
              12 views
              0 likes
              Last Post SDaCosta30  
              Working...
              X