Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop trading after 2 consecutive losses

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

    stop trading after 2 consecutive losses

    Can ninjatrader set in a way that trading will get stopped after 2 consecutive losses within specified time period . e.g 8.30 - 4.00?


    Thx

    #2
    Hello,

    This is not supported in the ATM's. You could have one of our ninjascript consultants help you though:
    DenNinjaTrader Customer Service

    Comment


      #3
      Will this Work?

      Ninja Trader,
      I have spent several hours yesterday looking at posts and the help files for a way to stop trading after consecutive losses. I found the code below in the help files.

      if (Performance.RealtimeTrades.TradePerformance.MaxCo nsecLoser > 2)
      return;

      Is this enough to stop trading or does it require something else I may have overlooked. It seems so much easier than what I ve seen on the forum todate.

      BigMike

      Comment


        #4
        For regular NinjaScript strategies you can work with the Performance class correct, a sample into this would be found here - http://www.ninjatrader-support2.com/...ad.php?t=19289

        The snippet you posted should work for realtime trading to return out of the OnBarUpdate() after 2 consecutive losing trades.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Consecutive

          Thanks for the prompt reply.
          By regular do you mean realtime? It looks like this won't work for backtest, which is fine as long as I am aware.

          Thanks again,
          Big Mike

          Comment


            #6
            No, I meant for regular NinjaScript strategies, since you posted in the ATM strategies section here....for backtest you could work with AllTrades then instead of the realtime only property in the call.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X