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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X