Bonjour, merci beaucoup pour votre aide.
J’ai essayé de rentrer le code de telle manière : mais cela ne fonctionne pas, c’est comme si je n’avais rien fait les flèches dans le mauvais sens restent apparentes.
//—–Simple Moving Average 50 periods———-//
ma50=average[50](close)
ma50UP=roc[3](ma50)>0 //trendUP
ma50DN=roc[3](ma50)<=0 //trendDN
//—Drawing conditions
conditionUPma50 = not ma50DN
conditionDNma50 = not ma50UP
//———————————————–//
//—–Simple Moving Average 20 periods———-//
ma20=average[20](close)
//—Drawing conditions
conditionUPma20 = open <= ma20
conditionDNma20 = open >= ma20
//———————————————–//
// — settings
RISK=2
CountBars=500
// — end of settings
value10=3+RISK*2
x1=30+RISK
x2=30-RISK
value11=value10
shift=CountBars-11-1
if islastbarupdate and barindex>CountBars then
while(shift>=0) do
Counter=shift
iRange=0.0
AvgRange=0.0
for Counter=shift to shift+9 do
AvgRange=AvgRange+Abs(High[Counter]-Low[Counter])
next
iRange=AvgRange/10
Counter=shift
TrueCount=0
while (Counter<shift+9 and TrueCount<1) do
if (Abs(Open[Counter]-Close[Counter+1])>=iRange*2.0) then
TrueCount=TrueCount+1
endif
Counter=Counter+1
wend
if (TrueCount>=1) then
MRO1=Counter
else
MRO1=-1
endif
Counter=shift
TrueCount=0
while (Counter<shift+6 and TrueCount<1) do
if (Abs(Close[Counter+3]-Close[Counter])>=iRange*4.6) then
TrueCount=TrueCount+1
endif
Counter=Counter+1
wend
if (TrueCount>=1) then
MRO2=Counter
else
MRO2=-1
endif
if (MRO1>-1) then
value11=3
else
value11=value10
endif
if (MRO2>-1) then
value11=4
else
value11=value10
endif
value2=100-Abs(Williams[value11](close)[shift]) // PercentR(value11=9)
$Tablevalue2[shift]=value2
$val1[shift]=0
$val2[shift]=0
value3=0
if (value2<x2) then
i1=1
while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
i1=i1+1
wend
if ($Tablevalue2[shift+i1]>x1) then
value3=High[shift]+iRange*0.5
if (shift = 1 and flagval1=0) then
flagval1=1
flagval2=0
endif
$val1[shift]=value3
drawarrowdown(barindex[shift],$val1[shift]) coloured(255,0,255)
endif
endif
if (value2>x1) then
i1=1
while ($Tablevalue2[shift+i1]>=x2 and $Tablevalue2[shift+i1]<=x1) do
i1=i1+1
wend
if ($Tablevalue2[shift+i1]<x2) then
value3=Low[shift]-iRange*0.5
if (shift = 1 and flagval2=0) then
flagval2=1
flagval1=0
endif
$val2[shift]=value3
drawarrowup(barindex[shift],$val2[shift]) coloured(0,255,255)
endif
endif
shift=shift-1
wend
endif
return