Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Last Day in testing range not accessbile?

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

    Last Day in testing range not accessbile?

    Hello

    I want to produce my own statistics for each test run. Since it is not possible to execute a piece of code at the end of a testing round I pass now a parameter with my last testing date in order to do the calculations this way.
    But it seems that it is impossible to access the last day of a range. Example:
    Start Date: 1.1.2005
    End Date: 29.10.2010
    In the code (OnBarUpdate) the last processed date is 28.10.2010. In the NT statistics, the open positions are closed on 29.10.2010.
    Why is 29.10.2010 not processed with OnBarUpdate? Is there any possibility to catch 29.10.2010 as last day of the testing range?

    thanks
    Andre

    #2
    Andre, unfortunately this is not possible - the last bar would not be processed as it's still considered open until the opening tick of the new bar comes in then.

    Comment


      #3
      hi
      I just have seen that there is the method OnTermination(). As it seems this method is always executed when a backtest run is done, example: I run optimize strategy and have 20 loops. OnTermination is called 20 times at the end of testing. So, this would be what I am looking for.
      Or do I oversee something?

      Comment


        #4
        Andre, neat idea - yes that should work for you, OnTermination() would be called for each testing instance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X