INDICADOR TANGENT CROSSING
Forums › ProRealTime foro Español › Soporte ProBuilder › INDICADOR TANGENT CROSSING
- This topic has 2 replies, 2 voices, and was last updated 6 months ago by NEOMKEY.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
05/23/2024 at 4:25 PM #232964
Hola a todos, os remito el presente indicador de la plataforma TRADINGVIEW para ver si sois capaces de transcribirlo a PRT. Gracias
https://es.tradingview.com/v/F2vJnCdI/
05/29/2024 at 5:24 PM #233254Buenas!
Aquí tienes una aproximación del código.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200//-------------------------------------------------------------------------------////PRC_Ghost Tangent Crossings//version = 0//2024.05.29//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-------------------------------------------------------------------------------////-----Inputs--------------------------------------------------------------------////-----PivotslbR=25//lookback RightlbL=lbR//lookback Leftmaxzig=10pivotType=1//1=high/low 0=open/closeif pivotType thensrc1=lowsrc2=highelsesrc1=min(open,close)src2=max(open,close)endif//-------------------------------------------------------------------------------////-----Pivots High-Low ----------------------------------------------------------////-----pivots lowif src1 > src1[lbR] and lowest[lbR](src1) > src1[lbR] and src1[lbR] < lowest[lbL](src1)[lbR+1] then$pl[z+1]=src1[lbR]$plx[z+1]=barindex[lbR]z=z+1drawpoint($plx[z],$pl[z],2)endif//-----pivots highif src2 < src2[lbR] and highest[lbR](src2)<src2[lbR] and src2[lbR]>highest[lbL](src2)[lbR+1] then$ph[t+1]=src2[lbR]$phx[t+1]=barindex[lbR]t=t+1drawpoint($phx[t],$ph[t],2)endif//-------------------------------------------------------------------------------////-------------------------------------------------------------------------------//polarityUp=$phx[t]>$plx[z]polarityDw=$phx[t]<$plx[z]//-----Ellipse-------------------------------------------------------------------//if z<>z[1] and polarityDw and $plx[max(0,z-1)]<$phx[t] thenstartx = $plx[z]endx = $phx[t]starty = $pl[z]endy = $ph[t]a = (endx - startx)b = (endy - starty)prevx = -1newx = 0y = 0for i = 90 to 180 donewx = a * cos(i)y = b * sin(i)if prevx <> newx thendrawpoint(endx + newx, starty + y)coloured("red")endifprevx = newxnextmidangle=135midx=a*cos(midangle)midy=b*sin(midangle)tangentx=endx+midxtangenty=starty+midyslope=-(b*b*midx)/(a*a*midy)intercept = tangenty - slope * tangentxlength = 20x1 = tangentx - lengthy1 = tangenty - length * slopex2 = barindexy2 = slope*x2+interceptendifif t<>t[1] and polarityUp and $phx[max(0,t-1)]<$plx[z] thenstartx = $plx[z]endx = $phx[t]starty = $pl[z]endy = $ph[t]a = (endx - startx)b = (endy - starty)prevx = -1newx = 0y = 0for i = 270 to 360 donewx = a * cos(i)y = b * sin(i)if prevx <> newx thendrawpoint(startx + newx, endy + y)coloured("green")endifprevx = newxnextmidangle=315midx=a*cos(midangle)midy=b*sin(midangle)tangentx=startx+midxtangenty=endy+midyslope=-(b*b*midx)/(a*a*midy)intercept = tangenty - slope * tangentxlength = 20 // Ajusta la longitud de la tangente según sea necesariox1 = tangentx - lengthy1 = tangenty - length * slopex2 = barindexy2 = slope*x2+interceptendif//-------------------------------------------------------------------------------//if islastbarupdate thenif $plx[z]>$phx[t] thenstartx = $plx[z]endx = barindex-barssince(highest[barindex-startx](high)=high)starty = $pl[z]endy = highest[barindex-startx](high)a = (endx - startx)b = (endy - starty)prevx = -1newx = 0y = 0for i = 270 to 360 donewx = a * cos(i)y = b * sin(i)if prevx <> newx thendrawpoint(startx + newx, endy + y)coloured("green")endifprevx = newxnextmidangle=315midx=a*cos(midangle)midy=b*sin(midangle)tangentx=startx+midxtangenty=endy+midyslope=-(b*b*midx)/(a*a*midy)intercept = tangenty - slope * tangentxlength = 20 // Ajusta la longitud de la tangente según sea necesariox1 = tangentx - lengthy1 = tangenty - length * slopex2 = barindex+lengthy2 = slope*x2+interceptdrawpoint(tangentx, tangenty) coloured("blue")drawsegment(x1, y1, x2, y2) coloured("blue")elsestartx = $phx[t]endy = lowest[barindex-startx](low)endx = barindex-barssince(lowest[barindex-startx](low)=low)starty = $ph[t]a = (endx - startx)b = (endy - starty)prevx = -1newx = 0y = 0for i = 90 to 180 donewx = a * cos(i)y = b * sin(i)if prevx <> newx thendrawpoint(startx - newx, endy - y)coloured("red")endifprevx = newxnextmidangle=135midx=a*cos(midangle)midy=b*sin(midangle)tangentx=startx-midxtangenty=endy-midyslope=-(b*b*midx)/(a*a*midy)intercept = tangenty - slope * tangentxlength = 20 // Ajusta la longitud de la tangente según sea necesariox1 = tangentx - lengthy1 = tangenty - length * slopex2 = barindex+lengthy2 = slope*x2+interceptdrawpoint(tangentx, tangenty) coloured("blue")drawsegment(x1, y1, x2, y2) coloured("blue")endifendif//-------------------------------------------------------------------------------////-------------------------------------------------------------------------------////-------------------------------------------------------------------------------//return1 user thanked author for this post.
05/29/2024 at 6:25 PM #233257Muchísimas gracias Iván. Gran trabajo !!!. Si pudieras rematar el trabajo con el detalle de que hay veces dibuja el arco en la zona izquierda del precio (tomando punto central del arco a la izquierda) al igual que su tangente y debería ser siempre a la derecha de dicho punto.
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: