Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting with secondary 1TickData series

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

    Backtesting with secondary 1TickData series

    Hello,

    My current strategy runs on a default 30min data series and the logic for entries and exits use a secondary 1tick Data series, the entire strategy is housed within the primary data series brackets.

    Trading will immediately begin on the open of my chosen 30min bar and will continue trading through the time span of the 30 mins but I'm assuming
    that since backtests run OnBarClose it will be called at the end of the bar and will not have a chance to trade intra-bar.

    For sake of explaining lets use the 9:30am (30 min bar). If I got this right, the the bar will open at 9:00:01 and close at 9:30:00 but OnBarClose will be called at 9:30:00 and the logic for the entries and exits using 1tick will begin at 9:30:00.

    How can I get the entries to begin at the open of the bar and not wait for it to be called when the 30 min bar closes?

    #2
    Hi Don22Trader1, thanks for posting. The strategy can add a 1 minute series using AddDataSeries() to perform some logic at the beginning of the 30 minute series. e.g.

    //Assuming the 1 minute series is the third series
    if(BarsInProgress == 2 && (Times[2][0].Minute == 0 || Times[2][0].Minute == 30))
    {
    Print("BIP 1 " + Times[1][0]); //will print at the top of every 30 minutes
    }​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X