Prova semplicemente a trasformare l’indicatore in uno screener, senza utilizzare CALL.
Basta togliere le righe grafiche (DRAW…..) ed le eventuai righe iniziali con DEFPARAM.
Dopodiché, al posto di RETURN devi mettere:
SCREENER[condizioni](criterio_di_selezione AS "criterio")
Ad esempio questo è lo screener ricavato dalll’indicatore di Nicolas https://www.prorealcode.com/topic/rsi-linear-regresion/:
//PRC_RSILinearRegressionSignals| indicator
//25.09.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from tradingview
//https://www.prorealcode.com/topic/rsi-linear-regresion/
// --- settings
len = 21 //RSI Length
period = 200 //Period
deviations = 2.0 //Deviation(s)
// --- end of settings
irsi = rsi[len](close)
periodMinusOne = period-1
Ex = 0.0
Ey = 0.0
Ex2 = 0.0
Exy = 0.0
for i=0 to periodMinusOne
closeI = (irsi[i])
Ex = Ex + i
Ey = Ey + closeI
Ex2 = Ex2 + (i * i)
Exy = Exy + (closeI * i)
ExEx = Ex * Ex
next
//slope
if Ex2=ExEx then
slope = 0.0
else
slope= (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)
endif
ilinearRegression = (Ey - slope * Ex) / period
intercept = ilinearRegression + barindex * slope
deviation = 0.0
for i=0 to periodMinusOne
deviation = deviation + square((irsi[i]) - (intercept - slope * (barindex[i])))
next
deviation = deviations * sqrt(deviation / periodMinusOne)
startingPointY = ilinearRegression + slope / periodMinusOne
//lineColor
if startingPointY > startingPointY[1] then
//color.blue
//r=0
//b=255
else
//color.red
//r=255
//b=0
endif
a = startingPointY-deviation
//c1 = startingPointY
b = startingPointY+deviation
up=irsi crosses over a
down=irsi crosses under b
Cond = 0
if up then
//drawtext("↑ up",barindex,irsi-5,dialog,standard,20) coloured(0,255,0)
Cond = 1
endif
if down then
//drawtext("↓ down",barindex,irsi+5,dialog,standard,20) coloured(255,0,0)
Cond = 2
endif
SCREENER[Cond](Cond AS "1=Up,2=Dn")
//return irsi, a coloured(r,0,b) style(line,3) as "curve low",c1 coloured(r,0,b) style(line,3) as "curve", b coloured(r,0,b) style(line,3) as "curve high"
ho tolto DEFPARAM, comandi grafici, variabili inutilizzate ed ho sostituito Return con SCREENER. Dove c’erano i comandi grafici per stampare le frecce ho messo la condizione COND.