Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop trading after you reach your max DD

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

    stop trading after you reach your max DD

    If I want to stop the strategy from executing each day if I reach my personal, maximum daily draw down limit, e.g.,:

    protected override void OnBarUpdate()
    {
    if(Performance.AllTrades.TradesPerformance.Currenc y.DrawDown > 5000)
    {
    trade_allowed = false;
    }

    .....does Performance.AllTrades.TradesPerformance.Currency.D rawDown get reset each day? How often does it change? Or is it a cumulative number that only increases as long as the strategy is going?

    thanks,
    D

    #2
    Hi Paschall,

    Thank you for your post.

    You are correct in that it is a cumulative number that only increase as long as the strategy is running.

    Each strategy will have it's own instance of the Performance and can be reset by disabling and re-enabling the strategy.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,
      Thanks for the confirmation. So what would be a better way, then, to keep track of a Daily max draw down? And so I can disallow the strategy that DAY (but like they Scarlett O'Hara saiid at the end of "Gone With The Wind"....'Tomorrow is a new day")?

      Thanks for your help,
      D

      Comment


        #4
        Paschall,

        You will need to assign a variable with the Max Draw Down values.

        You can create the filter to stop trading after you've hit your Max Draw Down and then when a new day is reached or new session you can reset that variable

        http://www.ninjatrader.com/support/f...ad.php?t=19182
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by paschall View Post
          Hi Cal,
          Thanks for the confirmation. So what would be a better way, then, to keep track of a Daily max draw down? And so I can disallow the strategy that DAY (but like they Scarlett O'Hara saiid at the end of "Gone With The Wind"....'Tomorrow is a new day")?

          Thanks for your help,
          D
          Iterate backwards through the Trades to find the ones that have an entry and or exit on the current day, and use that to calculate the drawdown. You do that by querying the Trade.Entry or Trade.Exit IExecution object returned.

          ref: http://www.ninjatrader.com/support/h.../nt7/trade.htm

          Comment


            #6
            Yes, this is my approach. Alreayd assigned the variables. Just wondering if there was a built-in DD function that was reset automatically each session (session DD). Would be a handy feature to have.

            Performance.DrawDown.Hour
            Performance.DrawDown.Session
            Performance.DrawDown.Total

            Thanks again.
            D

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            81 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            42 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            64 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            66 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            54 views
            0 likes
            Last Post CarlTrading  
            Working...
            X