I am trying to get an alert by having arrows highlighted on the chart indicating a reversal with a long bar using the RSI(14) indicator.
The condition for a BUY signal is:
RSI(14) < 50 and
Current Day RSI(14) – Previous Day RSI = 7.5
If this condition is met, an Arrow ( Black in colour ) is highlighted below the Candle Bar
The condition for a SELL signal is:
RSI(14) > 50 and
Previous Day RSI(14) – Current Day RSI = 7.5
If this condition is met, an Arrow ( Black in colour ) is highlighted above the Candle Bar
The attached chart will indicate what I require…
It is unlikely that todays RSI minus yesterdays RSI will ever exactly equal 7.5
Do you mean (less than or equal to 7.5) or (greater than or equal to 7.5)?
Plus your arrow positions and colours in the description do not match those in your image.
Perhaps this is what you mean:
a = rsi[14](close) - rsi[14](close[1])
b = rsi[14](close[1]) - rsi[14](close)
if rsi[14] < 50 and a <= 7.5 then
drawarrowup(barindex,low) coloured(0,0,255)
endif
if rsi[14] > 50 and b <= 7.5 then
drawarrowdown(barindex,high) coloured(0,0,0)
endif
return
Thanks for the reply and coding. I made a few changes which tells me that if RSI is lower than 50 and a> 7.5, there will be an Arrow pointing upwards below the candlestick. Interpretation would be that at market bottom, a long candle spiking up would indicate some sort of interest in the financial instrument.
Vice versa for market tops. Please see the chart as an example…. Than you very much for the coding help.
a = rsi[14](close) - rsi[14](close[1])
b = rsi[14](close[1]) - rsi[14](close)
if rsi[14] > 50 and a > 7.5 then
drawarrowup(barindex,low) coloured(0,0,255)
endif
if rsi[14] ><50 and b > 7.5 then
drawarrowdown(barindex,high) coloured(0,0,0)
endif
return
Glad to be of assistance. I was assuming that you were looking for a market top or bottom with a slowing of momentum which is why I chose < 7.5 but it did give an awful lot of arrows!
Please use the ‘Insert PRT Code’ button when posting code in future posts. I’ve tidied up your last post for you. 🙂