bonjour, j’ai fait ce code qui met un background si le prix approche les de 0,5% du niveau de 61,8 de fibo des 80 bougies precedente, sauf que je n’arrive pas a mettre le background UNIQUIEMENT a partir du hh ou ll detecter , j’ai tous essayé ( boucle, condititon du barindex : barindex> barindex[hh or ll))
si vous avez un solution je suis preneur, merci
le code si dessous ne fonctionne pas évidenement, celui de l’image joint fonctionne par contre
defparam DRAWONLASTBARONLY = true
defparam calculateonlastbars=80
hh = highest[80](high)
ll = lowest[80](low)
fib618 = (hh-ll)*0.618
level618 = ll+fib618
if level618 then
DRAWLINE(barindex, level618 , barindex[5], level618 )
drawtext(" 62%",barindex,level618 ,Dialog,Standard,10) coloured(0,0,200)
ENDIF
nb= BarIndex>barindex[hh]
nearpercent = (1-(close/level618))*100
if nearpercent<0.5 and nb then
BACKGROUNDCOLOR (240, 253, 215)
endif
RETURN
Vous pouvez faire un rectangle
defparam DRAWONLASTBARONLY = true
hh = highest[80](high)
ll = lowest[80](low)
fib618 = (hh-ll)*0.618
level618 = ll+fib618
if level618 then
DRAWLINE(barindex, level618 , barindex[5], level618 )
drawtext(" 62%",barindex,level618 ,Dialog,Standard,10) coloured(0,0,200)
ENDIF
bar=barssince(level618 <> level618[1])
nearpercent = (1-(close/level618))*100
if islastbarupdate then
if nearpercent<0.5 then
//BACKGROUNDCOLOR (240, 253, 215)
drawrectangle(barindex,hh,barindex[bar],ll)fillcolor(240, 253, 215,100)
endif
endif
RETURN hh as "Highest"coloured("red"),ll as "Lowest"coloured("green"), level618 coloured("blue")
merci pour votre aide, j’ai reussi a faire ce que je voulais avec la fonction bar
defparam DRAWONLASTBARONLY = true
defparam calculateonlastbars=80
hh = highest[80](high)
ll = lowest[80](low)
fib618 = (hh-ll)*0.618
level618 = ll+fib618
if level618 then
DRAWLINE(barindex, level618 , barindex[5], level618 )
drawtext(" 62%",barindex,level618 ,Dialog,Standard,10) coloured(0,0,200)
ENDIF
bar=barssince(level618 <> level618[1])
nearpercent = (1-(close/level618))*100
if nearpercent<0.2 and bar then
BACKGROUNDCOLOR (240, 253, 215)
//COLORBETWEEN(level618,close,"RED")
endif
RETURN
since