Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting with CalculateOnBarClose=false

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

    Backtesting with CalculateOnBarClose=false

    Hi,

    I'm trying to backtest a simple moving average strategy.
    The input to the MA is 60m bars BUT I want to calculate on time sample smaller then the 60min.
    I want that the value of the MA will change like in real-time with CalculateOnBarClose=false so every 1min the MA value will be change as the close of the 1 minute bar change.

    Is there a simple solution for this?

    TX in advance!

    p.s. I can think on a complicated solution but maybe one of you has a better solution.

    #2
    Hello freewind,
    You can build a multi series strategy to backtest your strategy on a higher granularity timeframe. Please refer to the sample code which demonstrates how to do it
    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


    Please refer to our help guide to get more information on Multi-series concepts


    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I'm familiar with the multi-instrument strategy.

      But it doesn't solve the problem of updating the MA of the 60minute every 1 minute.

      Comment


        #4
        Hello freewind,
        Ok, I got what you are trying to do.

        Unfortunately there is no simply way of doing it. During backtest the calculations are made on the bar close only. You can make a synthetic data series/bar series, but nothing natively available.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, Yesterday, 10:06 AM
        0 responses
        22 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        19 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        10 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        41 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X