Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting Multiple Time Frames in NT = useless?

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

    Backtesting Multiple Time Frames in NT = useless?

    According to this page,


    .. while backtesting, this page implies that my 3 minute bars (from 3 one-minute-period AHEAD of the 1 min bars) show up with 1 minute bars SIMULTANEOUSLY with the 1 minute bars.

    This MEANS.. that the 3 minute bars are "looking into the future" while the 1 minute bars are 2 minutes behind.

    This seems like utter nonsense.

    It would screw up any strategy to the point of uselessness (when backtesting multiple time frame instruments).

    Am I correct in this observation? Please tell me this can be fixed somehow, or worked-around.

    THANKS!!!

    #2
    Forgot to add.. according to the page I referenced above, if I simply set the CalculateOnBarClose property to FALSE, can this all be alleviated?

    However, THAT.. would mean that when I run the strategy forward, (note: I only calculate on bar-close), I will have to change the code CalculateOnBarClose property to TRUE?

    Does anyone else flip this switch between real-time and backtesting (for those of you who calculate on bar-close in real-time?

    Comment


      #3
      Normally, you would want to organize your strategy trade logic so that backtesting and forward testing provide similar results. Rewriting separate code for testing and implementation is possible, but not ususally practical.

      You have to understand that intra bar for the current bar, bar data includes Open, Close, High, Low data fields. For forward testing or live trading, the Close field takes the value of the Last trade.

      So, Close of the current bar is constantly changing until the current bar expires and becomes historical; a new bar is then started. For backtesting, there is no intra bar historical data, High, Low, Open, Close. I don't know if NT provides intra-bar detect with backtesting, but from your comments, apparently not.

      Consider setting CalculateOnBarClose to False, but conditional tests for trade triggers on the previous bar. This allow trade triggers immediately at open of the next bar. Some parts of your strategy may not want to wait for the open, like a stop losss, so you won't be limited with having CalculateOnBarClose set to True.

      Comment


        #4
        Chris, I'm not sure I follow you - CalculateOnBarClose is set to true in backtesting per default (as in backtesting only the OHLCV info is known, not the intrabar formation) as such you can access the closed candle values only, in contrast to this in realtime you can access for example the closed finer series value and developing larger timeframe together - this can be done by setting then CalculateOnBarClose to false and working with FirstTickOfBar in the series context where you would like to access value 'on close'.



        To simulate getting an intrabar fill in backtesting, please see this sample here -

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,769 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        943 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        10 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by rocketman7, Today, 01:00 AM
        0 responses
        7 views
        0 likes
        Last Post rocketman7  
        Working...
        X