ROBOT ADX

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #81467 quote
    GraHal
    Participant
    Master

    Pablo Jimenez please post the full code as far as you have got up to now (with Roberto’s changes etc) … then we not all making the same changes and maybe resulting in differences etc?

    #81469 quote
    robertogozzi
    Moderator
    Master

    This is the modified code I used  to backtest it

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = False // Acumulación de posiciones desactivada
     
    // Condiciones para entrada de posiciones largas
    indicator1 = ExponentialAverage[8](close)
    c1 = (indicator1 < close)
    indicator2 = Williams[40](close)
    c2 = (indicator2 > -50)
    indicator3 = WilderAverage[8](close)
    c3 = (indicator3 < close)
    indicador4 = ADX[14]
    c4= (indicador4 >= 17 AND indicador4 <= 28)
    c6 = (summation[2](c1[1]) = 2)
    c7 = high > high[1]
     
    IF c1 AND c2 AND c3  and c4 AND c6 AND c7 THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Condiciones de salida de posiciones largas
    indicator5 = WilderAverage[8](close)
    c5 = (indicator5 >= close)
     
    IF c5 THEN
       SELL AT MARKET
    ENDIF
     
    // Stops y objetivos
    SET STOP pLOSS 100
    GraHal thanked this post
    #81491 quote
    GraHal
    Participant
    Master

    I experimented with the above code and got results attached over 100k bars with spread = 4

    Pablo-Ruberto.jpg Pablo-Ruberto.jpg
    #81603 quote
    Pablo Jimenez
    Participant
    Average

    I have finished the robot… thanks for all 😉

    // Definición de los parámetros del código
    
    DEFPARAM Preloadbars = 2000
    
    DEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada
    
    
    // Horario semanal
    noEntryBeforeTime = 083000 // No abrir ordenes antes de las 08:30h. Las que estuvieran abiertas continuan abiertas.
    hora1 = TIME >= noEntryBeforeTime
    
    noEntryAfterTime = 213000 // No abrir ordenes despues de las 21:30h. Las que estuvieran abiertas continuan abiertas.
    hora2 = TIME < noEntryAfterTime
    
    // Position Size
    positionsize=1
    
    
    // Condiciones para entrada de posiciones largas
    indicator1 = ExponentialAverage[8](close)
    indicator6 = ExponentialAverage[36](close)
    
    
    
    
    sto8=stochastic[8,3]
    c1 = (indicator1 < close)
    //c24 = (indicator6 < close)
    //c25 = (indicator7 < close)
    
    
    indicator2 = Williams[40](close)
    c2 = (indicator2 > -50)
    indicator3 = WilderAverage[8](close)
    c3 = (indicator3 < close)
    indicador4 = ADX[14]
    c4= (indicador4 crosses over 17 and sto8 > sto8[3])// Buen camino
    c8= (indicador4 crosses over 20 and sto8 > sto8[3])//Trade
    c9= (indicador4 crosses over 22 and sto8 > sto8[3])//F2
    c10= (indicador4 crosses over 24 and sto8 > sto8[3])//F4
    c11= (indicador4 crosses over 26 and sto8 > sto8[3])//F6
    c12= (indicador4 crosses over 28 and sto8 > sto8[3])//F8
    c6 = (summation[2](c1[1]) = 2)// 2 cierres por encima de la ema8
    c7 = high > high[1] // Maximo a la vela anterior
    //c50 = high > high[2]
    
    IF c1 AND c2 AND c3 AND c6 AND c7 AND (c4 or c8 or c9 or c10 or c11 or c12 ) AND hora1 AND hora2   THEN
    
    BUY positionsize CONTRACT AT MARKET
    ENDIF
    
    // Condiciones de salida de posiciones largas
    indicator5 = WilderAverage[8](close)
    c5 = (indicator5 >= close )
     
    IF c5 THEN
    SELL AT MARKET
    ENDIF
    
    // Condiciones para entrada de posiciones cortas
     
    c13 = (indicator1 > close)
    c26 = (indicator6 > close)
    
    c14 = (indicator2 < -50)
    c15 = (indicator3 > close)
    c16 = (summation[2](c13[1]) = 2)
    c17 = low < low[1]
    //c51= low < low[2]
    //c52= low[1] < low[2]
    c18= (indicador4 crosses over 17 and sto8 < sto8[3])
    c19= (indicador4 crosses over 20 and sto8 < sto8[3])
    c20= (indicador4 crosses over 22 and sto8 < sto8[3])
    c21= (indicador4 crosses over 24 and sto8 < sto8[3])
    c22= (indicador4 crosses over 26 and sto8 < sto8[3])
    c23= (indicador4 crosses over 28 and sto8 < sto8[3])
    
    IF c13 AND c14 AND c15  and c16 AND c17  AND c26 AND (c18 or c19 or c20 or c21 or c22 or c23  ) AND hora1 AND hora2  THEN
    
    SELLSHORT positionsize  CONTRACT AT MARKET
    
    ENDIF
    
    // Condiciones de salida de posiciones cortas
    
    c5 = (indicator5 <= close)
     
    IF c5 THEN
    EXITSHORT AT MARKET
    ENDIF
     
    
    // Stops y objetivos
    SET STOP pLOSS 35
    DECO_DAX_H4.jpg DECO_DAX_H4.jpg DOW_H4.png DOW_H4.png DECO_DAX_DIARIO.jpg DECO_DAX_DIARIO.jpg DECO_APPLE_DIARIO.png DECO_APPLE_DIARIO.png
Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.

ROBOT ADX


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 18 replies,
has 4 voices, and was last updated by Pablo Jimenez
7 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/26/2018
Status: Active
Attachments: 8 files
Logo Logo
Loading...