Basic Strategy – Adjustment 1 – Optimiser
The following image shows a typical result from using the Strategy Optimiser:
After a while, I found this report quite limiting. It only shows successful strategies that have a positive P&L and it doesn’t show how the EA has performed within different sections of the time period. For example, a strategy that is loss making for 9 months, but profit making for 3 months is very different to a strategy that is profit making for 12 months.
The following adjustments include a class which writes to a data file called OptimizationLog.csv every time the EA is terminated. If the strategy optimiser is run 10 times, then the EA should write to the OptimizationLog 10 times. However, because every EA is an independent run and would need to be recorded for the purpose of strategy optimisation, the OptimizationLog must be cleared manually before each run of the Strategy Optimiser to ensure the file only contains results from that Optimisation.
MQL Code: | BasicStrategy_Adjust1_Optimizer |
Class: | C_TradeManagement |
Class: | C_OPTIMIZATION_LOG |