Posted By: JamesHH
Generate bars whenever there is data - 10/23/21 16:35
I want to backtest a strategy, generating bars for whenever there is data for that bar.
Following the BarMode documentation, e.g. "For trading assets even at weekends, such as cryptocurrencies, reset BR_WEEKEND before sampling bars", I put this at the beginning of my script:
However, comparing with an export from the ZHistoryEditor, I see that the script is skipping thousands of bars (I presume on the weekend but I have not carefully checked yet).
Also, according to the docs, after resetting BR_WEEKEND, I would expect StartWeek and EndWeek to have no effect, yet changing these does affect the number of bars generated.
What am I misunderstanding, or is there possibly a bug here?
Following the BarMode documentation, e.g. "For trading assets even at weekends, such as cryptocurrencies, reset BR_WEEKEND before sampling bars", I put this at the beginning of my script:
Code
if (is(INITRUN)) { features = malloc(num_features * sizeof(var)); set(BR_MARKET | OFF); set(BR_WEEKEND | OFF); }
However, comparing with an export from the ZHistoryEditor, I see that the script is skipping thousands of bars (I presume on the weekend but I have not carefully checked yet).
Also, according to the docs, after resetting BR_WEEKEND, I would expect StartWeek and EndWeek to have no effect, yet changing these does affect the number of bars generated.
What am I misunderstanding, or is there possibly a bug here?