Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Are all ticks used when backtesting in NT7?

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

    Are all ticks used when backtesting in NT7?

    Are all ticks used when backtesting in NT7?
    (This goes for backtesting automated trading algorithms via the Strategy Analyzer, Simulator, Market Replay and/or any other backtesting tools NT7 offers.)

    For example:

    1. Does NT7 use Bid ticks and Ask ticks when backtesting? Or does it just use Last ticks?
    2. Does NT7 create fake ticks within a bar to fill in the gaps between the bar's Open, High Low and Close (like Metatrader) when backtesting? Or does it only use the real Ticks that happened within the bar?
    3. Does NT7 show a trade closed at the actual Tick's price within a bar that activated a Stoploss or Takeprofit when backtesting? Or will NT7 just show the trade closed at the Open, High, Low or Close of a bar if a stoploss or takeprofit was activated within a bar?

    Thanks!

    #2
    Hello Matheyas5,

    Thank you for your post.

    If you are using a 1 Tick bar, then yes. Otherwise, the historical bars are built and the Strategy Analyzer just uses the Open, High, Low, and Close to build the bar.

    Fills use the Open, High, Low, and Close to determine the fill. You have two options to use; these include Default and Liberal. You can view the code for the Historical Fill Types under (My) Documents\NinjaTrader 7\bin\Custom\Type -> files are '@DefaultFillType.cs and @LiberalFillType.cs.

    Comment


      #3
      What about when doing this in your Market Replay tool? Or any other feature you have that involves backtesting?

      Comment


        #4
        Hello Matheyas5,

        Market Replay would replay the market as recorded. So tick-by-tick.

        Comment


          #5
          Hi Patrick,
          Is there a way to Optimize my automated trading strategy's parameters when using Market Replay?

          I ask because I want the Optimization to take every tick into account.

          Comment


            #6
            Hello Matheyas5,

            Thank you for your post.

            You could run Market Replay with one set of settings, export the performance from the Grid (http://ninjatrader.com/support/helpG...data_grids.htm) of the Strategy Performance (right click in the chart > select Strategy Performance > Real-Time) and then run another set of settings over the same date range in Market Replay.

            So very much manualy versus the automated optimization of the Strategy Analyzer.

            Do keep in mind that NinjaTrader 8 does feature Tick Replay which allows for testing historically and utlizing tick data to imitate the real-time market (so tick-by-tick). You can find more information at the following link: http://ninjatrader.com/support/helpG...y_analyzer.htm

            Comment


              #7
              Thanks Patrick. So just to confirm.

              Will running my algorithm in NT7’s “Market Replay” show exactly what would have happened if I had been live trading the algorithm?

              Comment


                #8
                No, it would not.

                There is no way to show exactly what would have happened. Market Replay has tick by tick replay so it allows for a more realistic look in backtesting. The executions will be based on the ticks proper, but keep in mind it is not expected to play out exactly as it would in real-time. Calculations should be accurate to real-time, but executions would not be considered exact to the real-time.

                For example, run a test over the real-time data, then run your strategy over the same date in Market Replay and likely the execution prices will be different and possibly the times as well.

                Comment


                  #9
                  For example, run a test over the real-time data
                  Are you referring to a papertrading test or live trading test?

                  Comment


                    #10
                    Matheyas5,

                    Sim or Paper trading. So set the account to Sim101 for example.

                    Comment


                      #11
                      Aside from the following three things, would you say the results of a Replay would mirror how my Algo would have reacted-to/processed Live Realtime Market Data?

                      -Execution latency.
                      -Slippage.
                      -Synching of L1 data to L2 data on a subsecond time frame.

                      If not, is there a link you can send me that explains how an Algo reacts-to/processes Replay data vs Live Realtime Market Data?

                      Comment


                        #12
                        Replay would mirror real-time trading as close as possible. Meaning items like Latency and Slippage would be a close as possible. You can also control the simulation fills on the Sim101 and Replay101 a bit more under Tools > Options > Simulator.

                        The L1 and L2 data is recorded in as received and would be in sync each other as they were received in the NinjaTrader platform.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by RubenCazorla, 08-30-2022, 06:36 AM
                        3 responses
                        77 views
                        0 likes
                        Last Post PaulMohn  
                        Started by f.saeidi, Yesterday, 12:14 PM
                        9 responses
                        23 views
                        0 likes
                        Last Post f.saeidi  
                        Started by Tim-c, Today, 03:54 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Tim-c
                        by Tim-c
                         
                        Started by FrancisMorro, Today, 03:24 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post FrancisMorro  
                        Started by Segwin, 05-07-2018, 02:15 PM
                        10 responses
                        1,772 views
                        0 likes
                        Last Post Leafcutter  
                        Working...
                        X