Trade based on RSI value when moving from top to bottom?

 

Hi,

Is there a way to code to buy or sell only when it touches the value while coming from top to bottom?  I mean, the condition for buy is when RSI value touches 30 and for sell, when RSI value touches 70.  But I don't want the trade to happen when RSI moves from 35 to 30 instead i want the trade to happen when it reaches 20 or 25 and then while reaching 30, it should buy?  same for the sell case also.

Someone plz help

 
Help with what? You stated a want. Show your code
 
Sathish Justin:

Hi,

Is there a way to code to buy or sell only when it touches the value while coming from top to bottom?  I mean, the condition for buy is when RSI value touches 30 and for sell, when RSI value touches 70.  But I don't want the trade to happen when RSI moves from 35 to 30 instead i want the trade to happen when it reaches 20 or 25 and then while reaching 30, it should buy?  same for the sell case also.

Someone plz help

But why?
Rsi can go from 30 to 50 keeping the same value on the next bars
If you check there is a lot of examples of ea working with rsi.

 
Marco Montemari #:

But why?
Rsi can go from 30 to 50 keeping the same value on the next bars
If you check there is a lot of examples of ea working with rsi.

Because, if i set the RSI condition to 70 for the sell trade, when it is moving from 65 to 70, it places the sell trade and the price may further go up and RSI may reach above 90 and it may stay in the 90 to 100 range for so longer period on trends.  Just to avoid the drawdowns and the trends, if the trade happens when it places the order while returning to 70, the losses may be minimized so?

Reason: