How it works
We use the Accelerator Oscillator indicator from where 4 values of bars are taken: Shift, Shift+7, Shift+14, Shift+21. Each of the indicator values is multiplied by its weight calculated using the formula (100-x(n)), where x(n) - is an optimized variable x1, x2, x2, x3. After multiplying values are summarized and exit value of the perceptron is received. If exit value of the perceptron is higher than 0, a buy is opened, if value is lower than 0, a sell position is opened.
Position opens on Stop Loss (Stop Loss required) and without Take Profit. When a position reaches a profit value that exceeds Stop Loss value on the spread amount and if there is an opposite signal, then the position is reversed by opening a position of a larger volume. If opposite signal does not appear, Stop Loss is set on the same level as it had been on the open position (according to calculations a deal is profitable on spread value).
If suddenly is impossible to open a position which is reversed due to close value of Stop Loss, the position will be closed and there will be one more attempt to open position on the next tick.
Stop Loss is required because a position can be closed and its Stop Loss can be moved only if the position is profitable. There has to be a possibility to exit in case the position is unprofitable.
The results of work of the Expert Advisor with the default settings for the last year EURUSD M15 are displayed in the chart.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/1104
Bollinger Bands drawn using DRAW_SECTION style is a usual mean to draw ZigZag. Time Frame on which it is calculated can be set in input parameters. That is why such an unusual style of drawing is used.SelfLearningExperts
Selflearning Expert Advisor
Good old Moving Average drawn using DRAW_SECTION style is a usual mean to draw ZigZag. Time Frame on which it is calculated can be set in input parameters. That is why such an unusual style of drawing is used.e-TurboFx
The Expert Advisor tries "to catch" rollbacks after a strong movement. Candlestick analyses is used