Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LIve SIM vs. Market Replay in NT 8

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

    LIve SIM vs. Market Replay in NT 8

    This should be an easy one, but I am trying to deconstruct and understand any and all differences between market replay and live SIM in ninjatrader 8.

    In NT 7 there were some additional features that allowed users to set delays in the live SIM that were not included as part of market replay. I think by default there were a few delay settings that maybe netted out to a 1 second lag, but this could be adjusted of course, so in theory you could get the delay between market replay and live SIM to only have the lag from your internet speed / data feed.

    In NT 8 I am not aware of any user configurable setting for delays so my first question pertains to this.

    1. Is there any sort of delay setting in Live SIM in NT 8 like there was in NT 7 and users just can't adjust this, but it is in place a permanent default? If so, what is this setting, just so I know the assumption.

    Beyond the potential delay setting that may or may not exist, these are the other things I am aware of that may come into play to explain some of the differences between Live SIM and market replay.

    2. Market replay files are ran from your computer to the simulator engine fairly instantly, so there is little to no lag between the price change / volume change events and when your code fires from various event handlers. In Live SIM, the data is coming in from a live data feed so depending on how fast your interest speed is, there can be a lag in moving between your strategy and the data. So the main difference here is just internet lag.

    3. Beyond internet lag there is a latency between interacting with moving data that will never stop, and the downloaded data that may be read line by line in tandem with your code. I suspect that the similar engine will execute your ninjascript in sequence with the downloaded data so that it almost behaves like pausing the data feed, reading and reacting to your script then unpausing the data feed and not getting behind at any point. With a live data feed there is no option to pause or slow down the data, so I think there will just be a natural lag there even if internet speed is nearly perfect with virtually no latency.

    4. There may be some differences between data providers. Kinetic vs. CGQ vs. Rhythmic all may have various differences. But I understand that Kinetic and CQG both have unfiltered data that is virtually identical, so I doubt there is any material differnce really. But maybe this is a bigger difference between other data providers. Specifically I would just like to know if CQG and Kinetic are in the same ball park in terms of unfiltered data, and should in theory be similar.

    5. I am under the impression that both market replay and Live SIM use the same simulation engine, so there is no difference in how fills are treated in one vs. the other. I would not expect there to be any differences here that account for performance differences.

    6. Settings: I gather that to get a truly strong apples to apples comparison the best setting to use would be a high tick setting such as 25, 50, 75 for the primary bar, with the added tick replay for additional granularity in sequencing the level 1 events. I just want to make sure I have this right. The other option would be to use the high resolution fill rate with 1 tick on each (market replay and live SIM). Let me know which would produce a more consistent - accurate comparison. (Tick Replay, or High Res @ 1 tick)

    So this is kind of it, as far as I understand it. Really the only main differences are just lag from the internet and lag from the delay between sequencing data with a live feed running vs a static file that is downloaded. Do I have this about right?

    I am in the process of reconciling some Live SIM trades vs. Market Replay and just want to get all the assumptions on the table to try to explain any differences that may arise. Please let me know if I have captured everything or if there is anything else I should take into consideration.

    Thanks,

    Ian

    #2
    I would not expect any type of <1 point scalper on a tick chart come close to live.

    The only difference I had going from Replay to Live is that the fills aren't instantaneous. My strategy was still processing incoming data (unlike replay were the fill happens first), and was processing other logic not knowing a trade was in progress. I had to add logic to basically wait until a fill happened. (This strategy has multiple trades per day based on what's happening.)

    Comment


      #3
      Sledge, Thanks for the feedback and insight. I have done a few weeks of reconciliation so far testing various things and have observed that the lag of the real time data feed impacts trailing stops significantly, but for resting limit orders or resting stop orders (as exits) submitted once the order is first entered, they are treated the same way. They are resting, so they either get hit or they don't but other more dynamic types of exits based on conditions can get triggered late.

      What did you mean by this exactly?
      Originally posted by sledge View Post
      I would not expect any type of <1 point scalper on a tick chart come close to live. )
      Do you experience slippage or difficulty getting filled or what?

      I think I have all the differences between Live SIM and market replay accounted for, but I just wanted someone from NT to confirm. A lot has changed since 7, and I just wanted to make sure I wasn't missing something.

      Thanks,

      Ian

      Comment


        #4
        Hello iantg,

        There are some differences between market replay data and real-time. This would be mostly timestamps of data.

        Below is a link to a forum thread where I have videos that demonstrate how to use prints to understand what is different between real-time and playback.
        Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea,

          Thanks for providing me with this helpful information. The videos are in line with my thinking that the only differences between live SIM and market replay is just the lag in the data. It looks like the time stamps on the fills in market replay are occurring after the submission signals but they are occurring in consistent intervals such as 1 second or .5 second from when the order was submitted. By contrast the live SIM seemed to fill the orders an different intervals that were around .25 to .75 seconds from when order was submitted. So in terms of the overall lag, it looked Market Replay had some lag built into it already between submitting and fill of anywhere from .25 to 1 second. Would you say this is a fair characterization?

          Outside of the fact that market replay will use a more consistent interval between submission and fill and Live SIM will use a more dynamic interval that might range from a fraction of a second to slightly more than a second, there is little other difference.

          Market replay and live SIM both use the same simulation engine.

          There does not appear to be any sort of delay settings in NT 8 like NT 7 had that could be adjusted, is this correct?

          Thanks for the support and happy new year!

          Ian

          Comment


            #6
            Internal Clock Timestamps

            I think I may have caught one more variable that may have a potential impact on live SIM.
            Would the delta between the exchange / data feed clock and your computers internal clock have a huge impact, and create a lag in reacting to everything?

            I just caught that my laptop was around 1 minute 30 seconds slower than the correct time. I believe this was impacting my strategy execution and could possibly explain why I was seeing some odd behaviour.

            Can someone from NT confirm that in automated trading a ninjascript runs off of both the computers internal clock as well as the time from the data received.

            Let me know if I am onto something here.

            Thanks,

            Ian Guthrie

            Comment


              #7
              Hello Ian,

              All data, historical and market replay, is converted from the exchange time to your local time and then stored on the computer with the local time.

              For NinjaTrader to function properly (even displaying charts) your PC clock needs to be in sync with internet time.

              Yes, your local PC clock being out of sync will cause differences in fill times (and may even change the bars on the chart)

              Below is a link to a post with steps to sync the PC clock.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Okay great, this is what I figured. I have been experiencing some strange things in live SIM and I think the time differences may account for some of it.

                I have also noticed that using 8.6 some of my trade statistics on the performance report are way off, but I believe this was a known bug and was addressed in later versions. I am trying to get my settings such that my market replay will be in the ball park with my live SIM.

                Assuming that I am using a newer version 8.10 or 8.11 and assuming my clock is in sync, is there any reason to believe that live SIM shouldn't be in the park with market replay using the same strategy on the same day? I am fully aware of the time stamp differences and fill differences and other dynamics, but I believe over thousands of trades, I should be + or - 50%- 75% similar, is this a fair assumption?

                Thanks,

                Ian Guthrie

                Comment


                  #9
                  Hi Ian,

                  While I can't comment on how off something can be (differences can add up), I can say that it should generally be very similar (especially if visually comparing on a chart).

                  In the videos I show that the visually it looks pretty much the same but small differences in time can cause orders to fill a slightly different price.

                  Using the prints, we can see exactly what cause the differences in fill prices.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by aprilfool, 12-03-2022, 03:01 PM
                  2 responses
                  326 views
                  0 likes
                  Last Post BottomShark77  
                  Started by AnnBarnes, Today, 12:17 PM
                  1 response
                  2 views
                  0 likes
                  Last Post NinjaTrader_Zachary  
                  Started by Lopat, 03-05-2023, 01:19 PM
                  4 responses
                  167 views
                  0 likes
                  Last Post Sam2515
                  by Sam2515
                   
                  Started by f.saeidi, Today, 12:14 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post f.saeidi  
                  Started by giulyko00, Today, 12:03 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post giulyko00  
                  Working...
                  X