Total number of bars in the simulation, determined from Lookback, StartDate and EndDate and from the available data in the price history files. Is 0 in the initial run before the first asset call.
Total number of ticks processed in the simulation, determined from the price history
resolution. Is 0 in the initial run before the first asset call.
Current bar number including the lookback period and preceding history, usually from 0 to NumBars-1. The number is not
necessarily counted up straight since bars can be skipped (see remarks).
Number of the first bar after the lookback period. (Bar-StartBar) is the current
duration of the test or trade period in bars. (StartBar-LookBack) is the number of the first bar after the INITRUN.
Number of the last bar.
Number of the first valid bar of the selected asset. Can be different for asset
whose histories begin later than the initial bar.
Current trading day number of the simulation, starting with the end of the lookback period. Periods with no bars, such as weekends and holidays, are skipped.
- NumBars and StartBar are only valid after the asset history was loaded.
- The Bar number is normally increased by 1 on every run, but
there are exceptions. When the simulation starts at a certain StartDate or when WFO cycles are trained,
bars from the price history preceding the LookBack period are skipped
and Bar can start with a high number after the initial run.
Bar can even 'jump back' at the begin of any backtest WFO
cyle when the RECALCULATE flag is used.
- The number of bars spent in drawdown, and other bar statistics at the end of the simulation can be found under Strategy statistics.
printf("\nBar %i of %i",Bar,NumBars);
Bars, BarPeriod, BarOffset, LookBack, StartDate, run
► latest version online