MACD Divergence and Crossing EMA
-
Kindly assist with sample EA i have made for buy only. The EA is not working properly as my requirement bellow. i don't know where i have messed up.
Kindly assist, see share project and advise
shared/tP8dyP5WcA BUY signal is generated when the following conditions are met:
•Classic Divergence: There is bullish divergence, meaning the price is making lower lows, but the indicator MACD is making higher lows. This suggests that the downward momentum is weakening, and a reversal to the upside may occur.
•EMA Crossover: The fast EMA crosses above the slow EMA, indicating a potential shift in momentum to the upside.
•Action: When all these conditions are met, the strategy suggests entering a BUY position.
-
-
Are those conditions supposed to happen at the exact same time for the buy to be open?
-
EMA crossover should happen after MACD divergence
-

-
-
That didn't answer my question? Do both conditions need to ce coincidential in time? I don't see it clear on your screenshot.
-
sorry for not being clear
Divergence should happen first then MA crossover -
In that case you need to use variables or flags, because thay happen in different moments in time. As soon as teh first condition is true (variable/flag), then you use a condition block requiring that variable/flag to be true BEFORE the second condition is search for on the market. You will need two separate structures for that.
-
@l-andorrà can you do it for me ?
kindly asking -
@thusego This is the general idea for a buy. You will need another variable for sells in reverse: