AK27Participant
Junior
//Coloured normal candles with Heikin Ashi
IF BarIndex=0 THEN
xClose = (open+high+low+close)/4
xOpen = open
xHigh = high
xLow = low
ELSE
xClose = (open+high+low+close)/4
xOpen = (xOpen[1]+xClose[1])/2
xHigh = Max(max(high, xOpen), xClose)
xLow = Min(min(Low, xOpen), xClose)
endif
if (close > open and xclose > xopen) or (close < open and xclose > xopen) then
DRAWCANDLE(open, high, low, close)coloured(0,220,0)
elsif (close < open and xclose < xopen) or (close > open and xclose < xopen) then
DRAWCANDLE(open, high, low, close)coloured(255,0,0)
endif
return
Bonjour à tous, j’ai eu une idée d’une customisation d’un indicateur, l’indicateur présent est un chandelier classique mais avec la variation de couleur en heikin pour eliminer le bruit, mais je pense qu’il peut être customisé en ayant la vraie couleur de la bougie en contours pour ne pas se perdre je vous met l’exemple en PJ. 🙂
Ci-joint le code qui peint les contours des chandeliers selon la direction de ces derniers (en utilisant l’instruction BORDERCOLOR) :
//Coloured normal candles with Heikin Ashi
IF BarIndex=0 THEN
xClose = (open+high+low+close)/4
xOpen = open
xHigh = high
xLow = low
ELSE
xClose = (open+high+low+close)/4
xOpen = (xOpen[1]+xClose[1])/2
xHigh = Max(max(high, xOpen), xClose)
xLow = Min(min(Low, xOpen), xClose)
endif
if close>open then
r=0
g=255
else
r=255
g=0
endif
if (close > open and xclose > xopen) or (close < open and xclose > xopen) then
DRAWCANDLE(open, high, low, close)coloured(0,220,0)bordercolor(r,g,0)
elsif (close < open and xclose < xopen) or (close > open and xclose < xopen) then
DRAWCANDLE(open, high, low, close)coloured(255,0,0)bordercolor(r,g,0)
endif
return