Ayuda con codigo para indicar tenendecia y acelaracion alcista en el grafico
Forums › ProRealTime foro Español › Soporte ProBuilder › Ayuda con codigo para indicar tenendecia y acelaracion alcista en el grafico
- This topic has 4 replies, 2 voices, and was last updated 1 year ago by
Lirios.
-
-
11/07/2021 at 9:24 PM #181195
Buenas Tardes, he programado este indicador pero me muestra un error que no se como solucionarlo, la idea es que el indicador me muestre un texto en el grafico con 3 estrellas cuando se dan las condiciones de tendencia alcista y de aceleracion (histograma del MACD creciendo), agredecere ayuda con identificacion del error, gracias de antemano.
1234567891011121314151617181920212223242526272829303132333435363738394041DefParam DrawOnLastBarOnly = trueXoffset = (OffsetText) ////BackColor = 0 //// --- InitBackgroundColor(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)if c1 and c2 then // tendenciap1=1endifindicator5 = 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 // aceleracionp2= 1endifif p=2 thenDrawText("★★★",barindex[5]-(Xoffset),1,MonoSpaced,Bold,10) coloured(255,105,180)//PINKDrawText("FTA",barindex[5]-(Xoffset),0.7,MonoSpaced,Bold,10)coloured(255,105,180)BackgroundColor(255,105,180,80) // redENDIFreturn p11/08/2021 at 1:04 AM #181199En las líneas 35 y 41 está la variable p que no ha sido definida, tienes que definirla en alguna parte.
11/17/2021 at 10:34 PM #181758Gracias, 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)
// — InitBackgroundColor(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+1endif
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
endifif p=3 then
BackgroundColor(0,160,250,40) // light blue
DrawText(“▲▲▲▲”,barindex[4]-(Xoffset),0.5,MonoSpaced,Bold,10) coloured(0,160,250)// light blueendif
if p=2 then
DrawText(“▲▲▲”,barindex[5]-(Xoffset),1,MonoSpaced,Bold,10) coloured(255,105,180)//PINK
BackgroundColor(255,105,180,80) // red
ENDIFif p=1 then
DrawText(“▲▲”,barindex[4]-(Xoffset),1,MonoSpaced,Bold,10) coloured(250,160,0)// yellow
BackgroundColor(250,160,0,40) // yellow
endifif p=0 then
DrawText(“▲”,barindex[4]-(Xoffset),0.5,MonoSpaced,Bold,10) coloured(222,184,135)//wood
BackgroundColor(222,184,135,90)
endifreturn p
11/18/2021 at 6:03 PM #181810En la línea 2 usa OffsetText , pero no retiene ningún valor.
En las líneas 28 y 32, ¿por qué escribió CLOSE entre corchetes ? Debe escribir el ID de la vela (0, 1, 2, etc.) entre corchetes .
11/18/2021 at 9:06 PM #181824 -
AuthorPosts
Find exclusive trading pro-tools on