Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tick Backtesting

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

    Tick Backtesting

    Hi,
    I´ve a strategy based on the price crossing the EMA. I´ve done a backtest with the strategy analyzer, and I see that the order is executed after the close of the candle that crosses the ema, at the opening of the next one, but I need the order to be executed right at the crossing, at the tick.

    How can I configure the strategy analyzer to perform the backtest at the tick?

    Thank you.

    #2
    Hello PEPSAM,

    Thanks for your question.

    The short story:

    It is going to be much easier to test this kind of strategy with the Playback connection since Playback mimics realtime data.

    Discrepancies between realtime and backtesting - https://ninjatrader.com/support/help...ime_vs_bac.htm

    Playback - https://ninjatrader.com/support/help...l?playback.htm

    The long story:

    Backtesting only includes the OHLC points of the bar to estimate market movement and estimate order fills. There is no intrabar movement in a backtest to simulate order fills intrabar or to simulate intrabar logic.

    It is possible to have orders filled with intrabar data by using High Order Fill Resolution or by submitting orders to an added single tick data series.

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

    Backtesting with Intrabar granularity - https://ninjatrader.com/support/help...ipt_strate.htm

    The above has to do with order fills being simulated with intrabar data. Allowing the strategy to processes OnBarUpdate with historical data following Calculate.OnEachTick or Calculate.OnPriceChange requires the use of Tick Replay.

    Tick Replay - https://ninjatrader.com/support/help...ick_replay.htm

    Tick Replay cannot be used with High Order Fill Resolution, so you could use Tick Replay with a strategy that submits orders to a single tick data series, or you could simply use Playback to test how the strategy would behave when processing price changes.

    Let us know if you have any additional questions.

    Comment


      #3
      Thank you for your quick response.

      If I backtest in Playback, I run into two problems:
      - 1st, The time to perform a long time backtest could be tremendously long.
      -2nd, Once the backtest is finished, I would not be able to analyze the results as well as I would analyze them as a backtest.

      Can you help me with these two problems?

      Thank you.

      Comment


        #4
        Hello PEPSAM,

        Playback would use Market Replay data or historical tick data to simulate realtime data. You may get better performance testing historical tick data with Playback since Level 2 data may not be required to be played back.

        We should also consider: adding the intrabar movement and Tick Replay to the Strategy Analyzer will add a performance hit since we are adding the intrabar movement and making it more like Playback.

        Once the backtest is finished in Playback, you can right click on the strategy in the Strategies tab of the Control Center to view a Realtime Strategy Performance Report. You may also use the Control Center's New > Trade Performance window to view trades. The displays here will offer similar reports to the Strategy Analyzer.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        81 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        149 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        52 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        59 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X