Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

backtest vs. market replay

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

    backtest vs. market replay

    Hi,
    when I have calculate on bar close then backtest should give the same result as market replay, right? Is there anything I should also consider when transferring strategy to real-time while I use calculate on bar = close and I enter each new bar for open price and for market order? I do know about slippage and spread (negligible, I did some calculations, those are high liquidity markets), but what I am asking about is difference between backtest and market replay data inside Ninja Trader, how it accesses data and calculates with them .... and what to do or change to make market replay do same trades as backtest. I struggle to solve problems with my strategy which makes totally different trades, it is a very simple crossover strategy that should enter for open at market price.
    Thanx in advance for any tips.
    N.

    #2
    nicknamed, first of all I suggest you review those insights here -



    Next - what market are you trading on?

    In FX for example the bid price is usually used, so going from backtest to Market Replay (where you would have bid / ask for fills) can produce quite a different result, so in those case the slippage / commissions need to be consided to be comparable.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I will check the link, thanx for it. Right now I am testing on ES 09-10.
      The slippage and spread would change entry and exit prices but not bars, there is no profit target or stoploss and still, it produces totally different trades while using the same US RTH session.
      N.

      Comment


        #4
        Correct, the first step would then be debugging why your trades are that different - do you load an appropriate historical data amount in Market Replay, too? Are both replay and historical data from the same source?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Well, what is strange that when compared on market replay data (MRD) with backtest on minute data from IQFeed, trades were the same (just spread was different, which is ok for me). So that works and now I am happy and can go live but anyway, When I did play market replay data and then later when there were few weeks of this summer ES 09-10 I attached the script and saw backtested results on MRD, while then later when I run it again and the script was attached from the very beginning, it returned totally different trades signalling that "backtest" on MRD gives different results from regular backtest or MRD replay. Maybe I did a mistake when setting up a strategy or something but I guess not as I only refreshed/reloaded the strategy.

          Comment


            #6
            nicknamed,

            When you attach a strategy from the beginning and run the Market Replay that is effectively real-time processing of your strategy. Depending on how you program the strategy real-time vs. historical backtests would not necessarily be the same. Signals build differently when you have every single tick updating the price bars meaning you could get signals that would not have been seen otherwise from a historical backtest scenario. This would be especially true if you use CalculateOnBarClose = false.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh a I wrote few posts before, that I used calculate on bar close true and that there is certain discrepancy between backtest on MRD data and regular backtest. Just read the whole conversation, but only if you'd like (I feel you read only my last post) as I am happy that my real trades are the same as on regular backtest and need nothing more right now. Thanx anyway for interest in helping.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by traderqz, Today, 12:06 AM
              3 responses
              6 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by RideMe, 04-07-2024, 04:54 PM
              5 responses
              28 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by f.saeidi, Today, 08:13 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by DavidHP, Today, 07:56 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by kujista, Today, 06:23 AM
              3 responses
              11 views
              0 likes
              Last Post kujista
              by kujista
               
              Working...
              X