Gracias, he agregado la variable p=0 en la linea 20 pero el problema persiste, no puedo identificar cual es el error, le agradecería enormemente su ayuda.
//////////////////////////////////////////////
DefParam DrawOnLastBarOnly = true
Xoffset = (OffsetText) // Distance entre Texte et Bord droit du tableau (4 par défaut)
//BackColor = 0 // Case à cocher pour couleur de fond (inactif par défaut)
// — Init
BackgroundColor(255,255,255,255)
OffsetText = max(1,OffsetText)
OffsetText = min(200,OffsetText)
indicator1 = WeightedAverage[50](close)
indicator2 = WeightedAverage[150](close)
c1 = (indicator1[1] >= indicator2[1])
indicator3 = WeightedAverage[150](close)
indicator4 = WeightedAverage[200](close)
c2 = (indicator3 >= indicator4)
p=0
if c1 and c2 then
p=1
else
p=0
endif
rem **********************************
indicator11 = WeightedAverage[50](close)
indicator21 = WeightedAverage[50](close)
c5 = (indicator11[2] < indicator21[close])
indicator31 = WeightedAverage[50](close)
indicator41 = WeightedAverage[50](close)
c6 = (indicator31[2] >= indicator41[close])
if c5 and c6 then
p=p+1
endif
rem **********************************************
indicator5 = MACD[12,26,9](close)
c3 = (indicator5 > indicator5[2])
indicator6 = MACD[12,26,9](close)
c4 = (indicator6 > indicator6[1])
indicator8 = MACD[12,26,9](close)
c8 = (indicator8 >= indicator8)
if c3 and c4 and c8 then
p= p+1
endif
//*************************************************
a=ROC[60](close)
b=ROC[120](close)
pr = round (a+b)
c7 = (pr >= 0)
if c7 then
p=p+1
endif
if p=3 then
BackgroundColor(0,160,250,40) // light blue
DrawText(“▲▲▲▲”,barindex[4]-(Xoffset),0.5,MonoSpaced,Bold,10) coloured(0,160,250)// light blue
endif
if p=2 then
DrawText(“▲▲▲”,barindex[5]-(Xoffset),1,MonoSpaced,Bold,10) coloured(255,105,180)//PINK
BackgroundColor(255,105,180,80) // red
ENDIF
if p=1 then
DrawText(“▲▲”,barindex[4]-(Xoffset),1,MonoSpaced,Bold,10) coloured(250,160,0)// yellow
BackgroundColor(250,160,0,40) // yellow
endif
if p=0 then
DrawText(“▲”,barindex[4]-(Xoffset),0.5,MonoSpaced,Bold,10) coloured(222,184,135)//wood
BackgroundColor(222,184,135,90)
endif
return p