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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X