Porcentaje hasta la próxima resistencia o soporte
Forums › ProRealTime foro Español › Soporte ProBuilder › Porcentaje hasta la próxima resistencia o soporte
- This topic has 4 replies, 3 voices, and was last updated 1 year ago by
repropel.
-
-
07/03/2024 at 11:35 AM #234729
Hola,
En la operativa que hago, tengo que revisar más de 50 acciones todos los días. Una de las variables que miro es si el trade tiene un objetivo amplio o corto. Esto lo hago manualmente poniendo la regla y midiendo el porcentaje. Un trabajo que pienso que se podría automatizar pero, que no se me ocurre por donde empezar.
Mi pregunta es si esto que propongo se puede hacer o si alguien hizo un indicador parecido que le indique automáticamente este porcentaje de posible beneficio insertado en el precio y a la vez que indique el soporte y la resistencia más próxima.
Muchas gracias.
07/03/2024 at 11:44 AM #234732¿Puede dar un ejemplo?
¿Quiere introducir un precio y necesita calcular un porcentaje de beneficio potencial en función de qué? ¿O escribes el porcentaje y el indicador solo tiene que trazar una línea correspondiente a ese porcentaje?07/03/2024 at 12:43 PM #234737Hola
Quizás este código te pueda valer. Lo que hace es localizar los puntos pivote.
Mediante la configuración podrás marcar si es una entrada larga/corta y el ratio entre TP y Stop loss.12345678910111213141516171819202122232425262728293031323334353637383940414243444546//defparam drawonlastbaronly=true//------------------------------------------------------------////------------------------------------------------------------//prd = 5 //periods for pivot calculationpivottype=1 //method to calculate pivotsratio=2 // ratio reward/risktradetype=1 // 1= long trade / 0= short trade//------------------------------------------------------------//if pivottype thensrc1 = lowsrc2 = highelsesrc1 = min(open,close)src2 = max(open,close)endif//------------------------------------------------------------///////pivots lowif src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then$plow[z+1] = src1[prd]$plowidx[z+1] = barindex[prd]z=z+1drawpoint(barindex[prd],src1[prd],2)coloured("red",100)endif/////pivots highif src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then$phigh[t+1]=src2[prd]$phighidx[t+1]=barindex[prd]t=t+1drawpoint(barindex[prd],src2[prd],2)coloured("blue",100)endif//------------------------------------------------------------//if islastbarupdate thendist=abs($phigh[t]-$plow[z])if tradetype thenTP=$phigh[t]+ratio*distdrawsegment($phighidx[t],TP,barindex+10,TP)coloured("green")style(line,2)drawsegment($plowidx[z],$plow[z],barindex+10,$plow[z])coloured("red")style(line,2)drawsegment($phighidx[t],$phigh[t],barindex+10,$phigh[t])coloured("blue")style(dottedline,2)elseTP=$plow[z]-ratio*distdrawsegment($plowidx[z],TP,barindex+10,TP)coloured("green")style(line,2)drawsegment($plowidx[z],$plow[z],barindex+10,$plow[z])coloured("blue")style(dottedline,2)drawsegment($phighidx[t],$phigh[t],barindex+10,$phigh[t])coloured("red")style(line,2)endifendifreturn2 users thanked author for this post.
07/03/2024 at 8:13 PM #23476007/08/2024 at 5:46 PM #234966 -
AuthorPosts
Find exclusive trading pro-tools on 