Dear All
Can someone please point me in the right direction on finding Overbought and Oversold conditions for Stochastic indicator. I have just found stochastic and MACD crossover indicator, would be great if screener could pick overbought and oversold conditions for this.
Stochastic MACD Oscillator
Many thanks
There you go:
LookBack = 20
if barindex >= 26 then
LL = lowest[LookBack](low)
HH = highest[LookBack](high)
StEMA12 = (Average[12,1](close) - LL) / (HH - LL)
StEMA26 = (Average[26,1](close) - LL) / (HH - LL)
StMACD = (StEMA12 - StEMA26) * 100
SigLine = Average[9,1](StMACD)
hhmacd = max(sigline,max(hhmacd,stmacd))
llmacd = min(sigline,min(llmacd,stmacd))
macdperc = ((stmacd-llmacd)/(hhmacd-llmacd))*100
sigperc = ((sigline-llmacd)/(hhmacd-llmacd))*100
endif
Result = 0
IF macdperc >= 80 THEN //OverBought
Result = 1
ELSIF macdperc <= 20 THEN //OverSold
Result = 2
ENDIF
SCREENER[Result](Result AS "1=Ob, 2=Os")
Many thanks Roberto.
When I run, it shows syntax error: This variable is not used in the code:sigperc
Is there I am doing something wrong?