工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
I need an EA based on a simple Heiken Ashi indicator.
Trades should simply be triggered by Heiken Ashi COLOUR changes.
Buy order: Every time HA candle changes colour to the default Bull candle colour, for example Lime Green.
Exit buy order: Whenever HA candle changes colour to the default Bear candle colour.
Sell order: Every time HA candle changes colour to the default Bear candle colour, for example Red.
Exit buy order: Whenever HA candle changes colour to the default Bull candle colour (Lime Green) for example.
Note: I understand that the candle may change colour many times, the EA should take action accordingly each time the colour changes, i.e. buy when the new signal candle turns GREEN, but if the same candle turns back to RED, EA should automatically close the buy order and then place a sell order. If that same candle still turns GREEN again, that sell order should be closed and a buy order should be opened. Basically, the COLOURS control the trades.
In the picture above where the blue arrow is pointing, the GRREN candle was a buy signal following the last RED candle, indicating the end of bearish trend and the beginning of a bullish trend. However, market later decided to resume the down trend, and one of 2 scenarios could apply.
1. That GREEN candle could turn RED and the bearish continues, this was not the case shown in the picture above. For this scenario, the EA should take the following 3 actions;
a. Action 1 - When the GREEN candle first appears, the GREEN candle closes the existing sell order which was opened at the top where the red arrow is pointing. (Use option for Opposite signal close orders, in the parameters)
b. Action 2 – The GREEN candle immediately opens a buy order.
c. Action 3 - When the GREEN candle turns RED, close the buy order and immediately open a sell order. Then the downward trend continues, otherwise repeat the process.
2. The GREEN candle remains GREEN until it closes, and it is followed by a RED candle, this was the case in the picture above. For this scenario, the EA should take the following 2 actions;
a. Action 1 - When the RED candle appears next to the GREEN candle, the RED candle closes the buy order opened by the GREEN candle.
b. Action 2 - RED candle immediately opens a sell order.
I understand that a candle may change colour many times and many small losses may occur, but that is tolerable. I intend to use longer TF to manage that situation.
Parameters:
Lot type: Option between fixed and MM
Take Profit
Stop Loss
Trailing Profit
Other profit/loss money management
Magic Number
Max Spread
Slippage
Option: Close by opposite signal
Then add all other parameters as you consider necessary.