The expert system analyses the local trend and awaits the rollback of the price against the detected trend. The history period for searching for the trend and rollback is specified in the settings, the settings allow to specify custom parameters for buys and sells. The Expert Advisor does not make any time gaps on history, woks on the full history base. The Expert Advisor does not use Martingale of grid, the maximum amount of orders in one direction is two. Real Take Profit and Stop Loss are used together with virtual ones for safety reasons.
The expert system is designed in a way that the ticks do not have key value. You can perform tests in any testing mode. Modes: every tick, every tick based on real ticks, by breakpoints and opening prices will be as close as possible to each other. This construction is implemented by using sampling of the active operations per one minute. That is, no active operation (except safety stops) can not be performed in the body of a minute, active operations are executed by open prices.
The EA uses netting system of position accounting (one symbol can have only one position). The EA does not work with independent position accounting (hedging, when there can be multiple positions per symbol). Account without hedging should be selected for testing on a demo account. Also, consider this fact when opening an account for live trading.
Rating of the currency pairs for the expert system: EURUSD;USDJPY;AUDUSD;EURGBP;USDCAD;GBPUSD;EURJPY;USDCHF;USDJPY.
For the optimization to be correct, it is necessary to leave only one direction (buy or sell) enabled. Optimize for 1 year, the Custom parameter.
The template files for the optimization of buy and sell are provided in the first message in the comments. As well as examples of finished optimizations for different currency pairs. An important rule is to set the drawdown cut to 5%, and select the optimization results with the drawdown up to 5%. And for working, change the parameters and set the maximum drawdown to 20%, because the market is unpredictable and this will take care of that.
The following are the parameters that define the operation modes of the expert (in general):
- NameSettings – Allows to specify the name for the setting.
- SelfPeriod – Set the EA operation period.
- WorkOpeningPrices – Activates sampling of the active operations by opening prices.
- TrailingOpeningPrices – Samples the trailing stop (based on opening prices).
- LotDigits – Rounding for the lot (2-0.01 ; 1-0.1 ; 0-1.0).
- Risk – Sets the lot depending on the deposit (per $1000 at Risk=1000, lot is 0.01 (at LotDigits=2)).
- Lot – Volume of the position, if the 'Lot' is greater than zero, the 'Risk' parameter is ignored.
- MulLotLimit – Limiting the maximum lot size (multiples relative to the initial one).
- Drawdown – Virtual Stop Loss, % of the balance (drawdown by funds), at which the order is closed.
Personalized settings that differ in numbers in suffixes (for the number of the currency pair) and indication to buy and sell:
- SpeedControl – Enables or disables spread control, specified in the LimitAvgSpread parameter.
- LimitAvgSpread – For the correct operation of the EA, specify the average spread multiplied by 2.**
- On – Enables or disables the block (by symbol and direction to buy or sell)
- Inversion – Sets the operation direction, false - by channel, true - by trend (by channel is more effective).
- MulLotBuy – Lot multiplier for an impact trade.
- * StepToo – Step for placing an impact trade. [140-10-600]**
- * LengthLine – The number of bars to analyze rollbacks. [50-10-400]
- * MulTrend – How many times the number of bars to determine the trend is greater than the number of bars for the analysis of rollbacks. [5-1-21]
- TakeProfitReal – Take Profit - real.**
- * TakeProfitVirtual – Take Profit - virtual. [0.01-0.01-0.2]
- StopLossReal – Stop Loss - real.**
- StopLossVirtual – Stop Loss - virtual.
- BreakevenReal – Breakeven level - real.**
- TrailingStartReal – Trailing Start - real.**
- MulTrailingStopReal – Multiplier for the Trailing Stop relative to the Trailing Start.**
- * MinAngle – Minimum slope level of the trend line.** [100-10-500]
- * MaxAngle – Maximum slope level of the trend line. [1000-100-3000]
* Specified are the parameters which need to be optimized, and the optimization boundaries.
** All fields related to the price are specified in pips (for 5-digit quotes).