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

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ageeholdings, 05-04-2024, 03:21 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by claxxical, 05-30-2017, 12:30 PM
        39 responses
        4,501 views
        0 likes
        Last Post fiendtrades  
        Started by tonynt, 05-21-2019, 06:27 AM
        12 responses
        541 views
        1 like
        Last Post fiendtrades  
        Started by alexstox, 10-16-2018, 03:29 PM
        12 responses
        355 views
        0 likes
        Last Post Tburg1073  
        Started by truepenny, Today, 03:59 AM
        0 responses
        5 views
        0 likes
        Last Post truepenny  
        Working...
        X