• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Resting Limit Order Question

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

    Resting Limit Order Question

    I have recently coded a few different strategies that use resting limit orders, to get a feel for if I can improve my fill rate on limit orders. I have heard that in Ninjatrader 7 the fill engine had no concept of position in the queue and would likely treat resting limit orders just like any other limit order, but in Ninjatrader 8 queue position would be incorporated into fills.

    So could you please provide me with some information on both 7 and 8 and how they may or may not treat resting limit orders differently. Here is what I am hoping I can see in market replay using this strategy:

    1. I might use a limit of 5 ticks and 10 bars before I cancel and resubmit a new limit because price moved too far the other way. Using this I might increase my limit fill rate vs. just going after GetCurrentBid on current bar update for example.

    2. If 5 ticks with a 10 bar wait until refresh isn't doing the trick I would like to scale this to maybe 10 ticks and and 20 bar wait until refresh and see if this improves my odds of getting to the front of the proverbial line.

    Does ninjatrader 7 or 8 have anything in the simulation engine that would be able to interpret these two examples differently? Would I be able to see the impact of employing a resting limit strategy or is this not possible?

    Thanks in advance.

    Ian

    #2
    Hello Ian,

    For NinjaTrader 7 and NinjaTrader 8 this will depend on if you are asking about real-time orders filled with the simulation engine or if you are asking about historical fills with the historical fill type algorithm.

    With Market Replay this would use the real-time simulation engine if the orders are being placed during playback after the chart is loaded.

    1. If the market is moving away from an order, sending a change order request to move the order to a new price closer to the market will make the order more likely to fill.
    It is not necessary to cancel the order and send a new order.

    A buy order fills at the ask, a sell order fills at the bid. Placing a sell limit order at the current bid price places you in line to have the order fill based on the level 1 volume at that price level at the time the order is accepted. As new volume is received, this closes the volume in front of you in line and then fills your order.

    This is the same for NinjaTrader 7 as it is for NinjaTrader 8.

    Your strategy for deciding to wait a few bars vs changing the price of the order on each new tick, is up to you.

    2. This is possible. The behavior for NT7 and NT8 would be the same.

    3. No, the behavior between NinjaTrader 7 and NinjaTrader 8 is the same with the simulation engine.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea,

      As always, thanks for your prompt response.

      So If I understand you correctly, in Market replay (after the chart loads and the new bars start moving) both NT 7 and 8 have the ability to treat resting limit orders with different prioritization? So in theory the simulation engine could handle the following 2 scenarios and treat them different:

      1. Strategy 1 places a new limit order on each bar update at 1 tick away from the current price. Using this strategy, these limit orders are perceived as being placed later in the queue therefore at a specific event (Call it Event X) the limit order is not filled due to the simulation engine finding that being in the back of the queue this order would likely not get filled on a price touch. The price was never penetrated so only the orders in the front of the queue would get filled during Event X.

      2. Strategy 2 places a resting limit order 5 ticks away from the current price and let's it sit for 10 bars before it cancels and resubmits the next resting limit. Using this method it gets in at the front of the queue. Therefore in (Event X) this limit order would get filled on price touch since it was in the front of the line.

      I just want to confirm that NT can handle resting limit orders differently from regular limit orders that are placed on every bar update. This is a fairly abstract concept to back-test, but a very important feature to have.

      Thanks,

      Ian

      Comment


        #4
        Hello Ian,

        1. Placing a new order would add the order to the queue. Any volume at that price would need to have volume to close from OnMarketData updates before your order is filled.

        Continuously placing new orders would cause the same behavior for each new order. Each new order will end up in the queue and would use volume to simulate fills.

        2. This would still be the same. If an order is cancelled and resubmitted, that is treated as a new order and that new order would be added to the end of the queue not the beginning of the queue.
        Imagine that you have placed an order to a live broker, your order will go to the end of the line not the beginning of the line.

        It is not possible to inject your order to the beginning of the queue before everyone else's orders.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea,

          I understand that any new order submitted would naturally go to the back of the queue. My line of questioning is around resting limit orders that are not placed on every bar update but may be placed once every 10, or 20 bars. So when they are first placed they are in the back of the line, then on each subsequent bar that passes they could potentially move up the queue by staying in line.

          In my first example I was referring to how orders placed on current bar events will always be in the back of the line.

          In my second example I was trying to convey that resting limit orders would be in the back of the line at first, but if they are left opened for 10 or 20 bars and then eventually get filled they may have moved to the front of the line. This would be because more orders would be like scenario 1 where on each bar update if the order is not filled, a new order is submitted at a new price relative to the close of the most recent bar.

          My theory is that if most of the orders are like scenario 1 (Based on current bar events) then someone that submits a resting limit and keeps it open for 10 or 20 bars (assuming it is far enough away from the current price and wouldn't just get filled in 1 to 2 bars) they would eventually move up higher in the queue.

          Is this assumption something that can be tested in the market replay simulator?

          Comment


            #6
            Hello Ian,

            If an order is placed and then is not cancelled and is not modified, it will move up in line as OnMarketData events come in. (This does not involve the bars on the chart)

            Any new order any time it is placed (ignoring the bars on the chart) will be at the end of the line.

            An order that is cancelled and resubmitted would be a new order.

            An order that is not cancelled and allowed to continue working would be a resting order. This would move up in position as volume is received in OnMarketData events.

            Yes, keeping an order open preserves its place in line. Submitting a new order puts the order at the back of the line.

            The behavior between NinjaTrader 7 and NinjaTrader 8 is the same.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Chelsea,

              Thanks! This answers my question. I have tested a few scenarios like this and they seem to be behaving in line with what I expected but I just wanted to make sure the simulator would support this type of functionality.

              As a follow up: Does Ninja Trader 7 and 8 both provide the same level of granularity? I heard that 7 only uses level 1 data to analyze volumes but 8 actually incorporates level 2 data. So would this make 8 more reliable or do they both handle this the same way? I am not sure if I am asking this the right way, but what I am trying to know is: Is there any material difference in 7 vs. 8 in the way they would handle / analyze my place in the queue via resting limit orders?

              Thanks for all your support!.

              Ian

              Comment


                #8
                Hello Ian,

                For real-time orders for both NinjaTrader 7 and NinjaTrader 8, the granularity is every market data event. This would be finer granularity than even 1 tick granularity.

                Is your question about historically filled orders (backtest)?
                Yes, NinjaTrader 8 allows for a High Order fill resolution while NinjaTrader 7 does not. This option will allow a script to use historical tick data to introduce intra-bar granularity to the script. NinjaTrader 7 requires that a secondary series of 1 tick be added to the script directly.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea,

                  My question is only in regards to Market Replay / Live SIM. I don't use the strategy analyzer / back-testing as I find it to be less robust. Thanks for providing me some understanding into the back-testing / strategy analyzer differences between 7 and 8. If there are any differences in 7 and 8 regarding market replay and how this could impact my query regarding resting limit orders could you please let me know?

                  Thanks,

                  Ian

                  Comment


                    #10
                    Hello Ian,

                    There are no differences between NinjaTrader 7 and NinjaTrader 8 with the simulation engine in filling orders that I am aware of.

                    However, there is an enhancement that now calculates risk in NinjaTrader 8 properly.
                    http://ninjatrader.com/support/helpG...ding_risks.htm

                    This is to use the account size to reject orders if there is not enough margin to cover the orders.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Johnny Santiago, Today, 10:05 AM
                    1 response
                    9 views
                    0 likes
                    Last Post Johnny Santiago  
                    Started by madhouse, Today, 09:44 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Spencer  
                    Started by Matt17, Today, 09:38 AM
                    2 responses
                    6 views
                    0 likes
                    Last Post Matt17
                    by Matt17
                     
                    Started by mikrodoctor, Today, 08:04 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Kate  
                    Started by lakman184, Today, 03:04 AM
                    1 response
                    14 views
                    0 likes
                    Last Post NinjaTrader_Jim  
                    Working...
                    X