Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

[FEATURE REQUEST] Strategy backtest completed callback

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

    [FEATURE REQUEST] Strategy backtest completed callback

    Hello guys,

    would it be possible to add new virtual method which will be executed when Backtesting is completed.


    PHP Code:
    
    protected override void OnBacktestingCompleted(TradeCollection trades) { /* single*/ }
    protected override void OnBacktestingCompleted(TradeCollection[] trades) { /* or multiple/optimization/etc */ }
    
    // OR        
    
    protected override void OnBacktestingCompleted(SystemPerformance performance) { /* single */ }
    protected override void OnBacktestingCompleted(SystemPerformance[] performance) { /* or multiple/optimization/etc */ } 
    

    I know I can get almost but not the same with code below (but issue here that I never will get last closed trade which was closed by NT by On Session Close because of End of historical period):

    PHP Code:
    if (CurrentBars[BarsInProgress] == BarsArray[BarsInProgress].Count-2) {} 
    

    So please if you could add this feature into your backlog would be very great.

    Thanks!



    #2
    Hi login_dejavu, thanks for your post.

    I will submit a feature request and report back here with a tracking ID. We appreciate your input. We do have the IsInStrategyAnalyzer property and with the detection of the State.Terminated one can know when a backtest is over.

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hi login_dejavu, thanks for your post.

      I will submit a feature request and report back here with a tracking ID. We appreciate your input. We do have the IsInStrategyAnalyzer property and with the detection of the State.Terminated one can know when a backtest is over.
      Hi Chris,

      I didn't know about IsInStrategyAnalyzer, checked, it works as expected. So I guess you can ignore my feature request then. I understand that maybe in terms of code it is not much to add, but with all documentation/etc... to be production ready can be to much worry.


      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      85 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      47 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X