Hi guys: I am currently working on an Ea trying to modify some settings and I need some help trying to modify the entry rules for the RSI indicator. The EA open the trades this way:
if(rsi>upper) return(sell); //upper is 70
if(rsi<lower) return(buy); //lower is 30
What I need is the EA to open a sell once it cross the 70 level down after it cross it up, and buy when it cross the 30 level up after it cross it down. I was thinking to change it to sell when is rsi is lower than 70 and buy when is higher than 30 but this is actually the same thing and both orders contradict each other at the same time.
Please, can someone help me to code this? I am attaching a pic. so you can see better what I want.
Thanks in advance.
if(rsi>upper) return(sell); //upper is 70
if(rsi<lower) return(buy); //lower is 30
What I need is the EA to open a sell once it cross the 70 level down after it cross it up, and buy when it cross the 30 level up after it cross it down. I was thinking to change it to sell when is rsi is lower than 70 and buy when is higher than 30 but this is actually the same thing and both orders contradict each other at the same time.
Please, can someone help me to code this? I am attaching a pic. so you can see better what I want.
Thanks in advance.