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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X