Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

There are some issues in backtest

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

    There are some issues in backtest

    The time flow is not totally follow the time and that makes the execution in historical data is not correct, and finally makes the backtest result is not correct. For example, when I use a 15 minutes charts as the base, there is a buy signal on the close of the bar at 9:30am. At the same time, I have a short target open order that will touch the target price on the next bar. The program should close the open order when 9:30am bar closed because there is a buy signal at that time, instead the order closed on the next bar (9:45am) when the price touched the target price. And a buy order is opened at 9:16am when the 9:45am 15 minutes bar started to form. I use multiple time frames, such as 1 minute, 5 minutes and 15 minuts bars. The time lables are correct, but only when there is a target or stop loss order executed. It will put the 9:45am executed order information right after the 9:30am time stamp, then the 9:01am, 9:02am time stamp follows. It might be a bug and should be easy to fix. Thank you so much to pay attention on this important issue!

    #2
    Hi, thanks for posting. In multi time frame scripts the primary bar series will always be called first. This is noted in the multi time frame/instrument guide here:

    Note: Historical bars are processed according to their timestamps with the primary bars first, followed by the secondary, which is NOT guaranteed to be the same sequence that these events occurred in real-time.
    Based on the information given, it sounds like your script needs the updates from the smaller, secondary time frames but due to this condition this is not happening, Is this correct?

    Comment


      #3
      Hi Chris, thank you for the information. That is what I thought too. So I changed to 1 minute chart as the base and it worked the same as real-time.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      48 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X