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 NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X