Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Disabling stop loss

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

    Disabling stop loss

    Hi there,

    I'm trading a multi-day strategy that looks at intraday bars.

    I have a SetStopLoss() set as part of my initialize(). However, I'd like to temporarily disable any stop losses during the first bar (30 minute bars) of each session... to avoid being taken out by any temporary gap downs.

    Do I need to fake it with a SetStopLoss(Price, 0); ...? I imagine there's a call out there that I can call to temporarily cancel any stop orders...

    #2
    Hi,

    There is no way to disable the submission of stops via the SetStopLoss() method. The only thing you could do is move them to a price far enough away from the market.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      I guess I'll have to do that. SetStopLoss() with a price at close to zero. I have a few followup questions.

      1) What happens programatically if the order is rejected by the broker as being too far from the current price? What gets called in my application?

      2) With other automated systems I've traded in the past, I've actually had issues with getting stop orders submitted at the beginning of the day. At 4 PM the previous day, the exchange cancels all day stop orders. And some brokers seem to cancel any newly submitted stop orders (for the open of market) overnight.

      Do you know how NinjaTrader handles stop orders for the first bar of the session? (If it matters, this would be with TDAmeritrade.) Are stop orders submitted GTC, so never canceled? If I modify the stop order's price at the close of session the previous day... what if it gets caught at 4:00 - 4:20 PM and never submitted? When would the exchange actually take action?

      Some of this I know I'll figure out as I actually deploy, but if anyone has expertise on how stop orders work in reality...that would be great. Again, my concern is effectively making sure my stop order will *not* be hit (under any condition) the first bar of the next session.

      Comment


        #4
        Originally posted by heech View Post
        1) What happens programatically if the order is rejected by the broker as being too far from the current price? What gets called in my application?
        Just to answer my own question on this point.. .this sample referenced in another thread goes a long way towards explaining that:

        Comment


          #5
          We will reply on item #2 on Monday.
          RayNinjaTrader Customer Service

          Comment


            #6
            2) When you run your strategy you have the option to choose what time in force setting you want to use for your orders. http://www.ninjatrader-support.com/H...meInForce.html

            NinjaTrader handles all bars of the session. If you want something to happen on the first bar immediately I would recommend using CalculateOnBarClose = false. This way you can process at every single incoming tick. Also, if you have ExitOnClose set NinjaTrader will cancel your orders at the end of your trading session. http://www.ninjatrader-support.com/H...itOnClose.html
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X