BUENAS NOCHES
NECESITO UN SCRENER BASADO EN EL MAGICTREND CAMBIO DE ROJO A VERDE PARA ACCIONES ENTRE 3 Y 30 DOLARES
GRACIAS DE ANTEMANO
Ahí está:
cciP = 20
atrP = 14
atrM = 1
smaP = 5
IF BarIndex > max(cciP,atrP) THEN
lastCCI = thisCCI
thisCCI = CCI[cciP](typicalPrice)
myATR = AverageTrueRange[atrP](close)
//
temp2 = Average[smaP,0](myATR) * atrM
buffDN = high + temp2
buffUP = low - temp2
//
IF (thisCCI >= 0) AND (lastCCI < 0) THEN
buffUP = buffDN[1]
ENDIF
IF (thisCCI <= 0) AND (lastCCI > 0) THEN
buffDN = buffUP[1]
ENDIF
IF (thisCCI >= 0) THEN
IF (buffUP < buffUP[1]) THEN
buffUP = buffUP[1]
ENDIF
ELSIF (thisCCI <= 0) THEN
IF (buffDN > buffDN[1]) THEN
buffDN = buffDN[1]
ENDIF
ENDIF
IF thisCCI >= 0 THEN
MagicTrend = buffUP
ELSIF thisCCI <= 0 THEN
MagicTrend = buffDN
ENDIF
ELSE
thisCCI = 0
lastCCI = 0
myATR = 0
buffUP = 0
buffDN = 0
buffDN = 0
buffUP = 0
MagicTrend = 0
ENDIF
c1 = close CROSSES OVER MagicTrend
c2 = (close >= 3) AND (close <= 30)
Cond = c1 AND c2
SCREENER[Cond]
Ahí va
cciP = 20
thisCCI = CCI[cciP](typicalPrice)
screener[thisCCI >= 0 and thisCCI[1] < 0 and close>3 and close<30]