Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Maximum drawdown question

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

    Maximum drawdown question

    I am trying to add a risk mgt criteria to my strategy and would like to do the following.

    -- If I have 3 losing trades in a row (they could be on the same day or over a number of days), I'd like to pause any further trading for next 5 trading days (i.e. excluding weekends).

    Is there a way to accomplish this in NT? This will directly help anyone to manage the maximum drawdown. Has anyone faced this kind of problem before?

    Many Thanks.

    #2
    pandyav,

    I am happy to assist you.

    We have a reference sample you could use to adapt to your needs.

    Here is the link : http://www.ninjatrader.com/support/f...ad.php?t=19289

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks AdamP.

      Looks like I can use the following code to check if last three trades had a loss. What I am not sure about is how can I pause the strategy for next 5 days and activate automatically if there were three consecutive loses. Is there a function or code I can look into for that? Very much appreciate your help.

      for (int idx = 1; idx <= 3; idx++)
      {
      /* The Performance.AllTrades array stores the most recent trade at the highest index value. If there are a total of 10 trades,
      this loop will retreive the 10th trade first (at index position 9), then the 9th trade (at 8), then the 8th trade. */
      Trade trade = Performance.AllTrades[Performance.AllTrades.Count - idx];

      /* If the trade's profit is greater than 0, add one to the counter. If the trade's profit is less than 0, subtract one.
      This logic means break-even trades have no effect on the counter. */
      if (trade.ProfitCurrency > 0)
      lastThreeTrades++;
      else if (trade.ProfitCurrency < 0)
      lastThreeTrades--;
      }

      Comment


        #4
        Pandayav,

        Essentially when this condition occurs you can have a counter reset, then wait for a new day for each increment, once it hits 5 you can allow trading again.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        70 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        42 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X