Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing strategy on market replay gives worse fills on faster replay speeds

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

    Testing strategy on market replay gives worse fills on faster replay speeds

    Hello,

    I'm testing a strategy on Market Replay using Market Replay data that was downloaded from NT.

    I am getting different fills during a live replay depending on the replay speed that was set.

    What I did to verify the issue.

    Started the Market Replay from the beginning on MAX speed.
    Once the first order was filled and completed I stopped the replay. It entered long @ 3369.00 with a market order.

    This didn't seem right since it should have been 1 tick above the previous bar's high.


    I then restarted the Market Replay from the beginning (same starting spot as when testing it on max speed)
    I ran the replay on high speeds until it got within a few minutes of the previous trade.

    I then turned the speed down to "1x" and it entered long @ 3368.00 with a market order, in this case I got a whole point better on "1x" than when on "max"
    I've tested this scenario multiple times and the same thing happens.


    I noticed the issue due to awful fills when running the replay on high speeds.

    I don't see how this could be related to my strategy since it's the same exact scenario, only with different speeds. This seems to be a bug with the market replay feature.

    Thanks!

    #2
    Hello Chrundle, thanks for your post.

    The Replay connection will replay every tick in the market regardless of the speed that it's set to. Are you seeing ticks come in on a slower speed that are not coming in on max speed? Print out the condition set you are using and the time the condition set becomes true e.g.

    Print("Checking Condition" + " " + Time[0]);
    if(<condition1> && <condition2>)
    {
    Print("Condition True " + <condition1> + " " + <condition2> + " " + Time[0]);
    EnterLong();
    }

    What differences do you see in max/minimum speed?

    Are you able to see the same thing when testing the SampleMACrossover strategy?

    I look forward to assisting.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response!

      The ticks are coming out the same regardless of speed, the difference is when the order is being filled and the price at which it's filled at.
      I set a variable to track the currentTime in the onBarUpdate and logged that time in the onOrderUpdate, when the order was filled.

      Also, something to note. I thought it may have been a market replay issue (it's wonky sometimes when coming back to a day that was previously downloaded)
      So I disconnected and connected to CQG to redownload the data for that day, but since it's just over 3 months, it wasn't available. I connected back to market replay with the same setup as before, and when on max speed the fill was at 3368.5 when before and in the screenshot above, it filled @ 3369

      When at max speed, this was the results.

      Code:
      Checking Condition 10/5/2020 9:50:00 AM
      Checking Condition 10/5/2020 9:50:00 AM
      Checking Condition 10/5/2020 9:50:00 AM
      Checking LONG Condition 10/5/2020 9:50:00 AM 3367.75
      Checking Condition 10/5/2020 9:50:00 AM
      Checking LONG Condition 10/5/2020 9:50:00 AM 3368
      LONG Condition True 10/5/2020 9:50:00 AM 3368
      Checking Condition 10/5/2020 9:50:00 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:02 AM
      Checking Condition 10/5/2020 9:50:03 AM
      Checking Condition 10/5/2020 9:50:04 AM
      Checking Condition 10/5/2020 9:50:04 AM
      Checking Condition 10/5/2020 9:50:04 AM
      Checking Condition 10/5/2020 9:50:04 AM
      Checking Condition 10/5/2020 9:50:04 AM
      Checking Condition 10/5/2020 9:50:05 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:06 AM
      Checking Condition 10/5/2020 9:50:07 AM
      Checking Condition 10/5/2020 9:50:08 AM
      Checking Condition 10/5/2020 9:50:08 AM
      Checking Condition 10/5/2020 9:50:09 AM
      Checking Condition 10/5/2020 9:50:09 AM
      Checking Condition 10/5/2020 9:50:09 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Checking Condition 10/5/2020 9:50:10 AM
      Scalp order filled @ 3368.5 10/5/2020 9:50:10 AM - CurrentPrice 3368.5
      When setting the speed to 1x before the order occurred...

      Code:
      Checking Condition 10/5/2020 9:50:00 AM
      Checking Condition 10/5/2020 9:50:00 AM
      Checking Condition 10/5/2020 9:50:00 AM
      Checking LONG Condition 10/5/2020 9:50:00 AM 3367.75
      Checking Condition 10/5/2020 9:50:00 AM
      Checking LONG Condition 10/5/2020 9:50:00 AM 3368
      LONG Condition True 10/5/2020 9:50:00 AM 3368
      Checking Condition 10/5/2020 9:50:00 AM
      Scalp order filled - 3368 10/5/2020 9:50:00 AM 3367.75
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:01 AM
      Checking Condition 10/5/2020 9:50:02 AM
      You can see the scalp order isn't filled for 10 seconds when on max speed, where it's instant while on 1x.

      I also was not able to reproduce with the SampleMACrossover strategy.
      Last edited by Chrundle; 01-06-2021, 06:03 PM.

      Comment


        #4
        I've been doing a bit more testing with the SampleMACrossover strategy and I'm definitely getting some weirdness.
        I downloaded a fresh week of market replay data for early November. I ran the SampleMACrossover strategy on max and opened a window of the trade results after it got through about half of the day.
        I then reset the playback to the start and recorded again on max and I'm getting different results every single time. Sometimes it's off by a second or two, sometimes more.
        Also, when setting the replay back to the start of the day sometimes a very large bullish bar appears as it goes from historical to live replay, that wasn't there before
        I let the replay play for a bit and reset it again to the start and it's gone again. This has happened multiple times now.

        I tried redownloading the same week of replay data and still have the same exact issues.

        Update: I cleared out the cache and redownloaded replay data again and still getting very different results each time I run the strategy.
        Last edited by Chrundle; 01-06-2021, 07:22 PM.

        Comment


          #5
          Hello Chrundle, thanks for your reply.

          Please make sure you are on the latest version of NinjaTrader 8. There were issues with the playback connection prior to 23.2. Please close out of NinjaTrader and install from the latest version below:

          NinjaTrader is a futures trading platform that delivers integrated multi-device trading. Discover our best platform to trade futures for active futures traders.


          Please test the playback connection again after updating to the latest version.


          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Oof, looks like that was the problem... I've been looking at the releases page for updates, but didn't realize it only lists the major versions and you need to drill down to see minor updates, oops.
            Thanks for your help, Chris!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by pechtri, 06-22-2023, 02:31 AM
            9 responses
            122 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by frankthearm, 04-18-2024, 09:08 AM
            16 responses
            64 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by habeebft, Today, 01:18 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by benmarkal, Today, 12:52 PM
            2 responses
            13 views
            0 likes
            Last Post benmarkal  
            Started by f.saeidi, Today, 01:38 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X