Repeat the complete simulation in training or test mode in as many cycles as
given by this variable (default = 0 = no repetitions). This is normally used for
doing reality checks, plotting histograms, running special Montecarlo simulations or evaluating result statistics dependent on changed parameters or randomized price curves.
The number of the cycle from 1 to NumTotalCycles.
Read/only, automatically set by NumTotalCycles.
Appends the given number to the log, performance report, and chart image files generated by the simulation. By setting LogNumber = TotalCycle, different log files
or chart images can be generated for any cycle. At 0 (default),
no performance reports are produced when NumTotalCycles is
used. Set this variable in the INITRUN before calling any function that writes something into the
- If BarOffset was changed or the
PRELOAD flag was set, prices are loaded again at the begin of every cycle. This causes a delay, but
allows to do simulations with different bar period or bar mode settings, or
modified price curves.
Otherwise prices are only loaded on the first cycle.
- For training on any cycle, set the TESTNOW flag
and run the cycles in [Train] mode.
Example (see also Detrend.c, Reality.c):
BarPeriod = 1440;
StartDate = 2015;
NumYears = 1;
LookBack = 0;
// run this simulation 1000 times
NumTotalCycles = 1000;
// some random trading strategy
if(random() > 0)
// plot the result of every run in a bar graph
► latest version online