Need help with iRSI

 

Hello Guys,

I am trying to build a RSI EA using iRSI in MQL5.

My strategy is simple. It should take a buy trade if RSI is crossing above level 30 and close buy trade when RSI crossing below level 70.

But currenttly iRSI is taking trades on level 30 no matter if it is crossing level 30 from above or below.

Is there any way to solve this?

 
saurabhB:

Hello Guys,

I am trying to build a RSI EA using iRSI in MQL5.

My strategy is simple. It should take a buy trade if RSI is crossing above level 30 and close buy trade when RSI crossing below level 70.

But currenttly iRSI is taking trades on level 30 no matter if it is crossing level 30 from above or below.

Is there any way to solve this?

Hi saurabhB .
Will assume there are no issues on how buffers are accessed or any timeseries direction errors ,and signals are checked every bar close and not on tick,and
the check includes comparing previous rsi close values (2 bars ago) to previous rsi close (1 bar ago) and not the live newly formed bar which will have the same rsi as the previous on open. 

From what you describe -if there are no buffers access issues- you need to code some form of control in your trading signal generator.
Checklist : 

  • Is there any comparison with previous values ?
  • Is the comparison of the rsi values (to track breach above /below) comparing the live bar with the recently closed bar which is the same value at the open?
  • Is the comparison of the rsi values including a case for =? (something like , if rsi_prev_prev<=30 && rsi_prev >=30 )
  • Are there controls to deflect signals that have been traded ?
 
saurabhB: I am trying to build a RSI EA using iRSI in MQL5. My strategy is simple. It should take a buy trade if RSI is crossing above level 30 and close buy trade when RSI crossing below level 70. But currenttly iRSI is taking trades on level 30 no matter if it is crossing level 30 from above or below. Is there any way to solve this?
Yes! You have to fix your broken code! So, if you need help with it, you will have to attach it here publicly, so that we can compile it, test it, and see what you are doing wrong.
Reason: