• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live vs. Backtest Performance

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

    Live vs. Backtest Performance

    Hello,
    I have found that strategies that perform well on backtest data are often drastically different (read very poor) in live market conditions. One source of the problem is the dynamic values of the indicators being calculated which may not be not an issue with historical data.

    What is the best way to mimic as close as possible the backtest results.? For instance is it better to implement a strategy On bar close, rather than On each tick/price change, in order to limit false fills in live markets? What other ways?

    Thanks for your help.

    #2
    Hello aaadetos,

    Thanks for opening the thread.

    As historical data is based on OHLC data, you can configure your NinjaScripts to Calculate.OnBarClose instead of OnEachTick to get results closer to what you are backtesting.

    As Realtime data is what we trade on with live accounts, it is good practice to write your strategy so its backtests are closer to the results that you receive in Realtime as opposed to the inverse.

    One way how you can improve back test accuracy is to submit orders to a 1 tick data series. You can also enable High Order fill resolution for backtesting single-series strategies against a 1 tick data series.

    Here is a sample strategy for back testing with intrabar granularity: http://ninjatrader.com/support/forum...ead.php?t=6652

    Historical Fill Processing: https://ninjatrader.com/support/help...ical_fill_.htm

    Discrepancies between Historical and Realtime: https://ninjatrader.com/support/help...ime_vs_bac.htm

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,
      Based on your post, would I be correct to expect that the performance results between back testing and live testing should be closest when testing directly on tick data, as opposed to different data series? Based on my testing, this seems to be the case.

      However, I do see that on tick data, slight differences still persist between using the standard vs high order fill resolutions (setting the high to a 1-tick granuarity). This can only mean that upon expiration of the say 150-tick bar, at the close of the bar (COBC ==true), the high order fill fills at the next available tick; but when does the standard order fill execute? I also expect it to fill intra-bar on the next bar after the bar close, since both order types are market orders; yet they are different, why?

      Thanks again.

      Comment


        #4
        Hello aaadetos,

        Thanks for your additional questions.

        When using the Strategy Analyzer, using a single tick data series to place orders to (using High Order Fill Resolution, or with a multi series strategy,) will give you closer to actual results than standard fill resolution. Your testing is correct.

        Standard Fill Resolution will fill orders using three virtual bars that mimic the price movement of a bar. This would mean that a trade could fill on the same bar if the movement of the virtual bars allows the order to be filled.

        This can be best visualized in the Understanding Historical Fill Algorithm section of the help guide. Here is an example:
        1. Open price to the High price
        2. High price to the Low price
        3. Low price to the Close price

        https://ninjatrader.com/support/help...lFillAlgorithm

        You can also test your strategies against Market Replay Data, as well, if you wish to test your strategy against recorded market data that is the equivalent to real time data. You can read more about using Market Replay and the Playback connection here: https://ninjatrader.com/support/help...connection.htm

        If you have any additional questions, please don't hesitate to ask.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by manueldecastro, Today, 12:57 AM
        0 responses
        5 views
        0 likes
        Last Post manueldecastro  
        Started by JulieG, Today, 12:40 AM
        0 responses
        5 views
        0 likes
        Last Post JulieG
        by JulieG
         
        Started by jimjoe123, Yesterday, 09:28 PM
        2 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by 12VMan, 08-20-2019, 09:29 AM
        2 responses
        25 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Started by tgn55, Yesterday, 09:50 PM
        0 responses
        5 views
        0 likes
        Last Post tgn55
        by tgn55
         
        Working...
        X