evaluate ()
User-supplied function that is called at the end of a [Test] run, or when [Result] is clicked, or in [Trade] mode when the status page is updated. Can be used for analyzing the performance or storing it for further evaluation in a user specified way.
Parameters:
perf - optional pointer to a PERFORMANCE struct containing the result of the test; defined in include\trading.h.
cleanup ()
User-supplied function that is called at the end of a simulation or session. Can
be used to copy files, free memory, or release other allocated
resources.
Remarks:
- All trade statistics and strategy statistics are available
in the evaluate function. The ...Long/...Short statistics parameters are for the last selected asset and algo.
- The print (TO_REPORT, ...) function can be used for printing user-specific data to the performance report.
- In [Train] mode the objective function is called at the end of every simulation. The evaluate function is called only in the test run after training when the TESTNOW flag is set.
Examples:
function evaluate()
{
printf("\nR2 = %.2f Mean = %.3f",ReturnR2,ReturnMean);
}
// plot a parameter histogram in [Test] mode - profit vs. BarZone
function run()
{
...
NumTotalCycles = 12;
BarZone = 2*TotalCycle;
...
}
void evaluate()
{
PlotScale = 10;
plotBar("Objective",TotalCycle,BarZone,Balance,BARS,RED);
}
See also:
Performance, trade statistics, user supplied functions
► latest
version online