![]()
If this is your first time visiting the MD programs page, please read the text on my profile .
Description of work
When changing the color of the Heiken Ashi indicator, the Expert Advisor opens a position, sets a virtual stoploss and takeprofit. The color change 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 Expert Advisor, 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 color of the Heiken Ashi indicator changes from red to blue (the default color).
Condition for opening a Sell position
The color of the Heiken Ashi indicator changes from blue to red (the default color).
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 - number of deals with repeated volume, pcs (0 - not used)
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)
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)
Average True Range indicator settings
The Average True Range 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.