Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLimit orders vs. Stop orders

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

    StopLimit orders vs. Stop orders

    I have a strategy that places EnterLongStop() or EnterShortStop() orders. When I place these orders, I want to limit the amount of slippage I allow, let's say 2 ticks. If the market jumps my entry price more than 2 ticks, how do I prevent NT from sending the market order?

    Thanks!
    Bryan

    #2
    Originally posted by cassb View Post
    I have a strategy that places EnterLongStop() or EnterShortStop() orders. When I place these orders, I want to limit the amount of slippage I allow, let's say 2 ticks. If the market jumps my entry price more than 2 ticks, how do I prevent NT from sending the market order?

    Thanks!
    Bryan
    By using StopLimit orders? (Per the word that I have highlighted in the quote of your query )

    Comment


      #3
      I thought of StopLimit orders, but that means if the market gaps 10 ticks over my price, I get a limit order at least 10 ticks below, correct? I don't want that. I want NT to determine whether to send the order to the broker or not based on the number of ticks slippage I want to allow. I think this is implemented in the ATM orders, correct?

      Bryan

      Comment


        #4
        Hello cassb,

        The Stop Loss order in an Atm Strategy is a stop limit order (in NinjaTrader 7) with a 20 tick offset. This 20 tick offset means the limit is 20 ticks ahead of the price of the stop. If the stop is a sell stop limit (exiting a long position for example) the limit would be 20 ticks below the price of the stop. If the stop is a buy stop limit the limit would be 20 ticks above the price of the stop.

        The idea is that since it is unlikely the price will move more than 20 ticks in an instant, this should highly likely cause the exit to fill immediately after the stop is touched.

        If the price moves more than 20 ticks below the price of the stop price before the limit order is accepted, that order will be skipped over and will not fill.

        Similarly, if you were to use a sell stop limit order and place the limit price 5 ticks below the price of the stop price, this would allow for the stop to fill as long as the price does not drop more than 5 ticks in an instant. If the price were to drop 6 ticks in an instant this would cause the limit to be skipped over and the order would not fill.

        Below is a link to Investopedia on Stop Limit orders.
        http://www.investopedia.com/terms/s/...qsrc=0&o=40186
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          " if you were to use a sell stop limit order and place the limit price 5 ticks below the price of the stop price, this would allow for the stop to fill as long as the price does not drop more than 5 ticks in an instant. If the price were to drop 6 ticks in an instant this would cause the limit to be skipped over and the order would not fill."

          You cannot have a Sell Limit order below the market price, no?

          But my question is still: If I have a pending Buy Stop order to enter a position, and price jumps more than X ticks above the Buy price, how do I prevent NT from placing the order?

          Thanks!
          bryan

          Comment


            #6
            Originally posted by cassb View Post
            ...

            But my question is still: If I have a pending Buy Stop order to enter a position, and price jumps more than X ticks above the Buy price, how do I prevent NT from placing the order?

            Thanks!
            bryan
            That is the very question that has been answered, and is handled by a StopLimit order. Actually, that is the exact definition of a StopLimit entry order. You specify the maximum amount of ticks beyond the StopPrice to place a LimitOrder when the StopPrice is hit. That means that if the LimitOrder is never hit because the market jumped over it, then the order will not fill. A LimitOrder can only fill if at some time after it is placed, the market is at or behind the LimitPrice.
            Last edited by koganam; 09-06-2016, 02:11 PM.

            Comment


              #7
              OK, I see. So in a strategy, in the past when it has tried to place buy limit orders above the market, I get an error message and the strategy gets disabled automatically. Is that the same that will happen if the market jumps over the stop price and is less than the limit price?

              Comment


                #8
                Hello bryan,

                Originally posted by cassb View Post
                "You cannot have a Sell Limit order below the market price, no?
                A limit fills at the specified price or better. If you broker accepts stop limit orders at all, then yes, you can place a sell limit below the current market price. When placing a sell limit below market price, the market price is a better price, and the order will fill immediately at the current market price.


                Are you trading forex? If so, you will not be able to place a buy limit above market or a sell limit below market and you will not be able to use stop limit at all.

                If you are trading futures and your broker supports stop limit orders, you should not be getting rejections for buy orders placed above market.

                Can you post the error message in the Log that appears when this order appears specifically for limit orders?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Here, I will give you an example because I think we are confused.

                  This was a real order today, and why I am writing about this issue. See the attached screen shot. There was a pending EnterLongStop order at 44.77. On the one-second chart you can see that the market popped over that price within one second. The order was actually filled at 44.97 -- 20 ticks from my buy stop. That's 20 ticks slippage.

                  I want a pending order to limit the amount of slippage I am willing to allow on an order fill. Buy limit orders cannot be placed above the market price, so EnterLongStopLimit is not useful in this case because I don't want a limit order to be placed -- I want a market order within X ticks of my price, or nothing. In this example, let's say I want a fill at 44.77, 44.78 or 44.79. If those prices are not available when the Buy Stop price at 44.77 is hit, then I want the order cancelled.

                  Does that make it more clear?

                  Thanks!
                  Bryan
                  Attached Files

                  Comment


                    #10
                    I am trying to reproduce the issue in Market Replay with today's CL 10-16 data, but of course it doesn't happen in Market Replay because there's no broker involved. Somehow in the example chart I attached, the broker placed the order at 44.97 instead of 44.77. How do I prevent this from happening again? I understand now that Buy Limit orders that are above the market will get filled immediately as a 'best price'.

                    So you are saying the solution is to use EnterLongStopLimit() and set my stop price and limit price to the same price? Then if the market jumps the price it will cancel the order? Or will I end up with a pending Limit order at 44.77 and the market up at 44.97?

                    By the way, I was wrong about that error message. It was about placing BuyStop orders below the market, or SellStop orders above the market. You can't do that.
                    Last edited by cassb; 09-06-2016, 03:31 PM.

                    Comment


                      #11
                      Hello cassb,

                      A stop order (either stop market or stop limit) cannot be placed on the wrong side of the market. This will cause a rejected order.

                      A limit order (if your brokerage accepts stop limit orders) can be placed on the wrong side of the market. When placed on the wrong side of the market this order will fill immediately.

                      The advice to have an order that will be skipped over remains the same. Use a Stop Limit Order with the limit set ahead of the stop price the number of ticks of slippage you are willing to accept.
                      This will not cause the order to be cancelled directly, this will cause the order to be skipped over. In other words the order remains working.

                      If the order is submitted without liveUntilCancelled set to true, this option will default to false and the order will be cancelled when the bar it was submitted on closes.
                      In other words, if you do not resubmit an order and you do not use liveUntilCancelled as true, an order that does not fill within one bar is automatically cancelled.

                      If you want the order to be cancelled at a specific time instead of being skipped over, then write logic into your script to call a CancelOrder() when the condition to cancel the order is met.
                      Last edited by NinjaTrader_ChelseaB; 09-07-2016, 10:51 AM.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        OK, thank you Chelsea. Sorry to belabor the point, but I cannot test my code since I need a broker and a gap to test with.

                        I'll have to write some code that checks on every tick if I have a limit order pending and what the current price is. If the price is more than X ticks above my limit order, I'll have to manually cancel it then. I think I got it now. Thanks!

                        Comment


                          #13
                          So... limit price cannot be less than stop price? How do I test the scenario where my StopLimit order is jumped and I now have a pending Limit order below the market price?

                          Thanks!


                          Edit: I may have answered my own question. I changed my order type from StopLimit to just a Limit order and make it 10 ticks below the entry price. My brain hurts. :-)
                          Attached Files
                          Last edited by cassb; 09-06-2016, 07:25 PM.

                          Comment


                            #14
                            Originally posted by cassb View Post
                            Here, I will give you an example because I think we are confused.

                            This was a real order today, and why I am writing about this issue. See the attached screen shot. There was a pending EnterLongStop order at 44.77. On the one-second chart you can see that the market popped over that price within one second. The order was actually filled at 44.97 -- 20 ticks from my buy stop. That's 20 ticks slippage.

                            I want a pending order to limit the amount of slippage I am willing to allow on an order fill. Buy limit orders cannot be placed above the market price, so EnterLongStopLimit is not useful in this case because I don't want a limit order to be placed -- I want a market order within X ticks of my price, or nothing. In this example, let's say I want a fill at 44.77, 44.78 or 44.79. If those prices are not available when the Buy Stop price at 44.77 is hit, then I want the order cancelled.

                            Does that make it more clear?

                            Thanks!
                            Bryan
                            So you place a StopLimit entry order with a StopPrice of 44.77 and a LimitPrice of 44.79. If the market gaps up even to 44.80 and never ticks back down, you are left with a sitting Limit Order of 44.79, as a LimitOrder must fill at "price or better". IOW, you cannot be filled at any price higher than 44.79, because that is where you placed a LimitOrder, said order triggered when the market reached the StopPrice.

                            Comment


                              #15
                              Yes, thank you. I don't want a pending limit order, but I can just check on the next tick and if there's an order there I can cancel it.

                              I guess what would be a nice addition to NT is the ability to have a "fill or kill" order type. Tell the broker to fill at X price, and if that price was not available to fill at then kill the order.

                              Thanks!
                              Last edited by cassb; 09-07-2016, 06:35 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              668 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              377 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X