![]()
If this is your first time visiting the MD programs page, please read the text on my profile .
Description of work
If the distance from the price to the Moving Average indicator is greater than the distance in the settings, the Expert Advisor opens a position, sets a virtual stoploss and takeprofit. The intersection is analyzed on a closed candle. When a signal to open a position appears, if there is a position in the market that was opened by the adviser, then the signal is ignored, i.e. only one position can be opened.
Features of work
The Expert Advisor is designed for hedging type accounts. It works on the instrument on which it is installed. If the terminal was restarted for some reason, the Expert Advisor will restore its data. It is not recommended to change the settings while the program is running, if you need to change the settings you need to remove the program from the chart and install it again with the new settings.
Condition for opening a Buy position
The distance from the price to the Moving Average indicator is greater than the distance in the settings, the price is above the Moving Average indicator.
Optional:
A fractal formed downward, (Check for the presence of a fractal = true).
+DI above -DI, (Check the ADX indicator = true).
Condition for opening a Sell position
The distance from the price to the Moving Average indicator is greater than the distance in the settings, the price is below the Moving Average indicator.
Optional:
A fractal formed upward, (Check for the presence of a fractal = true).
-DI above +DI, (Check the ADX indicator = true).
Conditions for closing a position
Stoploss or takeprofit crossing.
Optional:
Closing on the reverse signal, (Close on the reverse signal = true).
Expert advisor settings
General settings
Magic - to determine the deals that the Expert Advisor has opened
Timeframe - timeframe on which the Expert Advisor is looking for entry signals
Money management settings
Fixed volume - fixed volume, lots
Auto volume - auto volume, calculated by the formula lot = deposit * Auto volume / 100, perc (0 - not used)
Risk per deal - risk per deal, percent (0 - not used)
Volume increase mode - volume increase mode, volume increase after a loss or after a profit
Volume multiplier - position volume multiplier with increasing volume, coeff (0 - not used)
Additional volume - position additional volume with increasing volume, lots (0 - not used)
Number of deals to increase the volume - number of deals to increase the volume, pcs (0 - not used)
Number of deals with increased volume to reset to the initial volume - number of deals with increased volume to reset to the initial volume, pcs (0 - not used)
Number of deals with repeated volume - pcs (0 - not used)
Position opening settings
Distance from the price to the indicator MA - distance from the price to the Moving Average indicator, points
Distance from the price to the indicator MA using ATR - distance from the price to the Moving Average indicator calculated by the Average True Range indicator, coeff (0 - not used)
Check for the presence of a fractal - checking for the presence of a fractal before opening a position
Wait for the intersection after SL - a prohibition on opening a position after the stoploss is triggered until a new intersection of the price and the Moving Average indicator
Wait for the intersection after TP - a prohibition on opening a position after the takeprofit is triggered until a new intersection of the price and the Moving Average indicator
Position closing settings
Close on the reverse signal - close a position when a reverse signal appears
StopLoss - distance to loss limit, points
StopLoss using ATR - distance to the loss limit calculated by the Average True Range indicator, coeff (0 - not used)
TakeProfit - distance to profit taking, points
TakeProfit using ATR - distance to profit taking calculated by the Average True Range indicator, coeff (0 - not used)
TakeProfit relative to StopLoss - distance to profit taking calculated in relation to stoploss, coeff (0 - not used)
Breakeven settings
Breakeven activation - distance to breakeven activation, points (0 - not used)
Breakeven activation using ATR - distance to breakeven activation calculated by the Average True Range indicator, coeff (0 - not used)
Trading time settings
Use time
Start time - hours
End time - hours
Trading Stop Settings
Profit - when the value is reached, the Expert Advisor closes the position and is removed from the chart, the deposit currency (0 - not used)
Loss - when the value is reached, the Expert Advisor closes the position and is removed from the chart (must be a negative value), the deposit currency (0 - not used)
Moving Average indicator settings
The Moving Average settings are standard, as in the MetaTrader 5 terminal.
Average True Range indicator settings
The Average True Range settings are standard, as in the MetaTrader 5 terminal.
Average Directional Movement Index indicator settings
The Average Directional Movement Index settings are standard, as in the MetaTrader 5 terminal.
The default settings do not guarantee a profit, so the Expert Advisor needs to be optimized before work. If you have any questions about the settings of the adviser, then write to me in private messages.
In the future, I will expand the functionality of the Expert Advisor, so in order not to miss updates, subscribe to the channel here on the site ( https://www.mql5.com/en/channels/mql_development_en ), or to the telegram channel ( https://t.me/mql_development_en ).
Good luck to all.