Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Question about market replay tick data using different contracts

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

    Question about market replay tick data using different contracts

    I'd like to run market replay on CL and I'm confused about how to account for contract changes. Current contract is 07-23 but last month I was downloading 05-23 and have data from 3/16/23 through 4/5/23. I'm also looking into downloading more replay data from theintentionaltrader.com and wondering how I go about setting market replay over a long period. Is it just a matter of selecting the dates for replay once connected to the replay connection and then the program handles all the contract changes and looks in all the different folders?

    On a related note what happens if I accidentally download and store duplicate market data for one or more days in the replay folders?

    And finally... For anyone else with experience getting replay data via intentional trader's date range download tool, it seems to allow one to choose dates going back to 2014. But Ninjatrader only offers 3 months worth so what's that all about? Is that just a left over in the interface from when he created the tool or something?
    Last edited by markdshark; 05-25-2023, 06:28 PM.

    #2
    Hello markdshark,

    Playback data works differently than historical, you would need to select the specific contract on the chart that you wanted to play through. The merge policy would be for historical data which is how you see multiple contracts from the front month.

    If you download duplicate data it will replace the existing data.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you... So that begs the question. How do you backtest a futures contract using tick replay over a long period of time? is there language in the script that allows you to check for most active contract to do a programmatic rollover? Or do you hack the data storage by say dumping a years worth of tick replay data into a single folder?

      Comment


        #4
        Hello markdshark,

        TickReplay is for historical data use so you could use historical data with tick replay to test a longer period. Playback data is live market data that was recorded and is already granular so TickReplay is not necessary to use with playback.

        While you can have a script send keyboard commands to a chart to change the contract that would reset the strategy and its performance, it would be the same as just changing the contract and then applying the script fresh on the chart.

        JesseNinjaTrader Customer Service

        Comment


          #5
          ok sooooo... Market Replay uses a limited amount of historical data which is not Tick Replay data cos that is actually Historical market data but somehow less accurate than Market Replay data even though it's tick data which is basically about as granular as one can possibly get.

          Actual side-by-side data examples on the docs page might help clarify this a bit quicker maybe

          Do you guys find yourselves correcting each other in development meetings? (Now wait a second Jon do you mean "Historical" market data or "historical" market data?) I wonder what percentage of forum postings about back testing are related to the confusion over Market Replay and Historical data. It'd be neat if you had a back-end tool where posts were tagged with their pain points and then you could statistically determine which areas could benefit from some attention

          Is The Intentional Trader an officially sanctioned NT vendor? Back in 2018 NinjaTrader_JaredM posted a link on the forum which appears to have once led to a list of NinjaScript consultants but now seems to just lead to the main NT ecosystem page. https://ninjatraderecosystem.com/Vendors/Consultants#81

          Comment


            #6
            Hello markdshark,

            I believe you are confused about the data types here.

            The playback connection can use Playback data or Historical data, you have an option when you connect on which data to use.

            If you use playback data that is live data that was recorded. Only in playback meaning once you click play is that data used.It plays forward the same as you would see it in realtime because it is realtime data that was recorded. When you start a new chart in playback that chart may also be populated with Historical data which is only OHLC data points. Once you click play playback data is used. The playback also has the option to not use playback data and just play forward using historical data which is less granular. This is helpful if you find an instrument which does not have any recorded data but has historical data on the historical data server.

            TickReplay is a feature that allows NinjaScript to process tick data from Historical Data, this has nothing to do with playback or that connection. You can use this feature in any mode. The purpose of TickReplay is to allow a script to process tick data and also run OnMarketData in historical. This is not used for helping with execution accuracy, this is a processing mode for NinjaScript. https://ninjatrader.com/support/help...sub=tickreplay

            You can search the ecosystem website to find vendors, I am not part of the vendor support team so I could not provide any information about third party developers and if they are current or past vendors. ''
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thanks Jesse, yes it's true. I'm confused. Hopefully you can help me through this. Let me start by stating my goal which is to be able to backtest a chunk, let's say a year's worth, of /CL and /MCL data using a strategy that follows 1K tick and 500 tick charts of the /CL contract and places the trades at the 1 tick level of the /MCL contract. And I might want to throw the daily and/or the 5K tick series in there too, or experiment with others like the 2K tick, I'm not sure yet.

              In the strategy I currently load both the 1K and 500 tick dataseries for /CL, as well as the 1 tick series for /MCL.

              A. Now my current state of understanding is that I can't trust the backtests because they're using just open and close bar data so that's misleading.

              B. So then my next idea was to run with Market Replay data as that would be most accurate. But that's limited to 3 months at a time and apparently there's a new wrinkle I learnt of today which is that Market Replay is contract specific so even if I downloaded a years worth of Market Replay data somehow.... it would be pointless since I can't test the strategy as though it were one continuous contract.

              C. So following that my next thought is to use Market Replay but on Historical tick data downloaded (which I just learnt wouldn't be called Tick Replay cos that's something else entirely) because I believe that will merge the historical tick data into a continuous contract according to my preferred policy which is "merge without adjusting" AND give me tick level granularity (/accuracy?) for my backtests even though now I would no longer be using the backtest mechanism but the market replay mechanism on historical data instead.

              As an aside, tick replay sounds exactly like what I would want for a backtest but it seems the backtests can somehow both use Tick Replay AND/BUT only use the open and close data and therefore/also be completely inaccurate and misleading??? I'm sure I have that wrong. And the bit about multitimeframe and multiinstrument indicators not being able to use Tick Replay...and the bit about Tick Replay NOT designed to provide accuracy in backtesting concerning order fills and execution and should NOT be used to expect the exact sequence of executions as running a strategy on live data​.... Ok so no Tick Replay then. Seems to be more for viewing historic accurately built bars and perhaps indicators that require ticks ONLY... so that doesn't fit my needs at all.

              I'm not gonna ask if I'm on the right track but I would love to know if I am at least facing in the right direction at this point with where I am which is at the item labeled point C above. And was I mistaken anywhere in points A and B?

              Yours truly,
              Confounded.
              Last edited by markdshark; 05-26-2023, 04:40 PM.

              Comment


                #8
                Hello markdshark,

                a) That really depends on what you code and what settings your strategy uses. You will need to debug the strategy between use cases when you see differences. There is a post that covers that topic here: https://ninjatrader.com/support/foru...ay-performance

                b) Playback is limited to download, you can record any data you observe in realtime as playback data. Playback is not a backtest, that is how you would see the strategy perform in realtime. It is not very helpful to test long periods of time in playback because that would take an extremely long time to test. That is more for testing if your logic is actually working before moving to a live account. The next step in testing past playback is realtime on the sim account.

                c) Using playback with historical data is going to essentially be the same as a backtest. That just lets you step through the backtest instead of it running fully and then producing results. Its otherwise the same process.

                TickReplay is not used for fill granularity in a backtest so that is really not useful in increasing accuracy of backtests. If you need a more granular fill for more realistic results you can add a 1 tick secondary series that is used for fills. For a single series strategy you can also just use the UI option for the fill resolution which adds a second series to be used for fills. To execute logic more granular, for example intrabar updates, you need to add a secondary tick series and then use conditions to execute your logic on that series.

                TickReplay is mainly useful for scripts that use OnMarketData so that event is called historically to give an estimate.


                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by watson11, Today, 01:32 AM
                0 responses
                2 views
                0 likes
                Last Post watson11  
                Started by watson11, Today, 01:32 AM
                0 responses
                1 view
                0 likes
                Last Post watson11  
                Started by watson11, Today, 01:30 AM
                0 responses
                3 views
                0 likes
                Last Post watson11  
                Started by faisal00, Today, 12:34 AM
                0 responses
                2 views
                0 likes
                Last Post faisal00  
                Started by faisal00, Today, 12:33 AM
                0 responses
                1 view
                0 likes
                Last Post faisal00  
                Working...
                X