Ajouter un stop à chaque niveau N-1 de la pyramide

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #138609 quote
    sophia_etoille83sophia_etoille83
    Participant
    Average

    Bonjour 🙂

    Après avec intégré un pyramidale via le tuto //https://www.prorealcode.com/documentation/tradeprice/ et ajouté un trailling stop sur moyenne mobile, je souhaiterai supprimer mon trailling stop pour  le modifider de la façon suivante mais je n’y arrive pas 🙁 J’ai besoin de votre aide ….

    A chaque pyramide, le niveau du stop est remonté au niveau de l’avant dernier achat de la pyramide. Ci-joint la photo pour mieux comprendre.
    Exemple: à l’achat de la pyramide N°2 le stop est remontée au niveau de l’achat de la pyramide N°1 et ainsi de suite…

     

    Un grand Merci par avance 🙂

    #138610 quote
    sophia_etoille83sophia_etoille83
    Participant
    Average

    Je pense qu’il y a une bug, sur le site car je ne pouvais pas ajouter ma photo.

    La voici 🙂

    PYRAMIDE.jpg PYRAMIDE.jpg
    #138626 quote
    NicolasNicolas
    Keymaster
    Legend

    Il faut placer un ordre STOP au niveau du précédent ordre, donc tu peux utiliser TRADEPRICE.

    #138636 quote
    sophia_etoille83sophia_etoille83
    Participant
    Average

    Merci Nicolas, mais je n’y arrive pas 🙁
    Voici mon code, donc j’ai ajouté => SET STOP pLOSS slll avec tradeprice mais je pense que mon code est total faux car cela ne fonctionne pas.

    Merci pour votre retour 🙂

    Defparam cumulateorders = true
    trenddd = SuperTrend[3,10]
    HAUSSE=exponentialaverage[20]>exponentialaverage[50] and close >trenddd
    
    
    
    //==trailling stop
    ATRsl = eXPONENTIALaverage[31]- 25 *pointsize//39--63
    
    /////////==================ACHAT
    
    If NOT ONMARKET AND RSI[14](Close) >48 and HAUSSE AND  close crosses over  trenddd then
    BUY 0.5 CONTRACTS AT MARKET
    SL = close-ATRsl
    set stop ploss SL
    dynamicSL = SL
    Endif
    
    /////////==================PYRAMIDE
    
    //https://www.prorealcode.com/documentation/tradeprice/
    //ajoutons une autre commande tandis que le prix continue à être plus élevé (plus de 10 points) que la dernière commande prise avec une condition de 5 barres écoulée depuis le
    
    
    // A CHAQUE CONSO piramidage
    IF BARINDEX-TRADEINDEX(1)>5 AND Close-TRADEPRICE(1)>50 AND LOW <= exponentialaverage[10] AND LongOnMarket AND COUNTOFLONGSHARES < 7  THEN
    
    BUY 0.3 CONTRACTS AT MARKET
    SL = ATRsl
    set stop ploss SL
    dynamicSL = SL
    ENDIF
    
    
    
    //////////////////// sortie au precedent point d'achat ---- NICOLAS ----
    slll= close-tradeprice(1)=0
    SET STOP pLOSS slll
    
    
    ////////////////////////// ---------------- trailling ------------------/////////////
    //dynamicSL
    if longonmarket then
    if(ATRsl>dynamicSL) then
    dynamicSL=ATRsl
    endif
    sell at dynamicSL stop
    //NbPos=0
    endif
    
    
    
    
    //////////==========================breakeven ==========================
    //si ce n'est pas une commande sur le marché, réinitialisez le seuil de rentabilité
    if not onmarket then
    breakeven=0
    endif
    
    /// vérifier si la commande en cours a généré 15 points de profit
    if longonmarket and close-positionprice>=300*pointsize then
    breakeven=1
    endif
    
    //put stoploss at open price + 5 points
    if breakeven=1 then
    sell at tradeprice+150*pointsize stop
    endif
    
    //////////========================== FIN breakeven ==========================
    
    
    
    #138638 quote
    fifi743fifi743
    Participant
    Master

    bonjour,

    graph dynamicSL et a mon avis tu es loin de ta cotation .

    il te manque

    close-dynamicSL

    #138649 quote
    sophia_etoille83sophia_etoille83
    Participant
    Average

    Merci fifi pour ta réponse,

    J’ai pris le code ici =>  https://www.prorealcode.com/blog/learning/moving-stoploss-dynamic-informations-proorder/

    Et il n’y a pas “close-dynamicSL”.

    Je rame  vraiment 🙁

    #138668 quote
    fifi743fifi743
    Participant
    Master

    re,

    le pyramidage marche j’ai mis des commentaires

    sophia.itf
    #138694 quote
    sophia_etoille83sophia_etoille83
    Participant
    Average

    Un grand merci fifi 🙂 Tes commentaires aident drôlement 🙂

     

    Donc finalement, cette syntaxe fonctionne alors : j’avais un doute avec le “=0″…

    slll= close-tradeprice(1)=0
    SET STOP pLOSS slll

     

    Très belle journée et encore merci pour le temps que tu y as consacré 🙂

    fifi743 thanked this post
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Ajouter un stop à chaque niveau N-1 de la pyramide


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by sophia_etoille83sophia_etoille83
6 years, 4 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 07/07/2020
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...