wma = WeightedAverage[34](close)
up = open>wma and close>wma
dn = open<wma and close<wma
r=0
g=0
b=255
if up then
r=0
g=255
b=0
endif
if dn then
r=255
g=0
b=0
endif
drawcandle(open,high,low,close) coloured(r,g,b)
return
irsi = rsi[14]
sto = stochastic[14,3]
bollup = bollingerup[34]
bolldn = BollingerDown[34]
up = close>bollup and irsi>70 and sto>80
dn = close<bolldn and irsi<30 and sto<20
r=0
g=0
b=255
if up then
r=0
g=255
b=0
endif
if dn then
r=255
g=0
b=0
endif
drawcandle(open,high,low,close) coloured(r,g,b)
return
Roberto si eres tan amable, por favor, podrías unir estos codigos en uno?
El primero es para dibujar las velas en verde por encima de la media y en rojo por debajo.
el segundo es de nicolás para cambiar el color de ciertas velas cuando las condiciones dadas por el stoch rsi y bollinger lo dan.
El problema que tengo es que no se como poner esos dos códigos en uno para tener sólo un indicador y esas velas extremas me cambien de color en el primer código.
Mil gracias de nuevo
He creado un nuevo tema para esta solicitud.
Por favor, no publique cosas diferentes entre sí en el mismo tema, de lo contrario, la búsqueda será muy difícil.
Gracias.
Lo haré lo antes posible.
Aquí está:
DEFPARAM CalculateOnLastBars = 2000
wma = WeightedAverage[34](close)
up = open>wma and close>wma
dn = open<wma and close<wma
r=0
g=0
b=0
if up then
r=0
g=255 //Verde claro
b=0
endif
if dn then
r=255 //Rojo claro
g=0
b=0
endif
//
irsi = rsi[14]
sto = stochastic[14,3]
bollup = bollingerup[34]
bolldn = BollingerDown[34]
up = close>bollup and irsi>70 and sto>80
dn = close<bolldn and irsi<30 and sto<20
if up then
r=0
g=160 //Verde oscuro
b=0
endif
if dn then
r=192 //Rojo oscuro
g=0
b=0
endif
//
IF (r+b+g) > 0 THEN
drawcandle(open,high,low,close) coloured(r,g,b)
ENDIF
RETURN
Disculpa por abrir un tema nuevo en otro anterior, no sabía esa norma. Ya no volverá a ocurrir.
Con respecto al indicador… GENIAL! Mil gracias Roberto eres el mejor 🙂
Un cordial saludo