REM variables
REM Diff= Prix contrat future - Prix c.fd
REM faire attention de bien prendre le contrat future le plus liquide (= échance la plus proche) et en lot plein
REM variables Journalier
REM HighJ = point le plus haut Journalier
REM lowJ = point le plus bas Journalier
REM SettlementJ = Settlement Journalier
REM variables Hebdomadaire
REM HighH = point le plus haut Hebdomadaire
REM lowH= point le plus bas Hebdomadaire
REM SettlementH = Settlement Hebdomadaire
REM variables Mensuel
REM HighM = point le plus haut Mensuel
REM lowM = point le plus bas Mensuel
REM SettlementM = Settlement Mensuel
defparam drawonlastbaronly = true
// DOW
if close>20000 and close<30000 then
diff=18.4
HighJ=25845
LowJ=25461
SettlementJ=25736
HighH=26562
LowH=24893
SettlementH=25316
HighM=26820
LowM=25764
SettlementM=26476
endif
//F.TSE
if close>6000 and close<8000 then
diff=27.1
HighJ=7068
LowJ=6991
SettlementJ=7017
HighH=7290.5
LowH=6892
SettlementH=6970
HighM=7529
LowM=7192
SettlementM=7486.5
endif
//DAX
if close>9000 and close<15000 then
diff=11.7
HighJ=11838
LowJ=11656.5
SettlementJ=11711
HighH=12112
LowH=11383
SettlementH=11503.5
HighM=12447
LowM=11859
SettlementM=12241.5
endif
//CAC
if close>4000 and close<6000 then
diff=0.5
HighJ=5201
LowJ=5112.5
SettlementJ=5141
HighH=5355.5
LowH=5056
SettlementH=5094.5
HighM=5543.5
LowM=5223.5
SettlementM=5489.5
endif
REM Formule Journalier
PPJJ = (HighJ + LowJ + SettlementJ) / 3
R3JJ = HighJ + 2 * (PPJJ - LowJ)
R2JJ = PPJJ + (HighJ - LowJ)
R1JJ = (2 * PPJJ) - LowJ
S1JJ = (2 * PPJJ) - HighJ
S2JJ = PPJJ - (HighJ - LowJ)
S3JJ = LowJ - 2 * (HighJ - PPJJ)
REM Niveaux Journalier avec alignement du prix sur le c.fd
HighJ=HighJ + Diff
LowJ=LowJ + Diff
PPJ = PPJJ + Diff
R3J = R3JJ + Diff
R2J = R2JJ + Diff
R1J = R1JJ + Diff
S1J = S1JJ + Diff
S2J = S2JJ + Diff
S3J = S3JJ + Diff
MR3JJ = (R2JJ + R3JJ) / 2
MR2JJ = (R1JJ + R2JJ) / 2
MR1JJ = (PPJJ + R1JJ) / 2
MS1JJ = (PPJJ + S1JJ) / 2
MS2JJ = (S1JJ + S2JJ) / 2
MS3JJ = (S2JJ + S3JJ) / 2
MR3J = MR3JJ + Diff
MR2J = MR2JJ + Diff
MR1J = MR1JJ + Diff
MS1J = MS1JJ + Diff
MS2J = MS2JJ + Diff
MS3J = MS3JJ + Diff
REM Formule Weekly
PPHH = (HighH + LowH + SettlementH) / 3
R3HH = HighH + 2 * (PPHH - LowH)
R2HH = PPHH + (HighH - LowH)
R1HH = (2 * PPHH) - LowH
S1HH = (2 * PPHH) - HighH
S2HH = PPHH - (HighH - LowH)
S3HH = LowH - 2 * (HighH - PPHH)
REM Niveaux Weekly avec alignement du prix sur le c.fd
HighH=HighH + Diff
LowH=LowH + Diff
PPH = PPHH + Diff
R3H = R3HH + Diff
R2H = R2HH + Diff
R1H = R1HH + Diff
S1H = S1HH + Diff
S2H = S2HH + Diff
S3H = S3HH + Diff
MR3HH = (R2HH + R3HH) / 2
MR2HH = (R1HH + R2HH) / 2
MR1HH = (PPHH + R1HH) / 2
MS1HH = (PPHH + S1HH) / 2
MS2HH = (S1HH + S2HH) / 2
MS3HH = (S2HH + S3HH) / 2
MR3H = MR3HH + Diff
MR2H = MR2HH + Diff
MR1H = MR1HH + Diff
MS1H = MS1HH + Diff
MS2H = MS2HH + Diff
MS3H = MS3HH + Diff
REM Formule Monthly
PPMM = (HighM + LowM + SettlementM) / 3
R3MM = HighM + 2 * (PPMM - LowM)
R2MM = PPMM + (HighM - LowM)
R1MM = (2 * PPMM) - LowM
S1MM = (2 * PPMM) - HighM
S2MM = PPMM - (HighM - LowM)
S3MM = LowM - 2 * (HighM - PPMM)
REM Niveaux Monthly avec alignement du prix sur le c.fd
HighM=HighM + Diff
LowM=LowM + Diff
PPM = PPMM + Diff
R3M = R3MM + Diff
R2M = R2MM + Diff
R1M = R1MM + Diff
S1M = S1MM + Diff
S2M = S2MM + Diff
S3M = S3MM + Diff
MR3MM = (R2MM + R3MM) / 2
MR2MM = (R1MM + R2MM) / 2
MR1MM = (PPMM + R1MM) / 2
MS1MM = (PPMM + S1MM) / 2
MS2MM = (S1MM + S2MM) / 2
MS3MM = (S2MM + S3MM) / 2
MR3M = MR3MM + Diff
MR2M = MR2MM + Diff
MR1M = MR1MM + Diff
MS1M = MS1MM + Diff
MS2M = MS2MM + Diff
MS3M = MS3MM + Diff
REM décalage vertical texte/lignes horizontales
//Voffset,SansSerif,Bold,Bold = pipsize
Voffset=2*pipsize
barindex2=barindex
barindex3=barindex
//HIGH AND CLOSE
DRAWTEXT("Haut J",barindex3,HighJ+Voffset,SansSerif,Bold)coloured(255, 0, 255)
DRAWTEXT("Bas J",barindex3,LowJ+Voffset,SansSerif,Bold)coloured(0, 0, 255)
DRAWTEXT("Haut H",barindex3,HighH+Voffset,SansSerif,Bold)coloured(255, 0, 255)
DRAWTEXT("Bas H",barindex3,LowH+Voffset,SansSerif,Bold)coloured(0, 0, 255)
DRAWTEXT("Haut M",barindex3,HighM+Voffset,SansSerif,Bold)coloured(255, 0, 255)
DRAWTEXT("Bas M",barindex3,LowM+Voffset,SansSerif,Bold)coloured(0, 0, 255)
REM TEXTE
//DRAWTEXT("PMF",barindex2,PPJ,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("PJ",barindex2,PPJ+Voffset,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("R3J",barindex2,R3J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R2J",barindex2,R2J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R1J",barindex2,R1J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("S1J",barindex2,S1J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S2J",barindex2,S2J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S3J",barindex2,S3J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mR3J",barindex2,MR3J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR2J",barindex2,MR2J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR1J",barindex2,MR1J+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mS1J",barindex2,MS1J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS2J",barindex2,MS2J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS3J",barindex2,MS3J+Voffset,SansSerif,Bold)coloured(0, 128, 0)
//DRAWTEXT("PM",barindex2,PPJ,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("PH",barindex2,PPH+Voffset,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("R3H",barindex2,R3H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R2H",barindex2,R2H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R1H",barindex2,R1H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("S1H",barindex2,S1H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S2H",barindex2,S2H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S3H",barindex2,S3H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mR3H",barindex2,MR3H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR2H",barindex2,MR2H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR1H",barindex2,MR1H+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mS1H",barindex2,MS1H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS2H",barindex2,MS2H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS3H",barindex2,MS3H+Voffset,SansSerif,Bold)coloured(0, 128, 0)
//DRAWTEXT("PM",barindex2,PPJ,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("PM",barindex2,PPM+Voffset,SansSerif,Bold)coloured(0, 0, 0)
DRAWTEXT("R3M",barindex2,R3M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R2M",barindex2,R2M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("R1M",barindex2,R1M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("S1M",barindex2,S1M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S2M",barindex2,S2M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("S3M",barindex2,S3M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mR3M",barindex2,MR3M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR2M",barindex2,MR2M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mR1M",barindex2,MR1M+Voffset,SansSerif,Bold)coloured(255, 0, 0)
DRAWTEXT("mS1M",barindex2,MS1M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS2M",barindex2,MS2M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
DRAWTEXT("mS3M",barindex2,MS3M+Voffset,SansSerif,Bold)coloured(0, 128, 0)
//FIGURES
//Affichage des ligne 00/25/50/100 à +/- 200 autour du DHigh de la veille
//1.2 Mardi 22 Avril 2014
//Définir deux varaiables
//zero, booleen
//vingtcinq, booleen
milieu = SettlementJ
centaine = round(milieu/100) * 100
//
lp1 = centaine + 25
lp2 = centaine + 50
lp3 = centaine + 75
lp4 = centaine + 100
lp5 = centaine + 125
lp6 = centaine + 150
lp7 = centaine + 175
lp8 = centaine + 200
//lp9 = centaine + 225
//lp10 = centaine + 250
//lp11 = centaine + 275
//lp12 = centaine + 300
//
lm1 = centaine - 25
lm2 = centaine - 50
lm3 = centaine - 75
lm4 = centaine - 100
lm5 = centaine - 125
lm6 = centaine - 150
lm7 = centaine - 175
lm8 = centaine - 200
//lm9 = centaine - 225
//lm10 = centaine - 250
//lm11 = centaine - 275
//lm12 = centaine - 300
Return centaine COLOURED(255, 127, 80) STYLE(LINE),lp1 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lp2 COLOURED(255, 127, 80) STYLE(LINE),lp3 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lp4 COLOURED(255, 127, 80) STYLE(LINE),lp5 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lp6 COLOURED(255, 127, 80) STYLE(LINE),lp7 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lp8 COLOURED(255, 127, 80) STYLE(LINE),lm1 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lm2 COLOURED(255, 127, 80) STYLE(LINE),lm3 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lm4 COLOURED(255, 127, 80) STYLE(LINE),lm5 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lm6 COLOURED(255, 127, 80) STYLE(LINE),lm7 COLOURED(255, 127, 80) STYLE(DOTTEDLINE),lm8 COLOURED(255, 127, 80) STYLE(LINE), HighJ COLOURED(255, 0, 255) STYLE(DOTTEDLINE), LowJ COLOURED(0, 0, 255) STYLE(DOTTEDLINE),HighH COLOURED(255, 0, 255) STYLE(DOTTEDLINE), LowH COLOURED(0, 0, 255) STYLE(DOTTEDLINE),HighM COLOURED(255, 0, 255) STYLE(DOTTEDLINE), LowM COLOURED(0, 0, 255) STYLE(DOTTEDLINE),PPJ COLOURED(0, 0, 0) as "PJF", R3J COLOURED(255, 0, 0) as "R3JF", R2J COLOURED(255, 0, 0) as "R2JF", R1J COLOURED(255, 0, 0) as "R1JF", S1J COLOURED(0, 128, 0) as "S1JF", S2J COLOURED(0, 128, 0) as "S2JF", S3J COLOURED(0, 128, 0) as "S3JF", MR3J COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR3JF", MR2J COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR2JF", MR1J COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR1JF", MS1J COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS1JF", MS2J COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS2JF", MS3J COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS3JF",PPH COLOURED(0, 0, 0) as "PHF", R3H COLOURED(255, 0, 0) as "R3HF", R2H COLOURED(255, 0, 0) as "R2HF", R1H COLOURED(255, 0, 0) as "R1HF", S1H COLOURED(0, 128, 0) as "S1HF", S2H COLOURED(0, 128, 0) as "S2HF", S3H COLOURED(0, 128, 0) as "S3HF", MR3H COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR3HF", MR2H COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR2HF", MR1H COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR1HF", MS1H COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS1HF", MS2H COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS2HF", MS3H COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS3HF",PPM COLOURED(0, 0, 0) as "PMF", R3M COLOURED(255, 0, 0) as "R3MF", R2M COLOURED(255, 0, 0) as "R2MF", R1M COLOURED(255, 0, 0) as "R1MF", S1M COLOURED(0, 128, 0) as "S1MF", S2M COLOURED(0, 128, 0) as "S2MF", S3M COLOURED(0, 128, 0) as "S3MF", MR3M COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR3MF", MR2M COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR2MF", MR1M COLOURED(255, 0, 0) STYLE(DOTTEDLINE) as "MR1MF", MS1M COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS1MF", MS2M COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS2MF", MS3M COLOURED(0, 128, 0) STYLE(DOTTEDLINE) as "MS3MF"