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