Probleme de trades qui ne se cloturent jamais

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #121810 quote
    sophia_etoille83
    Participant
    Average

    Bonjour,

    Je sollicite votre aide pour un bug que je n’arrive pas résoudre.
    J’ai pris un code/stratégie sur le site, je n’ai conservé que le code de la fractale william et j’ai modifié tout le reste pour coller à ma stratégie.

    J’ai un excellent résultat de gain/ratio sur 9ans (88% de trades gagnants et ratio 3.90% sachant que je compte pyramider par la suite quand le bug sera réparé). Mais à 4 reprises (voir les carrés oranges) les trades ne se cloturent pas, certains durent des mois, aucune condition de sortie cloture le trade durant ces 4 périodes alors que tout fonctionne le reste du temps. J’ai testé des conditions basiques pour voir si les trades se cloturaient mais rien y fait, j’ai même changer de devises et c’est idem.

    Je m’arrache les cheveux depuis hier … sans succès ….
    J’ai insérer la photo, vous verrez les 4 triangles oranges….

    Merci beaucoup pour votre aide 🙂

    Voici le code

    //EURUSD(-) - IG MARKET
    // TIME FRAME 1H
    // PROBACKTEST TICK by TICK - 200.000 bars
    // SPREAD 0.6 PIP
    // ALE
     
    DEFPARAM CumulateOrders = false
    ///BILL WILLIAM FRACTAL INDICATOR
    //CP=PERIOD
    CP=100 
    if close[cp] >= highest[2*cp+1](close) then
    LH = 1
    else
    LH=0
    endif
    if close[cp] <= lowest[2*cp+1](close)  then
    LL= -1
    else
    LL=0
    endif
    if LH=1 then
    HIL = close[cp]
    endif
    if LL  = -1 then
    LOL=close[cp]
    endif
    
    
    ///  2h
    timeframe(2h)
    EMA20 = ExponentialAverage[5](close) // 20
    EMA50= ExponentialAverage[10](close) //50
    hausse2h =  EMA20 > EMA50
    baisse2h = close < EMA20
    // prix au dessu trend
    indicator1 = SuperTrend[3,10]
    HAUSSEtrend = (close >= indicator1)
    BAISSEtrend = (close < indicator1)
    timeframe(default)
    
    
     
    //LONG and SHORT CONDITIONS
    Positionsize=1
    if (time >=90000 and time < 230000) then
    
    C1 = (close CROSSES OVER HIL)
    D1 = (close CROSSES UNDER LOL)
    IF c1  and hausse2h and HAUSSEtrend  and not shortonmarket THEN
    BUY positionsize CONTRACT AT MARKET
    ENDIF
     
    IF D1  and baisse2h and BAISSEtrend  and not longonmarket THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    ENDIF
    ENDIF
     
     
    
    ////////////////////////////////////
    //////////  CONDITISTOP SORTIE
    
    indicatorBB = SuperTrend[3,10]
    closeSTOPDUshort = close CROSSES OVER indicatorBB
    
    closeSTOPDUbuy= close <= indicatorBB 
    
    
    
    // SORTIE
    if longonmarket and closeSTOPDUbuy then
    SELL AT MARKET
    endif
    
    if shortonmarket AND closeSTOPDUshort  then
    SELL AT MARKET
    endif
    
    
    // Take profit : TP= 15 to 80
    set target pprofit 20// ORIGINE 30
    //sET STOP pLOSS 65
    

     

    Sophie

    #121811 quote
    Nicolas
    Keymaster
    Master

    Les questions sur le trading automatique doivent être postés dans le forum ProOrder. Merci de penser à un titre moins générique que “Besoin d’aide sur un bug” la prochaine fois, sinon on va avoir des dizaines de sujets avec ce même type de titres et ça ne sera d’aucune utilité pour les prochains visiteurs pour souhaiterai retrouver des réponses à  leurs questions 😉

    Je vais tester le problème de mon côté pour vérifier. EURUSD et timeframe H1 c’est bien ça ?

    #121812 quote
    sophia_etoille83
    Participant
    Average

    Désolée Nicolas.

    Oui c’est bien en 1h + conditions 2h

     

    Merci 🙂

    #121813 quote
    Nicolas
    Keymaster
    Master

    Les ordres SHORT ne sont jamais fermés hormis en takeprofit, car tu as utilisé SELL au lieu de EXITSHORT à la ligne 76.

    #121814 quote
    sophia_etoille83
    Participant
    Average

    Oh super Nicolas, tu es trop fort. En une minute tu règles une prise de tête de plus de 24H,
    Les résultats sont fabuleux, je vais continuer sur ma lancée…

    Un grand merci pour ton professionnalisme et ta réactivité 🙂

    Très belle journée 🙂

    #121815 quote
    sophia_etoille83
    Participant
    Average

    Oups, autre petite question, pour la ligne 76 ok

    mais pour la ligne des achats, c’est ausi EXITSHORT?

     

    merci 🙂

    // SORTIE
    if longonmarket and closeSTOPDUbuy then
    SELL AT MARKET
    endif

     

    #121816 quote
    sophia_etoille83
    Participant
    Average

    C’est bon j’ai trouvé.

    #121842 quote
    fifi743
    Participant
    Master

    bonjour,

    avec quelque réglage et surtout le stop par rapport au TP voir 1 pour 1 ou plus

    //EURUSD(-) - IG MARKET
    // TIME FRAME 1H
    // PROBACKTEST TICK by TICK - 200.000 bars
    // SPREAD 0.6 PIP
    // ALE
     
    DEFPARAM CumulateOrders = false
    ///BILL WILLIAM FRACTAL INDICATOR
    //CP=PERIOD
    CP=100
    if close[cp] >= highest[2*cp+1](close) then
    LH = 1
    else
    LH=0
    endif
    if close[cp] <= lowest[2*cp+1](close)  then
    LL= -1
    else
    LL=0
    endif
    if LH=1 then
    HIL = close[cp]
    endif
    if LL  = -1 then
    LOL=close[cp]
    endif
    
    
    ///  2h
    timeframe(2h)
    EMA20 = Average[5](close) // 20
    EMA50= Average[10](close) //50
    hausse2h =  EMA20 > EMA50
    baisse2h = close < EMA20
    // prix au dessu trend
    indicator1 = SuperTrend[3,10]
    HAUSSEtrend = (close >= indicator1)
    BAISSEtrend = (close < indicator1)
    timeframe(default)
    
    
     
    //LONG and SHORT CONDITIONS
    Positionsize=1
    if (time >=80000 and time < 230000) then
    
    C1 = (close CROSSES OVER HIL)
    D1 = (close CROSSES UNDER LOL)
    IF open<close and c1  and hausse2h and HAUSSEtrend  and not shortonmarket THEN
    BUY positionsize CONTRACT AT MARKET
    ENDIF
     
    IF  D1  and baisse2h and BAISSEtrend  and not longonmarket THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    ENDIF
    ENDIF
     
     
    
    ////////////////////////////////////
    //////////  CONDITISTOP SORTIE
    
    indicatorBB = SuperTrend[3,10]
    closeSTOPDUshort = close CROSSES OVER indicatorBB
    
    closeSTOPDUbuy= close <= indicatorBB
    
    
    
    // SORTIE
    if longonmarket and closeSTOPDUbuy then
    SELL AT MARKET
    endif
    
    if shortonmarket AND closeSTOPDUshort  then
    exitshort AT MARKET
    endif
    
    
    // Take profit : TP= 15 to 80
    set target pprofit 70// ORIGINE 30
    sET STOP pLOSS 40
    Capture-d’écran-735.png Capture-d’écran-735.png
    #121871 quote
    sophia_etoille83
    Participant
    Average

    J’ai un stop suiveur  mais je j’ai enlevé pas mal de code pour simplifier.

    je suis encore sur des reglages mais c’est entre 5 et 13.

    les resultats sont tres bons mais en 2018 ce n’est pas le cas, donc j’etudie tous les trades perdants de 2018 pour identifier le probleme.

    #121874 quote
    sophia_etoille83
    Participant
    Average

    je viens de prendre connaissance de la photo « code sophie » les resultats ne sont pas bons, je suis à plus de 80% de trades gagnants et le ratio à plus de 2.

    quand je l’aurai terminé je mettrai l’intégralité du code pour les interessés.

    fifi743 and Nicolas thanked this post
    #121897 quote
    Nicolas
    Keymaster
    Master

    Merci sophia pour ces retours, j’apprécie.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Probleme de trades qui ne se cloturent jamais


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 10 replies,
has 3 voices, and was last updated by Nicolas
6 years ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/11/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...