Ho creato questo codice dal tuo, che è un grande passo avanti.
È possibile mostrare solo i ‘flat bottom’ di ogni nuova tendenza? dopo 5 HA dello stesso colore per esempio
// HEIKIN ASHI TRANSPARENTS ROBERTO 15.01.2022
// cul plat Nicolas 07.01.2022
defparam CALCULATEONLASTBARS = 50
xClose = (open+high+low+close)/4
IF BarIndex=0 THEN
xOpen = open
xHigh = high
xLow = low
ELSe
xOpen = (xOpen[1] + xClose[1])/2
xHigh = Max(Max(high, xOpen), xClose)
xLow = Min(Min(low, xOpen), xClose)
ENDIF
green = xopen<xclose and xlow=xopen
red = xopen>xclose and xhigh=xopen
////////////////////////////////////////////////////
if green and not green[1] then
drawpoint(barindex,xlow,5) coloured (9,82,40) //(0,200,0)// green
elsif red and not red[1] then
drawpoint(barindex,xhigh,5) coloured(200,0,0)// red
endif
/////////////////////////////////////////////////OK
if green > green [1] then
drawpoint(barindex,xlow,3) coloured (254,254,226) // jaune clair //(9,82,40) // green
elsif red > red [1] then
drawpoint(barindex,xhigh,3) coloured (254,254,226) // jaune clair //(200,0,0)// red
endif
///////////////////////////////////////////////
// HEIKIN ASHI TRANSPARENT ROBERTO 15.01.2022
//t = 30 //Trasparenza (0=invisibile, 255=piena)
// Heikin Ashi candlesticks (definition)
once xOpen = open
xClose = (open + close + high + low) / 4
if barindex > 0 then
xOpen = (xOpen[1] + xClose[1]) / 2
endif
xLow = min(low,min(xClose,xOpen))
xHigh = max(high,max(xClose,xOpen))
//
//IF close > open THEN
if green > green [1] then
DrawCandle(xOpen,xHigh,xLow,xClose) coloured(0,255,0,t)bordercolor(27,79,8) // vert clair bordure vert foncé
//ELSE
elsif red > red [1] then
DrawCandle(xOpen,xHigh,xLow,xClose) coloured(255,0,255,t)bordercolor(255,2,2) // rose magenta bordure rouge
ENDIF
RETURN t as " HA transparent "
/////////////////////////////////////////////////
// Variable :
// t = 0 (de 0 à 255)