Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Gaps and Stop Orders

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

    Market Gaps and Stop Orders

    How does NT handle stop orders with market gaps. This morning I had a trade that was supposed to be close[0] - .0010 but the market gapped by more than .0010 and NT gave an error message (sell stop limits cannot be placed above the market) and shut down my strategy. Shouldn't this order (stop order) just turn into a market order once the price gapped below it or does this have something to do with how the order was place? Any thoughts on how to fix this for the future? Thanks!

    GT

    #2
    The reason this happens is because your order is not submitted till market open. When it is submitted at market open it failed to be a valid price and that is why the strategy was halted.

    To fix this you would need to program in your own checks on the price before you submit. Do not submit the day before because you would not know the opening gap at that point. You would need more granularity.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I have used tradestation in the past where it was possible to enter based on the open of a bar +- certain amount. What other ways are there to check for this before submitting the order. I want to place the order but I would like to use a stop order (close[0] - .0010) instead of a market order (if x . . . sell at market) order to ensure the market is moving in the "right" direction.

      Comment


        #4
        GreenTrade,

        You will just have to place an order on the first bar of the opening day instead of after the close of the prior day. That way you can evaluate the gap size so you won't run into illegal price levels for your stop order.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I am trading on a multi time frame chart (5 minute primary and 1 minute secondary) where the signals are based on the primary bars and place on the secondary bars. The issue is that my order is place at close[0]-.0005 and if the open of the next bar is less than that it shuts down the strategy because it is basically placing a sell stop above the market, which it cannot do, of course. How can I avoid this? Thank you for your help and sorry for the probably basic questions.

          GT

          Comment


            #6
            Multi-time frame is fine. Just get your trigger condition from the 5min, go to the 1min and submit after the open. If you are using CalcualteOnBarClose = false you can avoid waiting for 1 bar to close, otherwise you will have to wait for the 1st bar to close before you can get that order in.

            Basically you need to wait for the first tick, evaluate the price, submit a properly priced order on the 1min time frame.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              So if I use something like:

              Code:
              entryOrder = EnterShortStop(1, true, 1, Math.Min(Close[0] - .0005, GetCurrentBid(1)-.0005), "ShortEntry");
              on a 5 minute chart with a 1 minute secondary time frame it will not look at this line until the 1 minute bar closes? If I wanted it to look at it right away would I have to change my secondary time frame to 1 second? Is this the right way to go with this or is there another simpler way? Thanks!

              GT

              Comment


                #8
                No. It depends where you place the line. If you place it in the 1min context it will evaluate it when you are in that bars context. If you place it in the 5min, then it will evaluate there.

                If you want it to evaluate immediately just use CalculateOnBarClose = false. Your strategy will evaluate on every single tick. The 1min and 5min will both be evaluated on every tick.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Is it possible to set CalculateOnBarClose = false but still only look at the close values for the indicators and highs/lows. I like the idea for the entry order but I still would like to evaluate the indicators based on there close values not there intra-bar value. Thanks!

                  GT

                  Comment


                    #10
                    GreenTrade

                    It is possible. Use CalculateOnBarClose = false and then you can limit your logic via if (FirstTickOfBar) = true. Remember when you use this check that you need to offset your [] indexing by 1 to get the close values of the just closed bar.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      How would this work then? I set CalculateOnBarClose = false, then use
                      if (FirstTickOfBar)
                      {
                      if (Close[1] < EntryLevel && Low = Close[1]-.0005)
                      entryOrder = EnterShort(0,1,"ShortEntry);
                      }

                      I changed the code from a stop order to a market order upon hitting a predetermined level. But how do I get the entryOrder outside of code above so it is calculated tick by tick? I think I am getting the idea but still unsure on how to make it happen. Thank you for your patience!

                      GT

                      Comment


                        #12
                        Hi GreenTrade, you want to do this code snippet you posted for retrieving your indicator values on the close, just don't do it for the order entry logic and it will submit then on every tick if you set CalculateOnBarClose to false.

                        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