Data Horizon controls which part of the loaded market data is used for Generator calculations.
Use this section to:
This is one of the key sections for building an in-sample and out-of-sample workflow.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data Horizon ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; max_data_bars = 100000 ; Use these parameters to set the data range between "data_start" and "data_end". ; Set from where the actual trading starts with "trade_start". ; Text: "2023-05-25 00:00 UTC", "2023-05-25 00:00", "2023-05-25" or "25 May 2023 00:00 UTC" ; Negative number: number of days before the current date: -365, -30, -7 use_data_start = false data_start = "01 Jan 2020 00:00 UTC" use_data_end = false data_end = "30 Jun 2023 00:00 UTC" use_trade_start = false trade_start = "01 Jun 2023 00:00 UTC"
max_data_bars limits the maximum number of bars loaded after date filters are applied.use_data_start + data_start cut bars before the start date.use_data_end + data_end cut bars after the end date.use_trade_start + trade_start keep data for indicators, but start opening trades later.
When use_data_end = true, Generator stops the dataset at data_end.
Bars after that timestamp are excluded from calculations in that run.
Practical effect:
You can use data_end to create a clear split between historical training data and newer unseen data.
Typical 2-step process:
use_data_end = true to cap history at an older date.use_data_end = false).In Step 2, the bars that were excluded by Step 1 become your practical out-of-sample segment. This lets you check how strategies behave on data that was not included during the capped run.
Build collection only up to 30 Jun 2023:
use_data_end = true data_end = "30 Jun 2023 00:00 UTC"
Then validate the same collection on full history:
use_data_end = false