Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a a method or state for when backtest finishes completely?

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

    Is there a a method or state for when backtest finishes completely?

    I would like to save down a custom set of data for analysis after a backtest finishes. In other platforms there used to be a method OnExit() I could use, but I cannot find anything like that in NT8.

    It would be ideal if i can interject when the last closing order (the one that NT places automatically when there is an open position) has been processed. I could monitor the OnExecutionUpdate but that would not help if there was no open position.

    Alternatively, is there a way of knowing the currentbar is the very last bar?

    Thanks for your help


    #2
    Hi crystalet , thanks for posting.

    You can identify the end of the backtest with the BarsArray count:
    if(CurrentBar == BarsArray[0].Count-2)

    State.Terminated is also hit several times at the end of the backtest.

    Kind regards,
    -ChrisL

    Comment


      #3
      ok i will see if i can use this - thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      33 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      359 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      280 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X