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

Viewing 6 posts - 1 through 6 (of 6 total)
  • #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&gt;
    <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> TakeProfit
    #247263

    Intente publicar nuevamente o adjunte el archivo ITF.

     

    #247288
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    //PRC_Out of the range TS | strategy
    //10.03.2017
    //Sharing ProRealTime knowledge
    defparam cumulateorders = false
    // — parameters
    StartHour = 080000
    EndHour = 180000
    Size = 1 //position size
    StopLoss = 60 //stoploss in points
    TakeProfit = 10 //takeprofit in points
    LookbackPeriod = 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*2
    if not onmarket and tcondition and barindextradeindex(1)>=LookbackPeriod then
    BUY Size CONTRACTS AT highest[LookbackPeriod](high)+PointsDistance*pointsize STOP
    SELLSHORT Size CONTRACTS AT lowest[LookbackPeriod](low)PointsDistance*pointsize STOP
    endif
    SET STOP PLOSS StopLoss
    SET TARGET PPROFIT TakeProfit
    #247290
    //PRC_Out of the range TS | strategy
    //10.03.2017
    //Sharing ProRealTime knowledge
    defparam cumulateorders = false
    // — parameters
    StartHour = 080000
    EndHour = 180000
    Size = 1 //position size
    StopLoss = 60 //stoploss in points
    TakeProfit = 10 //takeprofit in points
    LookbackPeriod = 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*2
    if not onmarket and tcondition and barindextradeindex(1)>=LookbackPeriod then
    BUY Size CONTRACTS AT highest[LookbackPeriod](high)+PointsDistance*pointsize STOP
    SELLSHORT Size CONTRACTS AT lowest[LookbackPeriod](low)PointsDistance*pointsize STOP
    endif
    SET STOP PLOSS StopLoss
    SET TARGET PPROFIT TakeProfit
    #247314

    Hola. Aquí tienes un ejemplo:

    1 user thanked author for this post.
    #247500

    mil gracias Roberto, voy a testearlo

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login