I'm using the TesterStatistics()
function (called from the OnDeinit()
function) to export various strategy-testing statistical values:
void OnDeinit(const int /*reason*/)
{
int h = FileOpen("results.txt", FILE_WRITE|FILE_UNICODE|FILE_TXT|FILE_COMMON);
if (h != INVALID_HANDLE)
{
FileWrite(h, TesterStatistics(STAT_PROFIT));
FileWrite(h, TesterStatistics(STAT_SHORT_TRADES));
FileWrite(h, TesterStatistics(STAT_LONG_TRADES));
FileWrite(h, TesterStatistics(STAT_BALANCE_DD));
FileWrite(h, TesterStatistics(STAT_BALANCE_DDREL_PERCENT));
FileClose(h);
}
}
This works but seems limited to simple back-testing.
How can I export both the back-testing and forward-testing results?
Results of the forward test are displayed on the separate tab "Forward". The start date of the forward period is marked by a vertical line on the chart:
Can I access these information programmatically?