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

Order Fill Resolution

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

    Order Fill Resolution

    Hi guys,

    Totally noob q as I have just started creating my first Strategy. It's a simple one using a 1-min Heiken-Ashi chart type and a couple of indicators. I didn't code it. I simply used the Wizard to create it.

    Given the Heiken-Ashi chart type, what Order Fill Resolution would replicate (as close as possible) to real world results in my case?

    I have tried to read the manual about the High Resolution method but it confuses me as to why we'd want to 'set a secondary bar series'. Maybe I'm not reading it correctly but if I wanted data from a secondary bar series wouldn't I use that bar type to fill my orders? So like use a Tick chart for Order Fills but execute my conditions with the indicators in the Strategy on the Heiken Ashi?


    Wow I'm so confused.
    Last edited by Bluebeep; 07-28-2018, 04:24 PM. Reason: The thing added too many paragraphs

    #2
    Hello Bluebeep,

    Historical data only has the open, high, low, close, volume for the bar and doesn't have any of the intra bar ticks information. This means historically if an order is between the high and low it will fill while in real-time it would require a valid price.

    Below is a link to a forum post that describes intra-bar granularity.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_ChelseaB,


      Thanks for jumping in on this and sending that link. Lots of fantastic information.



      Why is there no intra-bar data tho? Just curious... Does this mean that everyone backtesting a Strategy is essentially getting flawed results? And some are actually investing real money with it?


      Maybe I need to dive deeper into this but when I load up Market Replay and click the play button I can see movement in each tick. If this market movement is available in Replay, and I can Buy or Sell during a bar then what makes the information NOT available during Strategy testing? It seems to be that the information is already present in the NRD file since Replay can see and use this information. Where is automation failing?


      Not sure if I'm even looking at this the right way but I'm really new at this.

      Comment


        #4
        Hello Bluebeep,

        It really depends on how the strategy is being run in real-time. A script that runs in real-time with Calculate set to 'On bar close' that uses a time based bar (like minute) may not need intra-bar granularity (at least not as much as a script that runs in real-time would need) to match the historical results with the previous real-time results.

        Market Replay data is a solid recording that starts at a certain time and ends a certain time. It is not made of individual ticks or minutes. This is different than historical data which is time stamped ticks, minutes, or daily data that comes from the connected provider's historical data servers.

        Think of Market Replay as playing back a cassette tape that contains all of the information from the market (like market data update events that do not result in ticks). While historical data would be reading open, high, low, close, and volume of a tick, or minute, or day from a spreadsheet.

        Market Replay data is also a lot larger and loads a lot slower than historical data which is used to back fill a chart.

        The Strategy Analyzer uses historical data and does not use Market Replay recordings. Because historical data is not a solid recording but made of individual time stamps the granularity for order fills is based on the open, high, low, and close of the provided bar. If you are providing individual ticks this increases the accuracy of the time and price to the individual ticks received instead of a general high and low from a whole minute.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Why does the Strategy Analyzer not use Market Replay recordings? Would it take too much computing power to do the work since Historical Data is a lot smaller?
          Are both Historical Data and Market Replay stored in the same NRD file or is Historical Data downloaded from a provider/server on the fly when run?

          I'm assuming that it isn't possible to run a Strategy on Playback and speed things up so that it doesn't take the whole day to backtest a whole day. Or are these Apples and Oranges?

          I took a super basic strategy and ran it during the day today in SIM and just now I downloaded the Market Replay Data and applied the Strategy to it and boy what a difference! I made over $2,000 using the Strategy (Playback) and lost $600 during the day in SIM.

          Though with your help I kind of understand how this works, I still don't know how to make any useful attempts at backtesting. I'm beginning to feel like I need to create a strategy and run it in SIM for a few days to see what the results are coz they are more real-world-ish. Then tweak and run for a few days more and continue the process.

          Anything you can recommend to help so I can save years of my life?

          Comment


            #6
            Hello Bluebeep,

            While it may be possible to design NinjaTrader to automatically playback a Market Replay file and enable a strategy and have this run to the end of the recording, this would be extremely slow and would use a lot of resources when compared to backtesting with historical data. Optimizations would likely take tremendous amounts of time. Imagine with the fast computer available on the market a single backtest over a few months of data might take hours to complete.

            Think of the playback of market replay as a real-time feed. You can do anything you would normally do while connected to a real-time feed like running a strategy.

            Yes, you can connect to Playback and enable a strategy and test it over the market replay.

            Below is a public link to a forum post where I have demonstrated how to find the exact differences between each type of test. (Real-time, Playback, and Backtest)
            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


              #7
              Hi NinjaTrader_ChelseaB,

              Wow that’s fantastic news! I have the resources! I have a server that has 24 cores with hyper threading, 512GB RAM and plenty of storage space. I would be happy to run the server at max even for days to get say 1 year of Backtest data that I can feel confident about. Then re-optimize the Strategy and run again.

              I believe that NinjaTrader has multi threading capability no?

              So how would I do this? I have painfully downloaded each Backtest file (for 2 years) from a provider and ensured the files work for NinjaTrader 8 market replay. Would I simply have to activate my Strategy on the ‘Playback’ account? Then hit play and set it to Max speed?

              Would doing this get me the most accurate results?

              I just want to be sure that this is the best method for accurate Backtesting before I start.

              And thanks again for pointing me in the right direction. I’m excited again!

              Comment


                #8
                Hello Bluebeep,

                Below is a link to a forum post with videos that shows testing a script in real-time, backtesting, and Playback with Market Replay and comparing the results.
                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.


                As well as a link to the videos on the Strategy Analyzer and Playback.
                Strategy Analyzer - https://youtu.be/RaAWxf2jxp8
                Playback - https://youtu.be/CktTvESKo4w

                Using the Market Replay would get the most accurate results.

                NinjaTrader 8 is multi-threaded.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by andrewtrades, Today, 04:57 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                3 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                7 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X