Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest using daily bars (same bar signal)

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

    Backtest using daily bars (same bar signal)

    Hi, I've read a number of thread in this forum and couldn't find the answer I'm looking for.

    I am trying to backtest a gap fade strategy using daily bars of the ES and the rules are simple:

    1. Buy tomorrow if the open < today's close
    2. Short tomorrow if the open > today's close
    3. Close at EOD

    I was successful in backtesting this idea using tradestation but can't figure it out how to do it in NinjaTrader as I can't buy/sell on the same bar.

    Another point, I can backtest it using intraday data but it seems Ninja (via Zen-Fire) only goes back to 2006.

    Thanks in advance for your help.

    #2
    Hello Trading Humble,

    When Backtesting, entries will take place on the open of the bar following the condition. When running a strategy live you can choose to execute orders as soon as the condition is true, controlled with CalculateOnBarClose setting. See here for expected discrepencies when backtesting versus running a strategy in real time.

    You may look into this reference sample on Backtesting NinjaScript Strategies with an intrabar granularity to process signals on one time frame and execute on another.

    You can look into supplementing the Zenfire feed with another provider. You will typically get more history with a "Data Only" provider such as DTN/IQ, eSignal, or BarChart.

    See below for a list of our providers and the level of data supported or each.

    Click here to view more information on Historical Data
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan, thanks for your reply. I was able to code the backtesting using intraday data but as I said, not enough historical intraday data, which leads me to the next question:

      I have historical data saved in .txt and was wondering if it's possible to supplement my existing ZenFire history with my .txt history... will NinjaTrader (7) merge everything together during backtest?

      Thanks.

      Originally posted by NinjaTrader_RyanM View Post
      Hello Trading Humble,

      When Backtesting, entries will take place on the open of the bar following the condition. When running a strategy live you can choose to execute orders as soon as the condition is true, controlled with CalculateOnBarClose setting. See here for expected discrepencies when backtesting versus running a strategy in real time.

      You may look into this reference sample on Backtesting NinjaScript Strategies with an intrabar granularity to process signals on one time frame and execute on another.

      You can look into supplementing the Zenfire feed with another provider. You will typically get more history with a "Data Only" provider such as DTN/IQ, eSignal, or BarChart.

      See below for a list of our providers and the level of data supported or each.

      Click here to view more information on Historical Data

      Comment


        #4
        Yes, this is possible. The imported history is applied to an instrument, and the data will be available for charting or backtesting.

        See here for the format expected for data import.

        NinjaTrader 7 import is done through Tools > Historical Data Manager
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        668 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X