Replay - Puzzling Bar data from data file

Drago112

Member
Joined
Mar 22, 2020
Posts
11
Likes
2
I noticed something very puzzling about the open value of a bar at different timeframes/time intervals when replaying a strategy. I'm using a CSV data file which has 1 minute bar data. If I try to replay a strategy through it at 5 minute bar data, I get really puzzling results. Here's what I expect: the open for the 5 minute bar will be the same as the open of the 1st 1-minute bar, the close will be the close of the 5th 1-minute bar (the last in the interval), the high is the max high of the 1-minute bars in the 5 minutes and opposite for the low.

I get that sometimes. Let's say I start 15 minutes into the data, the bar data seen by the strategy (shown in Study Log) prior to the replay starting (it uses the initial 15 minutes to preload the strategy) looks correct, but at the time that 1st bar of the actual replay, that bar is messed up - the open is wrong. At one point, it was using the prior 1 min bar's close value as the new bar's open. At another, it started in the middle of the bar data. If I switch to 1-minute bar data, the bars match the CSV file.

I'm curious if anyone else has seen this behavior. If so, is this particular to loaded CSV files or does it also happen when getting data from a data feed? Is this only an oddity of Playback? Has anyone seen anything like this in normal mode? The context for these questions is that I'm trying to do various backtesting on a strategy and trying to figure out how the thing is going to act when I run it.
 
Top