|
Bonjour,
J’ai écris un programme qui trace le plus haut et le plus bas trouvé dans une plage horaire (ex 17h30 – 22h dans mon cas). Cependant j’ai un soucis quand j’utilise cet indicateur avec des Range Bars car je n’ai parfois pas la bougie correspondante à la minute souhaitée. Si le marché est calme, je peux avoir parfois plusieurs minutes d’écart entre 2 Range Bar. Comment améliorer mon algo pour que cela fonctionne à chaque fois ? J’ai essayé avec currentMinute mais c’est pas mieux. Ci-joint mon programme. Par avance merci.
|
|
|
ONCE JourDebut = Dayofweek
ONCE JourFin = Dayofweek
if (JourDebut >= 6) then
JourDebut = 1
endif
if (JourFin >= 6) then
JourFin = 1
endif
If ((Hour = DebutHeure) and ((Minute >= DebutMinute-2) and (Minute <= DebutMinute+2)) and (JourDebut = Dayofweek)) then
CptBarDebut = barindex
JourDebut = JourDebut + 1
DRAWARROWUP (barindex, open) COLOURED (0, 255, 0)
endif
If ((Hour = FinHeure) and ((Minute >= FinMinute-1) and (Minute <= FinMinute+1)) and (JourFin = Dayofweek)) then
CptBarFin = barindex
JourFin = JourFin + 1
DRAWARROWDOWN (barindex, open) COLOURED (255, 0, 0)
NbPeriodes = CptBarFin – CptBarDebut
pLowSeance = Lowest[NbPeriodes](Low)
pHighSeance = Highest[NbPeriodes](High)
DrawSegment(barindex+4, pLowSeance, barindex + 84, pLowSeance) coloured(0,255,255)
DRAWTEXT(“Blue Bar LOW”, barindex+8, pLowSeance+5) ANCHOR(TOPLEFT, INDEX, VALUE)
DrawSegment(barindex+4, pHighSeance, barindex + 84, pHighSeance) coloured(0,255,255)
DRAWTEXT(“Blue Bar HIGH”, barindex+8, pHighSeance+5) ANCHOR(TOPLEFT, INDEX, VALUE)
pMoitieSeance = (pHighSeance – pLowSeance) / 2
DrawSegment(barindex+4, pMoitieSeance + pLowSeance, barindex + 84, pMoitieSeance + pLowSeance) coloured(0,255,255)
endif
return