MetaTrader 4帮助
MetaTrader 4帮助User InterfaceTesterOptimization Results

Optimization Results

Unlike testing, optimization is supposed to perform many passes for mechanical trading system (MTS) with different inputs.


This is done to determine the expert parameters with which its profitability is the highest. To optimize, one has to flag the "Optimization" field in the tab of tester setup and press the "Start" button. After that, two new tabs will appear in the window: "Optimization Results" and "Optimization Graph".

The "Optimization Results" tab, unlike Tester Report, publishes not the entire list of trades, but final reports of each pass. All data are represented in the table with the following fields:

  • Pass – the pass number;
  • Profit – net profit (gross profit minus gross loss);
  • Total trades – the total amount of open trade positions;
  • Profit factor – the ratio between total profit and total loss in per cents. One means that total profit is equal to total loss;
  • Expected Payoff – mathematical expectation of win. This statistically calculable figure shows average profitability/unprofitableness of one trade. It is considered to show the estimate profitability/unprofitableness of the next trade;
  • Drawdown $ – maximum drawdown relating to the initial deposit in the deposit currency;
  • Drawdown % – maximum drawdown relating to the initial deposit in per cents;
  • Inputs – dynamic values of inputs at each pass.

After having clicked with the left mouse button on the heading of any column, one can sort all entries of the table in decreasing or increasing order. Data of the selected pass will be entered as basic inputs of the expert (expert properties window, the "Inputs" tab) after the "Set Input Parameters" context menu command has been executed. At that, the program switches to the "Settings" tab, and optimization mode will be stopped. Having pressed the "Start" button, one can test the expert advisor having the pre-defined input parameters and variables. The same action can be done by a double click with the left mouse button on the pass line in the tab of optimization results. Using the "Copy" context menu command or accelerating keys of Ctrl+C, one can copy the selected results to the clipboard for further use in other applications. If no line has been selected, the entire table will be copied to the clipboard. The "Copy All" command can be used to copy the entire table to the clipboard, as well. The report of the optimization results can also be stored in HTML format on the hard disk. To do so, one has to execute the "Save as Report" context menu command. Other context menu commands allow to set up displaying of results:

  • Skip Useless Results – show/hide the results of loss passes;
  • Show Input Parameters – show/hide the "Inputs" column;
  • Auto Arrange – automatic setting of column sizes when the window size changes.
    The same action can be done by pressing of A;
  • Grid – show/hide grid to separate columns.
    The same action can be done by pressing of G.

More details are given in the sections of "testing Expert Advisors" and "Optimization".