Bonjour je n’arrive pas à ajouter les bandes de bollenger sur l’indicateur MBFX Timing 2, j’ai un message d’erreur ”un paramètre de type entier est attendu avec average”
j’ai essayé de transformer la valeur “LD24” en entier mais ma fonction est fausse, auriez vous une solution ?
voici le code avec ma modif sur la fin
// --- settings
//Len = 7
//Filter = 0.0
// --- end of settings
li224=0
if (ld8 = 0.0) then
ld8 = 1.0
ld16 = 0.0
if (Len - 1 >= 5) then
ld0 = Len - 1.0
else
ld0 = 5.0
endif
ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
ld96 = 3.0 / (Len + 2.0)
ld104 = 1.0 - ld96
else
if (ld0 <= ld8) then
ld8 = ld0 + 1.0
else
ld8 = ld8+1.0
endif
ld88 = ld80
ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
ld32 = ld80 - ld88
ld112 = ld104 * ld112 + ld96 * ld32
ld120 = ld96 * ld112 + ld104 * ld120
ld40 = 1.5 * ld112 - ld120 / 2.0
ld128 = ld104 * ld128 + ld96 * ld40
ld208 = ld96 * ld128 + ld104 * ld208
ld48 = 1.5 * ld128 - ld208 / 2.0
ld136 = ld104 * ld136 + ld96 * ld48
ld152 = ld96 * ld136 + ld104 * ld152
ld56 = 1.5 * ld136 - ld152 / 2.0
ld160 = ld104 * ld160 + ld96 * Abs(ld32)
ld168 = ld96 * ld160 + ld104 * ld168
ld64 = 1.5 * ld160 - ld168 / 2.0
ld176 = ld104 * ld176 + ld96 * ld64
ld184 = ld96 * ld176 + ld104 * ld184
ld144 = 1.5 * ld176 - ld184 / 2.0
ld192 = ld104 * ld192 + ld96 * ld144
ld200 = ld96 * ld192 + ld104 * ld200
ld72 = 1.5 * ld192 - ld200 / 2.0
if (ld0 >= ld8 and ld80 <> ld88) then
ld16 = 1.0
endif
if (ld0 = ld8 and ld16 = 0.0) then
ld8 = 0.0
endif
endif
if (ld0 < ld8 and ld72 > 0.0000000001) then
ld24 = 50.0 * (ld56 / ld72 + 1.0)
if (ld24 > 100.0) then
ld24 = 100.0
endif
if (ld24 < 0.0) then
ld24 = 0.0
endif
else
ld24 = 50.0
endif
if (ld24>ld24[1]- Filter) then
dirbar=1
r=0
g=128
b=0
endif
if (ld24<ld24[1]+Filter) then
dirbar=-1
r=255
g=100
b=0
endif
if (ld24=ld24[1]+Filter) then
dirbar=0
endif
//Zone bleu
if dirbar<>dirbar[1] then
r=0
g=0
b=200
BACKGROUNDCOLOR (214, 234, 248)
endif
entier=ROUND(ld24)
data = customclose
MA = average[entier](data)
BolUp = MA+STD[entier]*dev
BolDn = MA-STD[entier]*dev
return ld24 coloured(r,g,b) style(line,2) as "MBFX timing",70 coloured(168,168,168) style(dottedline), 30 coloured(168,168,168) style(dottedline), 50 coloured(168,168,168) style(dottedline), BolUp
et comme ceci
bollup=BollingerUp[20](ld24)
bolldn=BollingerDown[20](ld24)
ZigoParticipant
Master
ZZplus=round(average[20](close)+2*STD[20](close))//BollingerUp
ZZmin=round(average[20](close)-2*STD[20](close))//BollingerDn