Les valeurs sont retourné sans erreur donc c’est ok, sauf pour le lundi 8 janvier x)
En revanche, pour la projection en avant des DrawSegment, j’utilise ce code :
//
//=/===============/=//=/===============/=//=/ Paramettre de Base
//
defparam drawonlastbaronly = true
Middle = 0
Text = 1
TextMiddle = 0
//
//=/===============/=//=/===============/=//=/ Pivot
//
timeframe(1hour)
//=/ H & L & C
LL = low[1]
HH = high[1]
CC = close[1]
//=/ S & R & P
PP = (LL+HH+CC)/3
//=//
Rx1 = 2 * PP-LL
Hx1 = (Rx1 + PP) /2
Rx2 = PP + (HH-LL)
Hx2 = (Rx2 + Rx1) /2
Rx3 = Rx2 + (Rx1-PP)
Hx3 = (Rx3 + Rx2) /2
Rx4 = Rx3 + (Rx2-PP)
Hx4 = (Rx4 + Rx3) /2
//=//
Sx1 = 2 * PP-HH
Lx1 = (Sx1 + PP) /2
Sx2 = PP - (HH-LL)
Lx2 = (Sx2 + Sx1) /2
Sx3 = Sx2 - (PP-Sx1)
Lx3 = (Sx3 + Sx2) /2
Sx4 = Sx3 - (PP-Sx2)
Lx4 = (Sx4 + Sx3) /2
//=/ Signal
if barindex > barindex[1] then
SL = 1
endif
//=//
if SL[1] = 1 then
SL = 0
endif
timeframe(default)
//=/ Lecture du signal
if (SL = 1 and SL[1] = 0) or (SL = 0 and SL[1] = 1) then
TH = 1
else
TH = 0
endif
//=/ Décompte des barindex
DC = 1
if TH = 0 then
DC = DC[1]+1
endif
//
//=/===============/=//=/===============/=//=/ Couleur Pivot
//
//=/ choix des couleur : https://htmlcolorcodes.com/fr/
//=/ Couleur Résistance
RxR = 255 // Ref 1
GxR = 0 // Ref 2
BxR = 0 // Ref 3
TxR = 255 // opacité de 0 a 255
//=/ Couleur Support
RxS = 0 //.....
GxS = 128
BxS = 0
TxS = 255
//=/ Couleur Pivot
RxP = 0
GxP = 0
BxP = 0
TxP = 255
//
//=/===============/=//=/===============/=//=/ Visuel Pivot
//
ZZ = (Hx1-PP)/8
if DC => 1 then
//=/ Point Pivot
drawsegment(barindex[DC-1],PP,barindex+((DC[DC])-DC+1),PP) coloured(RxP,GxP,BxP,TxP) style(line,2)//choix style : Line_DottedLine_Point (2 = taille)
//=/ Résistance
drawsegment(barindex[DC-1],Rx1,barindex+((DC[DC])-DC+1),Rx1) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)//.....
drawsegment(barindex[DC-1],Rx2,barindex+((DC[DC])-DC+1),Rx2) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
drawsegment(barindex[DC-1],Rx3,barindex+((DC[DC])-DC+1),Rx3) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
drawsegment(barindex[DC-1],Rx4,barindex+((DC[DC])-DC+1),Rx4) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
//=/ Support
drawsegment(barindex[DC-1],Sx1,barindex+((DC[DC])-DC+1),Sx1) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
drawsegment(barindex[DC-1],Sx2,barindex+((DC[DC])-DC+1),Sx2) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
drawsegment(barindex[DC-1],Sx3,barindex+((DC[DC])-DC+1),Sx3) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
drawsegment(barindex[DC-1],Sx4,barindex+((DC[DC])-DC+1),Sx4) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
if Middle then
//=/ Résistance Middle
drawsegment(barindex[DC-1],Hx1,barindex+((DC[DC])-DC+1),Hx1) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)//.....
drawsegment(barindex[DC-1],Hx2,barindex+((DC[DC])-DC+1),Hx2) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
drawsegment(barindex[DC-1],Hx3,barindex+((DC[DC])-DC+1),Hx3) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
drawsegment(barindex[DC-1],Hx4,barindex+((DC[DC])-DC+1),Hx4) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
//=/ Support Middle
drawsegment(barindex[DC-1],Lx1,barindex+((DC[DC])-DC+1),Lx1) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
drawsegment(barindex[DC-1],Lx2,barindex+((DC[DC])-DC+1),Lx2) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
drawsegment(barindex[DC-1],Lx3,barindex+((DC[DC])-DC+1),Lx3) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
drawsegment(barindex[DC-1],Lx4,barindex+((DC[DC])-DC+1),Lx4) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
endif
if Text then
//=/ Point Pivot
drawtext("Piv 1h",barindex+((DC[DC])-DC+1),PP+ZZ,Dialog,Bold,11) coloured(RxP,GxP,BxP,TxP)
//=/ Résistance
drawtext("R1 1h",barindex+((DC[DC])-DC+1),Rx1+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("R2 1h",barindex+((DC[DC])-DC+1),Rx2+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("R3 1h",barindex+((DC[DC])-DC+1),Rx3+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("R4 1h",barindex+((DC[DC])-DC+1),Rx4+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
//=/ Support
drawtext("S1 1h",barindex+((DC[DC])-DC+1),Sx1+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("S2 1h",barindex+((DC[DC])-DC+1),Sx2+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("S3 1h",barindex+((DC[DC])-DC+1),Sx3+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("S4 1h",barindex+((DC[DC])-DC+1),Sx4+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
endif
if TextMiddle then
//=/ Résistance Middle
drawtext("mR1 1h",barindex+((DC[DC])-DC+1),Hx1+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("mR2 1h",barindex+((DC[DC])-DC+1),Hx2+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("mR3 1h",barindex+((DC[DC])-DC+1),Hx3+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
drawtext("mR4 1h",barindex+((DC[DC])-DC+1),Hx4+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
//=/ Support Middle
drawtext("mS1 1h",barindex+((DC[DC])-DC+1),Lx1+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("mS2 1h",barindex+((DC[DC])-DC+1),Lx2+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("mS3 1h",barindex+((DC[DC])-DC+1),Lx3+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
drawtext("mS4 1h",barindex+((DC[DC])-DC+1),Lx4+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
endif
endif
//
//=/===============/=//=/===============/=//=/ Fin
//
return