Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Executing command at end of strategy

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

    Executing command at end of strategy

    Is there any way to get a strategy to do something after it has run though all of the backtest data?

    I have a running tab of the times that my different stops are executed, but currently it prints to the output window as part of the OnExecutionUpdate. I'm not sure how big the effect is, but over a long backtest period and big optimization, it seems to be slowing things down. I would still like to know this information though without having to have it print every single time there is a trade.

    Is there any way to have the strategy print out the value of the variables just once after it has finished running?

    Thanks.

    #2
    You could try coding a condition that evaluates to true only on the last bar of the last date. Compare Time[0] against a known last DateTime stamp of the backtest sample.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    164 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    318 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    246 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    350 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X