The signal to open BUY or SELL orders is formed based on the data received from the " SM ZigZag
"indicator. As soon as the indicator shows the formation of a downtrend (red line), the Expert Advisor places a BUY order with the set lot (the ability to choose in the settings whether it will be fixed or dynamic).
After placing the first BUY order with the initial lot, until the indicator has formed a blue line (an uptrend), the next BUY orders are placed after a certain step, which is changed according to the coefficient and with an increase in the lot, according to the coefficient.
All this continues until the " SM ZigZag
" indicator forms a blue line (an uptrend). As soon as the trend change line is formed, the process of placing SELL orders begins, according to the same scheme as the previous one with BUY. The strategy can be changed by changing the trigger in the "ReverceOrders" settings, or on the control panel by clicking the "Reverse open" button. In this case, the orders being opened are reversed, SELL will be opened instead of BUY and vice versa.
The value of the main settings:
Order setting - everything is clear here according to the method of calculating the lot. Use Buy/Use Sell-enable / disable auto trading (these are the buttons of the same name on the panel). Next are the SL and TP settings, the values of which can be selected in points, money or % from the deposit. The values that are not selected must have "0".
Grids setting - grid settings, everything is clear there.
Zig Zag Color setting- SM ZigZag
Technical setting - the settings of the trawl, the reverse of the opened orders, the setting of virtual TP and SL (hidden from the broker), the settings for protecting orders from drawdown are intuitive.
The value of the "Uselossinsurance"settings( protection of open orders from drawdown): LossInsuranceMoney and LossInsurancePercent if both are greater than zero, then the lowest total value is selected (money is calculated from the equity percentage), MinimumLoss is the minimum loss in one direction. LossInsuranceMoney and LossInsurancePercent - if both are equal to zero, then simply the profit in one direction should be greater than the loss in the other (meaning open BUY and SELL orders). MinimumLoss - you can also put zero, then the loss should simply be less than zero.
The second indicator, " SM trend cloud
", has an equally important task. It forms "clouds" of two colors, green – an uptrend and orange – a downtrend. If a BUY order command is formed on the first indicator, i.e. after the formation of the red line, and the cloud of the second indicator is green, the step and lot increment coefficients work as described above. If the cloud is orange, the lot and the step of subsequent orders of this series are equal to the first value, i.e. they are not multiplied by coefficients, but correspond to the initial values with equal intervals and Lots with an unchanged lot. These actions are necessary to reduce the drawdown in the event of a sudden trend reversal. But they can be disabled by using "Use_AndZadC=false" in the settings or by clicking on the "Not use and-zad-c" button on the panel. In this case, the coefficients applied to the lot and step when building the grid will always be applied, regardless of the " SM trend cloud
Automatic trading can be disabled if you change the state of the parameters in the settings UseBuy/UseSell=true, or the buttons are pressed on the panel (green color means the state is Enabled) Use SELL/Use BUY. And then the Expert Advisor will turn into an excellent utility for manual trading!
To speed up testing in non-visual mode, set the following parameters to false: Draw_AndZadC, Draw_ZigZag, ShowPannel.
Due to the peculiarities of the testing system in MT5, the ability to change parameters in the Expert Advisor panel windows will not work. You can edit these values only when using the Expert Advisor on a real or demo account. Keep this in mind!