Aplicación con Fibonacci
Forums › ProRealTime foro Español › Soporte ProScreener › Aplicación con Fibonacci
- This topic has 5 replies, 2 voices, and was last updated 4 months ago by robertogozzi.
-
-
05/10/2024 at 12:16 PM #232524
Buenos Días:
Sería posible convertir este indicador en screener.
Quisiera hacer unas pruebas a nivel Fibonacci con los resultados que arojase el screener
//—Initialisation Zeiierman
once idx0 = 0
once idx1 = 0
once idx2 = 0
once pos = 0ATR = AverageTrueRange[prd](typicalprice)
IF barindex >= 2*prd+1 then
If high[prd] >= highest[2*prd+1](high) and pos<=0 then
If idx1 <> 0 then
idx2 = idx1
EndifIf idx0 <> 0 then
idx1 = idx0
Endifidx0 = barindex[prd]
pos=1If idx2<>0 then
If showPvts then
If High[barindex-idx0]>=High[barindex-idx2] then
DRAWTEXT(“HH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
else
DRAWTEXT(“LH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
Endif
EndifEndif
EndifIf Low[prd] <= Lowest[2*prd+1](low) and pos>=0 then
If idx1 <> 0 then
idx2 = idx1
EndifIf idx0 <> 0 then
idx1 = idx0
Endifidx0 = barindex[prd]
pos=-1If idx2<>0 then
If showPvts then
If Low[barindex-idx0]>=Low[barindex-idx2] then
DRAWTEXT(“HL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
else
DRAWTEXT(“LL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
Endif
EndifEndif
EndifIf idx2<>0 then
If pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) thenIf showPattern then
DRAWTEXT(“1”,idx2,High[idx2]+ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“2”,idx1,Low[barindex-idx1]-ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“3”,idx0,High[barindex-idx0]+ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWSEGMENT(idx2,High[barindex-idx2],idx1,Low[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
DRAWSEGMENT(idx1,Low[barindex-idx1],idx0,High[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
EndifIf showBreak then
DRAWSEGMENT(idx1,Low[barindex-idx1],barindex+1,Low[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
DRAWARROWDOWN(barindex,High+ATR/2) coloured(“RED”,255)
EndifEndif
If pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) then
If showPattern then
DRAWTEXT(“1”,idx2,Low[barindex-idx2]-ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“2”,idx1,High[barindex-idx1]+ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“3”,idx0,Low[barindex-idx0]-ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWSEGMENT(idx2,Low[barindex-idx2],idx1,High[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
DRAWSEGMENT(idx1,High[barindex-idx1],idx0,Low[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
EndifIf showBreak then
DRAWSEGMENT(idx1,High[barindex-idx1],barindex+1,High[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
DRAWARROWUP(barindex,Low-ATR/2) coloured(“GREEN”,255)
EndifEndif
Endif
EndifReturn
Gracias,
05/10/2024 at 3:29 PM #232535Esto devolverá instrumentos con una flecha trazada en el gráfico (roja o verde):
1234567891011121314151617181920212223242526272829303132333435363738394041//—Initialisation Zeiiermanonce prd = 50once idx0 = 0once idx1 = 0once idx2 = 0once pos = 0Cond = 0IF barindex >= 2*prd+1 thenIf high[prd] >= highest[2*prd+1](high) and pos<=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=1EndifIf Low[prd] <= Lowest[2*prd+1](low) and pos>=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=-1EndifIf idx2<>0 thenIf pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) thenCond = 2EndifIf pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) thenCond = 1EndifEndifEndifIF (high = low) THENCond = 0ENDIFScreener[Cond](Cond AS "1=Up,2=Down")05/11/2024 at 5:38 PM #232554Gracias Roberto, me contesta algo a lo que quería pero no me siento satisfecho con los resultados obtenidos.
Sería posible hacer algo con el gráfico que te adjunto con sus explicaciones .
Un saludo,
05/12/2024 at 9:37 AM #232568Adjunte imágenes únicamente en su formato natural (JPG, PNG, etc…).
Gracias 🙂Lo comprobaré lo antes posible.
05/12/2024 at 6:26 PM #232588En lo sucesivo aportaré las imágenes como me indica (tendré que ver como se hace, anteriormente).
Estuve viendo si cogía algunas ideas al respecto y por cierto veo algún gráfico que creo se adapta a lo que pretendo conseguir en: http://www.tradingview.com/script/JU3WaXGC-Order-Blocks-W-Realtime-Fibs-QuantVue/
Gracias,
08/17/2024 at 10:17 AM #236448¡Pido disculpas por la demora!
Este es un indicador específico para los retrocesos de Fibonacci:
12345678910111213141516171819202122232425262728293031323334353637383940414243// Fibonacci Lebels//DEFPARAM CalculateOnLastBars = 3000DEFPARAM DrawOnLastBarOnly = True//ONCE p = 100HH = highest[p](high)LL = lowest[p](low)Diff = HH - LLFib0236 = Diff * 0.236Fib0382 = Diff * 0.382Fib0500 = Diff * 0.500Fib0618 = Diff * 0.618Fib0764 = Diff * 0.764Up = 0Dn = 0FOR i = 0 TO (p - 1)IF high[i] = HH THENUp = 1BREAKENDIFIF low[i] = LL THENDn = 1BREAKENDIFNEXTDRAWHLINE(HH) style(Line,2) coloured("Blue")DRAWHLINE(LL) style(Line,2) coloured("Red")LastBar = BarIndexIF Up THENDRAWTEXT("---------------------------(23.6%)",LastBar,HH - Fib0236,SansSerif,Bold,12) coloured("Grey")DRAWTEXT("---------------------------(38.2%)",LastBar,HH - Fib0382,SansSerif,Bold,12) coloured("Tan")DRAWTEXT("---------------------------(50.0%)",LastBar,HH - Fib0500,SansSerif,Bold,12) coloured("Green")DRAWTEXT("---------------------------(61.8%)",LastBar,HH - Fib0618,SansSerif,Bold,12) coloured("Fuchsia")DRAWTEXT("---------------------------(76.4%)",LastBar,HH - Fib0764,SansSerif,Bold,12) coloured("DodgerBlue")ELSIF Dn THENDRAWTEXT("---------------------------(23.6%)",LastBar,LL + Fib0236,SansSerif,Bold,12) coloured("Grey")DRAWTEXT("---------------------------(38.2%)",LastBar,LL + Fib0382,SansSerif,Bold,12) coloured("Tan")DRAWTEXT("---------------------------(50.0%)",LastBar,LL + Fib0500,SansSerif,Bold,12) coloured("Green")DRAWTEXT("---------------------------(61.8%)",LastBar,LL + Fib0618,SansSerif,Bold,12) coloured("Fuchsia")DRAWTEXT("---------------------------(76.4%)",LastBar,LL + Fib0764,SansSerif,Bold,12) coloured("DodgerBlue")ENDIFRETURNy este es el screener (filtro) que devuelve las acciones que tienen un precio que cruza el nivel del 50%:
1234567891011121314151617181920212223242526272829303132// Fibonacci Levels//ONCE p = 100HH = highest[p](high)LL = lowest[p](low)Diff = HH - LL//Fib0236 = Diff * 0.236//Fib0382 = Diff * 0.382Fib0500 = Diff * 0.500//Fib0618 = Diff * 0.618//Fib0764 = Diff * 0.764Up = 0Dn = 0FOR i = 0 TO (p - 1)IF high[i] = HH THENUp = 1BREAKENDIFIF low[i] = LL THENDn = 1BREAKENDIFNEXTc1 = 0IF Up THENLevel50 = HH - Fib0500c1 = (high >= Level50) AND (low <= Level50)ELSIF Dn THENLevel50 = LL + Fib0500c1 = (high >= Level50) AND (low <= Level50)ENDIFSCREENER[c1 AND (low <> high)] -
AuthorPosts