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

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.

      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 funk10101, Today, 09:43 PM
              0 responses
              6 views
              0 likes
              Last Post funk10101  
              Started by pkefal, 04-11-2024, 07:39 AM
              11 responses
              37 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              44 views
              0 likes
              Last Post bill2023  
              Started by yertle, Today, 08:38 AM
              6 responses
              26 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              24 views
              0 likes
              Last Post algospoke  
              Working...
              X