Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    53 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X