Problem in EA (MA & RSI) Combo
-
hi
I am tying to make an EA that will buy when price is above MA and RSI (70).
It will close the trade once price will be below MA and RSI is below 30.However facing the problem that EA is closing the trade below highlighted area.

Can anyone help why it is not closing on my required condition!
As far I understand, current EA is looking first to candle to break MA then RSI to go below 30. If RSI goes below 30 first and candle break MA later, then it is not closing the buy position.
-
@safeer992 can anyone help in this matter!
-
honestly, this is a very simple EA that can be solved using the standard dreema webpages for help.
https://fxdreema.com/examples
https://fxdreema.com/documentationyour problem can be understood easily if you read it back to yourself on the, if position, side.
-
@Safeer992 try connect the 2 condition blocks with AND block.
-
This problem is simple to fix I also look at your code. the problem is:
1: Price < MA200 at candle ID1
2: Price <X RSI value 30
With this rule at the right point, you mark the candle cross RSI level 30 is above MA200 this means EA will pass and try to find another one this right.

To fix the problem: the best way I think you need do 2 steps more:
1: Change Price <X RSI value 30 To Price < RSI value 30.
2: Make one function If trade >> price <MA200 need send an alert to your phone. to control this trade.