I am developing an EA and one of the exit strategies is when the RSI flats out. For example:
Look at between 3 and 5. The peak becomes flat. In these moments, I want to exit my trade.
I understand that the challenge here is when do we consider the RSI line as flatted out? How long must the line be to be considered so. I want to consider it on the open of a new candle. So, basically, on the open of a new candle, if the RSI line of the previous 1..2 bars is flat, close the position.
I am thinking here that, for every new candle, I get the RSI of the previous two. If that value is very much similar, then I know there was not much different in the last two bars. But I am missing here the angle of the RSI lines, which needs to be fairly horizontal (no more than a 5 degrees angle).
Any help would be much appreciated!