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 bmartz, Today, 09:30 AM
            2 responses
            11 views
            0 likes
            Last Post bltdavid  
            Started by f.saeidi, Today, 11:02 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by geotrades1, Today, 10:02 AM
            4 responses
            12 views
            0 likes
            Last Post geotrades1  
            Started by rajendrasubedi2023, Today, 09:50 AM
            3 responses
            16 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by lorem, Today, 09:18 AM
            2 responses
            11 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X