//DEFPARAM DrawOnLastBarOnly = true
Pivot = 1
IF Openhour <> openhour [ 1 ] THEN
//
MyEnd = (Opendate * 1000000) + (OpenHour * 10000) + (5900) //YYYYMMDDHHMMSS
MyPP = PP
StartBar = BarIndex
//
myLastHigh = myHigh
myLastLow = myLow
myLastClose = Close [ 1 ]
myHigh = High
myLow = Low
myopen = open
ELSE
myHigh = Max(myHigh, High)
myLow = Min(myLow, Low)
ENDIF
// Formule en fonction de la valeur du paramètre Pivot
IF Pivot = 2 THEN
// Point pivot : PP= (Hveille + Bveille + Cveille + Ojour) / 4
PP = (myLastHigh + myLastLow + myLastClose + myopen) / 4
ELSIF Pivot = 3 THEN
// Point pivot : PP= (Hveille + Bveille + Ojour) / 3
PP = (myLastHigh + myLastLow + myopen) / 3
ELSE
// Point pivot : PP= (Hveille + Bveille + Cveille) / 3
PP = (myLastHigh + myLastLow + myLastClose) / 3
ENDIF
Res1 = 2 * PP - myLastLow
Res2 = PP + myLastHigh - myLastLow
Res3 = myLastHigh + 2 * (PP - myLastLow)
Sup1 = 2 * PP - myLastHigh
Sup2 = PP - myLastHigh + myLastLow
Sup3 = myLastLow - 2 * (myLastHigh - PP)
DrawSegment(StartBar,MyPP,DateToBarIndex(MyEnd),MyPP) coloured(0,255,0,255) style(Line, 1)
Return pP