RSI70 Scanner ( Ref(close,2)

Hi ,

Please Help,

I am trying to code a Buy and Sell for RSI >70 .

But the thing is i want the parameter to be on the 2nd day or more of the RSI>70 not the current day or the one that just broke out of RSI70. I am thinking to use the Ref(Close, 2) but havent had any success.

For example, IF the stock just broke out of RSI70, i dont want that to be included in my scan, i want a stock that is on its 2nd or 3rd or more RSI70.

Thank you so much.

Ref( Close, 2 ) refers to future. To refer to past you should use Ref( Close, -2 ). See

but how ill i code it using RSI? if i use RSI(14)>70 for my Buy parameter, then it will include the current day RSI70 breakout. What i want are the stocks that is on the 2nd day or 3rd of its RSI is above 70. i want to exclide thr current day RSI70 breakout

SumSince() function of AmiBroker 6.10+ is way to go.
In short get latest AmiBroker 6.30. Then you can proceed easily (-> one line of code).


You should rather say purchase license for AmiBroker and then you will be able to use 6.30.

1 Like