Hola Mazarron,
Entiendo que quiere algo similar a la 2ª FOTOGRAFÍA?Debe explicarlo mejor lo que quiere…..
Pruebe este código y me dice…..Creo que ha quedado bastante bien!!
//adaptacion weinstein //variable :period=30 vmstop=1
period=30
vmstop=1
hismax=max(hismax,high)
maxim=highest[max(1,barindex)](low)
//indicador maximos minimos 52 periodos
maxma=highest[250](close)
minma=lowest[52](close)
//media ponderada y % stoploss
mp=weightedaverage [period](close)
vm=mp-((mp*((vmstop+100)/100))-mp)-0.00
//puntos
atr=averagetruerange[20]
topy=high
topx=barindex
topy2=vm
boty=low
botx=barindex
if close>maxim[1]then
endif
//semaforo alcista alfayate
mm30=weightedaverage[30](close)
cap=volume*close
maxi=highest[250](close)
volmax=highest[250](cap)
vol=((cap*100/volmax)*4/5)
volpmed=exponentialaverage[250](vol)
distanciamax=abs((close[0]-maxi)/close*100)
riesgostop=abs((close-mm30)/close*100)
SL=topy2+atr*0.00
//verificacion y representacion de condiciones //verifica estado si comprable "memoria" 52s
if comprado=0and(distanciamax<2and riesgostop<10and riesgostop>2and cap>1000000and myATLASMini<=0.1and fr>=0.1)then
compra=1
comprado=1
venta=0
drawarrowup(barindex,lowest[3](low)) coloured(0,125,255)
drawtext("BUY",topx,topy+atr*0.66,dialog,standard,14)coloured(0,100,255,220)
drawtext("———————-SL=#SL#",topx,topy2+atr*0.00,dialog,standard,11)coloured(255,0,100,180)
else
compra=0
endif
if comprado=1and(riesgostop>=30or fr<=-0.9)then
venta=1
compra=0
comprado=0
drawarrowdown(barindex,highest[3](high)) coloured(250,0,0)
drawtext(".",botx,boty-atr+0.66,dialog,standard,14)coloured(255,0,100,180)
else
venta=0
endif
//indicador rscmansfield2
ignored, fr=call "rscmansfield2"
myATLASMini = CALL "Blai5 ATLAS Mini"
if close>mp then //bullish mp
r=0
g=255
else //bearish mp
r=255
g=0
endif
return mp coloured(r,g,0) style(line,2) as"media ponderada",vm coloured(255,0,0) style(DOTTEDLINE,1)as "media ponderada % stoploss", maxma coloured(0,125,255) style(line,3)as "maximos anuales",minma coloured(255,125,125)style(line,3) as "minimos anuales", compra coloured(0,153,0)as "compra",venta coloured(255,0,0)as "venta", fr as "mansfield"