Ho capito, questo mi sembra che vada bene:
// HEIKIN ASHI TRANSPARENTS ROBERTO 15.01.2022
// cul plat Nicolas 07.01.2022
//defparam CALCULATEONLASTBARS = 50
// Variable :
// t = 0 (de 0 à 255)
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
greensum = summation[5](xClose > xOpen) = 5
redsum = summation[5](xClose < xOpen) = 5
////////////////////////////////////////////////////
if green and not green[1] then
lastpointx = 1
IF lastpointx <> lastpointx[1] THEN
drawpoint(barindex,xlow,5) coloured (9,82,40,255) //(0,200,0)// green
ENDIF
elsif red and not red[1] then
lastpointx = 2
IF lastpointx <> lastpointx[1] THEN
drawpoint(barindex,xhigh,5) coloured(200,0,0,255)// red
ENDIF
endif
/////////////////////////////////////////////////OK
if green > green [1] then
lastpointy = 1
IF lastpointy <> lastpointy[1] THEN
drawpoint(barindex,xlow,3) coloured (254,254,0,255) // jaune clair //(9,82,40) // green
ENDIF
elsif red < red [1] then
lastpointy = 2
IF lastpointy <> lastpointy[1] THEN
drawpoint(barindex,xhigh,3) coloured (0,254,255,255) // jaune clair //(200,0,0)// red
ENDIF
endif
//IF close > open THEN
if greensum then //green > green [1] then
DrawCandle(xOpen,xHigh,xLow,xClose) coloured(0,255,0,0) bordercolor(227,0,0) // vert clair bordure vert foncé
//ELSE
elsif redsum then //red > red [1] then
DrawCandle(xOpen,xHigh,xLow,xClose) coloured(255,0,255,0) bordercolor(255,0,0) // rose magenta bordure rouge
ENDIF
RETURN// t as " HA transparent "