Bonjour,
Je souhaiterais savoir comment détecter le dépassement du plus haut ou du plus bas de la dernier période ( m5, m15, h1, h4, d1 ), et qu’il me l indique par une bougie vert ou rouge.
merci
J’ai modifié un code de Noobywan que j’ai retrouvé dans ce topic: https://www.prorealcode.com/topic/finding-hourly-highslows-using-1-min-data/
// Hourly highs/lows using 1 min data responding to a request on PRC
//
// (but could also work for other timeframes lower than 1h, as long as each hourly candle and each lower timeframe candle end simultaneously, otherwise the code would be more complicated than this one - Noobywan)
if OpenHour<>OpenHour[1] then
barinit=intradaybarindex
endif
Maxthishour=highest[max(1,intradaybarindex-barinit+1)](high)
Minthishour=lowest[max(1,intradaybarindex-barinit+1)](low)
if high > Maxthishour[1] then
drawcandle(open,high,low,close) coloured(0,255,200)
elsif low < Minthishour[1] then
drawcandle(open,high,low,close) coloured(200,0,0)
//else
//drawcandle(open,high,low,close)
endif
return //Maxthishour as "Maxthishour", Minthishour as "Minthishour"
On colorie en bleu ciel le breakout du plus haut de l’heure courante et en rouge pour le plus bas. Cela te convient ?