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 algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        21 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X