Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Replay fill logic bug

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

    Market Replay fill logic bug

    I'm trying to understand the fill logic for Market Replay.

    Here's the scenario:
    --Running market replay at 1x speed
    --I'm using 1-tick bars with Level 1 data (bid/ask/last data series). monitoring Output Window and T&S window.
    --My strategy places a short limit order for 7 contracts at the ask (using GetCurrentAsk() to generate the signal), let's call it 100.00.
    Subsequently,
    --The bid never comes back to touch 100.00 so the order is never marketable
    --1 contract is traded at 100.00
    --Market replay records my order as filled.

    How is it possible for market replay to record a fill for a non-marketable 7 contract trade when this event was impossible based on the market data?

    #2
    One thing worth mentioning:
    --Using Strategy Analyzer this bogus fill never happened
    --I used a custom fill algo in this case, explicitly requiring passive limits to become marketable before recording a fill

    Comment


      #3
      What are you Simulator settings? From Tools-> Options-> Simulator tab, do you have "Enforce Immediate Fills" checked or unchecked?
      MatthewNinjaTrader Product Management

      Comment


        #4
        Originally posted by NinjaTrader_Matthew View Post
        What are you Simulator settings? From Tools-> Options-> Simulator tab, do you have "Enforce Immediate Fills" checked or unchecked?
        Matthew,
        I see the tab but wasn't aware of it. What should I set it to? Also, this isn't simulated data, do the settings apply to market replay, too?

        Comment


          #5
          The "Simulator" is the engine that is used to fill non-live orders. The settings configured here would apply for Sim101 and Replay101 account. This is not the same as "Simulated" data.

          If Enforce Immediate Fills is checked, the Simulator logic will fill orders based on price only and ignore volume conditions. If you want to simulate how an order might fill on a live account, you should un-check it and it should take the volume traded into consideration before it fills.
          MatthewNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Matthew View Post
            The "Simulator" is the engine that is used to fill non-live orders. The settings configured here would apply for Sim101 and Replay101 account. This is not the same as "Simulated" data.

            If Enforce Immediate Fills is checked, the Simulator logic will fill orders based on price only and ignore volume conditions. If you want to simulate how an order might fill on a live account, you should un-check it and it should take the volume traded into consideration before it fills.
            Well, it is unchecked and the trade is still not possible but NT says it is. So, where does that leave us?

            Comment


              #7
              Volume data is insufficient. The order was either marketable or it wasn't.

              Comment


                #8
                We'd need to be able to reproduce to analyze what's happening. What instrument are you replaying, and what is the market time at the time (including your computer time zone) you see this bug? Did you download the data from our servers so we can test on our end?
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by bluelou View Post
                  Volume data is insufficient. The order was either marketable or it wasn't.
                  And yes, I agree that the order is marketable or wasn't, but volume is going to be used in the logic if you have that option unchecked. You said that 1 contract traded, not all 7 yes? This would indicate the simulator saw a bid price trade at that level, if even for a moment as you seem to have indicated you received a partial fill. The core events on market replay should be reproducible so we should be able to tell you exactly what happened if you can provide the exact scenario.
                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    Originally posted by NinjaTrader_Matthew View Post
                    We'd need to be able to reproduce to analyze what's happening. What instrument are you replaying, and what is the market time at the time (including your computer time zone) you see this bug? Did you download the data from our servers so we can test on our end?
                    IQFeed data on 6E continuous contract at 2013-12-02 4:04:12 ET

                    market is 1.3549 bid x 1.3550 ask

                    Limit sell order placed at ask = 1.3550.
                    Bid never hits 1.3550, max bid is 1.3549
                    Last series shows 1 contract traded at 1.3550

                    Thus, a fill of this order should be both non-marketable and impossible.

                    Comment


                      #11
                      It was recorded as a complete fill of all 7 contracts, not a partial fill. Also, this volume assumption that you're speaking of doesn't make sense to me. If it were true that 7 contracts traded (for instance, someone aggressed and crossed the spread and bid/ask quotes didn't change) why would you assume that it was my 7 contracts that were at the top of the book. That's as bad as using fill type = liberal.

                      Comment


                        #12
                        So you're using the 1-tick series through Add() to monitor the bid/ask? Or you're using GetCurrentBid() to verify the bid?

                        This is important to understand as there is a difference between the historical bid/ask data you have downloaded from IQFeed and the market data that the simulator is looking at.

                        Where did you obtain the market replay data you're using? Was that downloaded from our servers, or you recorded yourself/downloaded from a 3rd party?

                        re: Volume, typo on my end. It does not consider volume traded, but the volume advertised at the bid/ask. e.g., You have 7 contracts at X price, and only 5 contracts resting at the bid, it would not be possible for all 7 contracts to fill. This is irrelevant, we can move on since you have clarified it was a complete fill.
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          Originally posted by NinjaTrader_Matthew View Post
                          So you're using the 1-tick series through Add() to monitor the bid/ask? Or you're using GetCurrentBid() to verify the bid?

                          This is important to understand as there is a difference between the historical bid/ask data you have downloaded from IQFeed and the market data that the simulator is looking at.

                          Where did you obtain the market replay data you're using? Was that downloaded from our servers, or you recorded yourself/downloaded from a 3rd party?

                          re: Volume, typo on my end. It does not consider volume traded, but the volume advertised at the bid/ask. e.g., You have 7 contracts at X price, and only 5 contracts resting at the bid, it would not be possible for all 7 contracts to fill. This is irrelevant, we can move on since you have clarified it was a complete fill.
                          Matthew,
                          For market replay I'm using GetCurrentAsk() and GetCurrentBid().
                          //When I run Strategy Analyzer I use 1-tick bid/ask/last series using Add()

                          The replay data was recorded by me and the source is IQFeed
                          That's reassuring to know that NT is using the quoted volume, but still doesn't resolve the problem, of course.

                          Thanks for sticking with this and trying to figure out the puzzle here.

                          ~Lou

                          Comment


                            #14
                            Definitely agree something is not adding up. Can you email us your market replay files for that date so we can debug further? platformsupport[at]ninjatrader[dot]com

                            With NinjaTrader shut down, you should just be able to zip up the 2013-12-02 date in NinjaTrader 7/db/data/20131202
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Matthew,
                              I just sent the data - only for 6E .nt2 and .ntm files, though. Otherwise, it was still 33 MB compressed.

                              ~Lou

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by judysamnt7, 03-13-2023, 09:11 AM
                              4 responses
                              59 views
                              0 likes
                              Last Post DynamicTest  
                              Started by ScottWalsh, Today, 06:52 PM
                              4 responses
                              36 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by olisav57, Today, 07:39 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post olisav57  
                              Started by trilliantrader, Today, 03:01 PM
                              2 responses
                              21 views
                              0 likes
                              Last Post helpwanted  
                              Started by cre8able, Today, 07:24 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X