Dear colleagues,
I have a problem with coding an exit for short and long orders with the RSI, or based in the “colour” of the candle.
As part of a system in EUR/USD, I am buying(Long/Short) every time one single candle (in TF: 1h) is bigger than 30 pip size and together with other requirements.
Once the system buy, I want to exit the order, once the first next candle is opposite to the order (i.e.- If I am short, I want the strategy to exit short if the first candle is long and there is an increase in RSI compared to the previous one.
I have tried with the following code but no success whatsoever. I have tried different options and obviously I must be doing something wrong. I am attaching a pic of one operation I can’t solve with my coding.