Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Tick Replay Bug

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

    Market Tick Replay Bug

    It seems that there is a big bug in the tick replay.

    I am running a strategy using tick data that I recorded during the day. I ran the strategy live, and then ran it offline using the recorded data, using the same strategy and settings. It came out very similar. But when I opened the "Strategies" window, disabled, and then reenabled my strategy, all the numbers came back way off.
    It seems that when you run the strategy while the playback is playing, NT is using tick data as it shows in picture 1, but when the strategy is disabled and then reenabled, it comes back with using only bar close and bar open calculations, like it's showing in picture 2. It should be using tick data at all times when "Tick Replay" is enabled in the data series, no matter if I'm playing the actual replay or just hitting the apply button.

    #2
    certainly you will get a reply from the support team, but I provide some links which might be helpful:

    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.




    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.




    Good luck
    Patricia

    Comment


      #3
      Hello DieSlower,

      Thank you for your post.

      What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 7.0.1000.? or 8.0.?.?).

      Please review the help guide document on the differences on real-time vs backtest (historical).
      http://ninjatrader.com/support/helpG...ime_vs_bac.htm

      When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

      Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.

      Below is a link to the help guide on Calculate.
      https://ninjatrader.com/support/help.../calculate.htm

      To improve the accuracy of a backtest, you may use Tick Replay along with an added 1-tick series to have logic processed intra-bar and have orders filled intrabar.

      Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data, but this does not allow for intra-bar order fills. You would need to add a single tick data series and submit orders to that single tick data series for a strategy that uses Tick Replay.

      High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.

      Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.

      SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/helpGuides/nt8/backtesting_ninjascript_strate.htm
      TickReplay - http://ninjatrader.com/support/helpG...ick_replay.htm
      Developing for Tick Replay - http://ninjatrader.com/support/helpG...ick_replay.htm

      Additional information may be found in this NinjaTrader Forum post —
      https://ninjatrader.com/support/foru...mance?t=102504

      Please let us know if we may be of further assistance to you.


      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        I think you misunderstood what I'm asking.

        I am using Tick data, that is not a problem, and I do get intra bar fills, normally. The difference in the pictures, is between me pressing play, when the Tick Replay is playing back (Which works just fine), vs making a Strategy value change and hitting the "Apply" button on the same Tick Replay that was just working fine with intra bar ticks. When you hit apply, it ignores the ticks even though they are all loaded and can be used.

        I'm using NT8 v8.0.24.0 64-bit
        Last edited by DieSlower; 12-18-2020, 11:24 AM.

        Comment


          #5
          Hello DieSlower,

          Thank you for that information.

          Please add a print to your strategy in OnMarketData() to print something along with the time of the bar to test if you are seeing prints for each tick when using Tick Replay. Do you see prints occurring for each tick in a NinjaScript Output window (New > NinjaScript Output)?

          See the help guide documentation below for information about OnMarketData(), Time[], and a forum post about adding prints.
          OnMarketData() - https://ninjatrader.com/support/help...marketdata.htm
          Time[] - https://ninjatrader.com/support/help...eries_time.htm
          Adding Prints - https://ninjatrader.com/support/foru...ing#post791121

          Also, please make a copy of the SampleMACrossover and add a print in OnMarketData() to print something along with the time of the bar to test if you are seeing prints for each tick when using Tick Replay. Do you see prints occur for each tick when using Tick Replay with the SampleMACrossover strategy?

          To make a copy of a strategy, follow the steps below.
          • Open a NinjaScript Editor window (New > NinjaScript Editor)
          • Double-click the Strategies folder
          • Right-click on the SampleMACrossover strategy
          • Select Save As
          • Name the copy of the strategy
          • Click OK
          Please let us know if we may assist further.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thank you @patricia70 and @Brandon, you gave me a lot of good resources.
            I'm not sure if what I had was a bug or not, but reading through the links I found a better way to do what I was trying to do.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X