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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      75 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      43 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      167 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      101 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      165 views
      2 likes
      Last Post CaptainJack  
      Working...
      X