como ajustar el horario en un indicador por cambio de Horario de Verano Europeo
Forums › ProRealTime foro Español › Soporte ProBuilder › como ajustar el horario en un indicador por cambio de Horario de Verano Europeo
- This topic has 5 replies, 3 voices, and was last updated 3 weeks ago by
RAM24.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
05/18/2025 at 1:03 AM #247253
Hola a todos!
alguien me podria ayudar con la estrategia anexada abajo, estoy tratando de convertirla a un indicador donde se pueda ajustar al horario de verano +- 1H que se producen dos veces cada año.
saludos!
Lili
<span class=”crayon-c”>//PRC_Out of the range TS | strategy</span><span class=”crayon-c”>//10.03.2017</span><span class=”crayon-c”>//Nicolas @ http://www.prorealcode.com</span><span class=”crayon-c”>//Sharing ProRealTime knowledge</span><span class=”crayon-st”>defparam</span> <span class=”crayon-st”>cumulateorders</span> <span class=”crayon-o”>=</span> <span class=”crayon-t”>false</span><span class=”crayon-c”>// — parameters</span>StartHour <span class=”crayon-o”>=</span> <span class=”crayon-cn”>080000</span>EndHour <span class=”crayon-o”>=</span> <span class=”crayon-cn”>180000</span>Size <span class=”crayon-o”>=</span> <span class=”crayon-cn”>1</span> <span class=”crayon-c”>//position size</span>StopLoss <span class=”crayon-o”>=</span> <span class=”crayon-cn”>60</span> <span class=”crayon-c”>//stoploss in points</span>TakeProfit <span class=”crayon-o”>=</span> <span class=”crayon-cn”>10</span> <span class=”crayon-c”>//takeprofit in points</span>LookbackPeriod <span class=”crayon-o”>=</span> <span class=”crayon-cn”>10</span> <span class=”crayon-c”>//lookback period to find highest high and lowest low (price range)</span>PointsDistance <span class=”crayon-o”>=</span> <span class=”crayon-cn”>5</span> <span class=”crayon-c”>//distance in points to add/substract from highest high or lowest low to put the pending stop orders</span><span class=”crayon-c”>// ————</span>tcondition <span class=”crayon-o”>=</span> <span class=”crayon-st”>time</span><span class=”crayon-o”>></span>StartHour <span class=”crayon-st”>and</span> EndHour <span class=”crayon-st”>and</span> <span class=”crayon-st”>intradaybarindex</span><span class=”crayon-o”>>=</span>LookbackPeriod<span class=”crayon-o”>*</span><span class=”crayon-cn”>2</span><span class=”crayon-st”>if</span> <span class=”crayon-st”>not</span> <span class=”crayon-st”>onmarket</span> <span class=”crayon-st”>and</span> tcondition <span class=”crayon-st”>and</span> <span class=”crayon-st”>barindex</span><span class=”crayon-o”>-</span><span class=”crayon-st”>tradeindex</span>(<span class=”crayon-cn”>1</span>)<span class=”crayon-o”>>=</span>LookbackPeriod <span class=”crayon-st”>then</span><span class=”crayon-st”>BUY</span> Size <span class=”crayon-st”>CONTRACTS</span> <span class=”crayon-st”>AT</span> <span class=”crayon-r”>highest</span><span class=”crayon-o”>[</span>LookbackPeriod<span class=”crayon-o”>]</span>(<span class=”crayon-st”>high</span>)<span class=”crayon-o”>+</span>PointsDistance<span class=”crayon-o”>*</span><span class=”crayon-st”>pointsize</span> <span class=”crayon-st”>STOP</span><span class=”crayon-st”>SELLSHORT</span> Size <span class=”crayon-st”>CONTRACTS</span> <span class=”crayon-st”>AT</span> <span class=”crayon-r”>lowest</span><span class=”crayon-o”>[</span>LookbackPeriod<span class=”crayon-o”>]</span>(<span class=”crayon-st”>low</span>)<span class=”crayon-o”>-</span>PointsDistance<span class=”crayon-o”>*</span><span class=”crayon-st”>pointsize</span> <span class=”crayon-st”>STOP</span><span class=”crayon-st”>endif</span><span class=”crayon-st”>SET STOP</span> <span class=”crayon-st”>PLOSS</span> StopLoss<span class=”crayon-st”>SET TARGET</span> <span class=”crayon-st”>PPROFIT</span> TakeProfit05/18/2025 at 10:09 AM #247263Intente publicar nuevamente o adjunte el archivo ITF.
05/18/2025 at 10:21 PM #247288567891011121314151617181920212223242526//PRC_Out of the range TS | strategy//10.03.2017//Nicolas @ http://www.prorealcode.com//Sharing ProRealTime knowledgedefparam cumulateorders = false// — parametersStartHour = 080000EndHour = 180000Size = 1 //position sizeStopLoss = 60 //stoploss in pointsTakeProfit = 10 //takeprofit in pointsLookbackPeriod = 10 //lookback period to find highest high and lowest low (price range)PointsDistance = 5 //distance in points to add/substract from highest high or lowest low to put the pending stop orders// ————tcondition = time>StartHour and EndHour and intradaybarindex>=LookbackPeriod*2if not onmarket and tcondition and barindex–tradeindex(1)>=LookbackPeriod thenBUY Size CONTRACTS AT highest[LookbackPeriod](high)+PointsDistance*pointsize STOPSELLSHORT Size CONTRACTS AT lowest[LookbackPeriod](low)–PointsDistance*pointsize STOPendifSET STOP PLOSS StopLossSET TARGET PPROFIT TakeProfit05/18/2025 at 10:54 PM #247290//PRC_Out of the range TS | strategy//10.03.2017//Nicolas @ http://www.prorealcode.com//Sharing ProRealTime knowledgedefparam cumulateorders = false// — parametersStartHour = 080000EndHour = 180000Size = 1 //position sizeStopLoss = 60 //stoploss in pointsTakeProfit = 10 //takeprofit in pointsLookbackPeriod = 10 //lookback period to find highest high and lowest low (price range)PointsDistance = 5 //distance in points to add/substract from highest high or lowest low to put the pending stop orders// ————tcondition = time>StartHour and EndHour and intradaybarindex>=LookbackPeriod*2if not onmarket and tcondition and barindex–tradeindex(1)>=LookbackPeriod thenBUY Size CONTRACTS AT highest[LookbackPeriod](high)+PointsDistance*pointsize STOPSELLSHORT Size CONTRACTS AT lowest[LookbackPeriod](low)–PointsDistance*pointsize STOPendifSET STOP PLOSS StopLossSET TARGET PPROFIT TakeProfit05/19/2025 at 11:57 AM #247314Hola. Aquí tienes un ejemplo:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667// === PARÁMETROS DE USUARIO ===StartHour = 80000EndHour = 180000ajustarHorarioVerano = 0 // poner en 1 si quieres añadir +1hLookbackPeriod = 10PointsDistance = 5cooldownVelas = LookbackPeriod // espera tras ruptura simulada// === AJUSTES HORARIOS ===ajuste = 0IF ajustarHorarioVerano THENajuste = 10000ENDIFhoraInicio = StartHour + ajustehoraFin = EndHour + ajuste// === VARIABLES DE CONTROL ===ONCE enEspera = 0ONCE contadorEspera = 0ONCE nivelSuperior = 0ONCE nivelInferior = 0ONCE ultimaRuptura = 0// === CÁLCULO DEL RANGO ===enHorario = Time >= horaInicio AND Time <= horaFinsuficientesVelas = intradaybarindex >= LookbackPeriod * 2IF enHorario AND suficientesVelas AND enEspera = 0 THENmaxRango = HIGHEST[LookbackPeriod](high)minRango = LOWEST[LookbackPeriod](low)nivelSuperior = maxRango + PointsDistance * PointSizenivelInferior = minRango - PointsDistance * PointSize// Simulación de rupturaIF high > nivelSuperior[1] THENenEspera = 1contadorEspera = cooldownVelasultimaRuptura = 1precioEntradaLargo=max(open,nivelSuperior[1])drawarrowup(barindex,low)coloured("green")drawpoint(barindex,precioEntradaLargo,2)coloured("blue")ELSIF low < nivelInferior[1] THENenEspera = 1contadorEspera = cooldownVelasultimaRuptura = -1precioEntradaCorto=min(open,nivelInferior[1])drawarrowdown(barindex,high)coloured("red")drawpoint(barindex,precioEntradaCorto,2)coloured("blue")ENDIFENDIF// === CONTROL DE TIEMPO DE ESPERA ===IF enEspera = 1 THENcontadorEspera = contadorEspera - 1IF contadorEspera <= 0 THENenEspera = 0ultimaRuptura = 0ENDIFENDIF// === VISUALIZACIÓN ===if enHorario=0 thenbackgroundcolor("grey",45)endif//-------------------------------------//return nivelSuperior as "SUP"coloured("green"),nivelInferior as "INF"coloured("Red")1 user thanked author for this post.
05/22/2025 at 3:19 PM #247500 -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on
Similar topics: