Hi All
Just a quick one please. I have written a screener using my Carver indicator combined with Nicholas’ volatility indicator (Directional Volatility). For some reason the screener is returning incorrect results. I’m after only showing shares that have the Long volatility higher than the short volatility. Also the MA section is not working. Any help appreciated.
///Carver Scaled Price Indy
n=21
a = highest[n](high[0])
b = lowest[n](low[0])
c = (a+b)/2
scaledprice = (close-c)/(a-b)
//Moving Averages
M1 = exponentialaverage[21]
M2 = exponentialaverage[63]
M3 = exponentialaverage[21](0) > exponentialaverage[21](1)
//Directional Vola
Period= 63
Deviation= 2
// --- end of settings
ShortS = Close[1] - Low
ShortMA = average[Period](ShortS)
ShortDev = Std[Period](ShortMA)
LongS = High - Close[1]
LongMA = average[Period](LongS)
LongDev = Std[Period](LongMA)
hlc3 = (high+low+close)/3
rawMoneyFlow = hlc3 * volume
ShortVol = (ShortMA + Deviation * ShortDev /rawMoneyFlow)
LongVol = (LongMA + Deviation * LongDev / rawMoneyFlow)
//Screener
Long = M1 > M2 and m3 and scaledprice >0.2 and LongVol > ShortVol
//Short = M1 < M2 and scaledprice >-0.3 and (ShortVol > LongVol)
SCREENER(Long)
SCREENER should be followed by brackets with conditions inside. Parentheses are used only for the sorting criterion.
Since you used only the latter, then ALL items are returned.
Replace (Long) with [Long].