PRT BAND ADAPTATIE

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #253115 quote
    kats
    Participant
    Junior

    BONJOUR
    J’AI UN CODE POUR PRT-BAND ADAPTATIVES MAIS IL A UN PROBLEME SIGNAL2 LIGNE 10 QUAND JE TENTE DE LE METTRE SUR PRT;
    QUELQU’

    // PRT BAND ADAPTATIVE - Version avec KAMA et ATR Dynamique
    // Auteur: Inspiré communauté ProRealCode (adapté pour volatilité adaptative)
    // Paramètres
    PeriodKAMA = 10          // Période KAMA (médiane adaptative)
    ATRPeriod = 14           // Période ATR
    BaseMultiplier = 2.0     // Multiplicateur de base
    AdaptPeriod = 5          // Période adaptation (EMA sur ATR pour dynamisme)
    
    // Calcul KAMA (Adaptive Moving Average)
    ER = Abs(Close - Close[PeriodKAMA]) / Sum(Abs(Close - Close[1][PeriodKAMA] ) // Efficiency Ratio         C'EST SUR CETTE LIGNE
    SC = Pow((ER * (2/(2+1) - 2/(30+1)) + 2/(30+1)), 2)  // Smoothing Constant
    KAMA = 0
    KAMA[1] = Close[PeriodKAMA]
    FOR i = PeriodKAMA DOWNTO 1 DO
    KAMA = KAMA[1] + SC * (Close - KAMA[1])
    NEXT
    
    // ATR Adaptatif
    ATRValue = AverageTrueRange[ATRPeriod](Close)
    AdaptATR = ExponentialAverage[AdaptPeriod](ATRValue) / ATRValue[1]  // Ratio adaptation (1 = neutre)
    Multiplier = BaseMultiplier * (1 + (AdaptATR - 1) * 0.5)  // Dynamique : +50% max en expansion
    
    // Bandes
    UpperBand = KAMA + (ATRValue * Multiplier)
    LowerBand = KAMA - (ATRValue * Multiplier)
    
    // Plots (avec couleurs PRT Bands-like)
    IF Close > UpperBand THEN
    plotshape(UpperBand, "Bande Sup (Vert)", Green, style=curve, thickness=2)
    plotshape(LowerBand, "Bande Inf (Vert)", Green, style=curve, thickness=2)
    plotshape(KAMA, "Médiane (Vert)", Lime, style=curve, thickness=1)
    ELSIF Close < LowerBand THEN
    plotshape(UpperBand, "Bande Sup (Rouge)", Red, style=curve, thickness=2)
    plotshape(LowerBand, "Bande Inf (Rouge)", Red, style=curve, thickness=2)
    plotshape(KAMA, "Médiane (Rouge)", Maroon, style=curve, thickness=1)
    ELSE
    plotshape(UpperBand, "Bande Sup", Blue, style=curve, thickness=2)
    plotshape(LowerBand, "Bande Inf", Blue, style=curve, thickness=2)
    plotshape(KAMA, "Médiane", Cyan, style=curve, thickness=1)
    ENDIF
    
    // Alertes (optionnel)
    IF CrossesOver(Close, UpperBand) THEN
    ALERT("Breakout Haussier Adaptatif!")
    ENDIF
    IF CrossesUnder(Close, LowerBand) THEN
    ALERT("Breakout Baissier Adaptatif!")
    ENDIF
    
    RETURN UpperBand SEPARATED BY LowerBand SEPARATED BY KAMA

    UN PEUT IL M’AIDER SVP,
    CDLT

    #253117 quote
    jesus1975
    Participant
    Veteran

    ER = Abs(Close – Close[PeriodKAMA])/Summation[PeriodKAMA](Abs(Close – Close[1]))

    Iván González thanked this post
    #253125 quote
    Iván González
    Moderator
    Master

    Buff… Votre code présente bien plus de problèmes que la ligne 10…
    Je suis sûr que vous l’avez créé avec une IA, mais vous ne lui avez pas donné le contexte approprié, car le langage ProBuilder est différent.
    Je vous recommande de jeter un œil à l’article suivant: https://www.prorealcode.com/topic/create-strategies-codes-with-chatgpt-for-prorealtime/

    #253145 quote
    kats
    Participant
    Junior

    bonsoir
    OUI DE GROK PLUS PRECISEMMENT;
    EST IL POSSIBLE DE LE PROGRAMMER AVEC VOS CONNAISSANCES DANS LE DOMAINE?
    ca donnerait beaucoup de possibilités en mixant plusieurs avec des variables différentes
    Perso je ne sais pas faire
    si oui merci d’avance
    Cdt

    #253163 quote
    Iván González
    Moderator
    Master

    Je n'ai pas utilisé GROK, mais la procédure serait similaire à celle décrite dans l'article que je vous ai envoyé.

    #253185 quote
    kats
    Participant
    Junior

    Bonsoir
    merci pour la réponse mais je ne sais pas faire. je ne suis pas programmeuse, je bricole tout juste.
    Ma question était plutôt si et quand alliez vous éventuellement entreprendre la programmation de cet indicateur qui serait à mon avis très intéressant?
    cdlt

    #253194 quote
    jacquesgermain
    Participant
    Senior

    Bonjour voir ci après

    // PRT BAND ADAPTATIVE – Version avec KAMA et ATR Dynamique
    // Auteur: Inspiré communauté ProRealCode (adapté pour volatilité adaptative)
    // Paramètres
    PeriodKAMA = 10 // Période KAMA (médiane adaptative)
    FastPeriod=2
    SlowPeriod=30
    ATRPeriod = 14 // Période ATR
    BaseMultiplier = 2.0 // Multiplicateur de base
    AdaptPeriod = 5 // Période adaptation (EMA sur ATR pour dynamisme)

    // CALCUL KAMA
    Fastest = 2 / (FastPeriod + 1)
    Slowest = 2 / (SlowPeriod + 1)
    if barindex < PeriodKAMA+1 then
    Kama=close
    else
    Num = abs(close-close[PeriodKAMA])
    Den = summation[PeriodKAMA](abs(close-close[1]))
    ER = Num / Den
    Alpha = SQUARE(ER *(Fastest – Slowest )+ Slowest)
    KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])
    endif
    // ATR Adaptatif
    ATRValue = AverageTrueRange[ATRPeriod](Close)
    AdaptATR = ExponentialAverage[AdaptPeriod](ATRValue) / ATRValue[1] // Ratio adaptation (1 = neutre)
    Multiplier = BaseMultiplier * (1 + (AdaptATR – 1) * 0.5) // Dynamique : +50% max en expansion
    // Bandes
    UpperBand = KAMA + (ATRValue * Multiplier)
    LowerBand = KAMA – (ATRValue * Multiplier)
    // Points
    IF Close > UpperBand THEN
    DRAWPOINT(barindex,UpperBand,1)coloured(“lime”)
    DRAWPOINT(barindex,LowerBand,1)coloured(“green”)
    DRAWPOINT(barindex,KAMA,1)coloured(“lime”)
    ELSIF Close < LowerBand THEN
    DRAWPOINT(barindex,UpperBand,1)coloured(“red”)
    DRAWPOINT(barindex,LowerBand,1)coloured(“red”)
    DRAWPOINT(barindex,KAMA,1)coloured(“maroon”)
    ELSE
    DRAWPOINT(barindex,UpperBand,1)coloured(“blue”)
    DRAWPOINT(barindex,LowerBand, 1) coloured(“blue”)
    DRAWPOINT(barindex,KAMA,1)coloured(“cyan”)
    ENDIF
    // Alertes (optionnel)
    IF Close crosses over UpperBand THEN
    DRAWTEXT(“BO haussier”, barindex, high)coloured(“green”)
    ENDIF
    IF Close crosses under LowerBand THEN
    DRAWTEXT(“BO Baissier”, barindex, Low)coloured(“red”)
    ENDIF

    RETURN UpperBand,LowerBand ,KAMA

    #253199 quote
    jacquesgermain
    Participant
    Senior

    pour éviter les bugs importer le fichier ci-joint

    Mon-indicateur18.itf
    #253228 quote
    kats
    Participant
    Junior

    Bonjour
    je regarderai ce soir tranquillement mais merci d’avance super sympa.

    #253397 quote
    kats
    Participant
    Junior

    bonjour
    j’ai pris mon temps pour regarder
    C’est très diffèrent de PRT BAND au niveau graphique et difficile a mixer avec le PRT Band.
    La réponse n’est pas une critique et je tiens a te remercier pour avoir essayer de m’aider.
    cdlt

    #253400 quote
    jacquesgermain
    Participant
    Senior

    Bonjour

    Effectivement mais le code en erreur que vous avez fourni n’a pas de liaison avec PRTBANDS c’est donc normal …

    cdt

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

PRT BAND ADAPTATIE


Support Plateforme : Graphiques, Données & Courtiers

New Reply
Author
author-avatar
kats @kats Participant
Summary

This topic contains 10 replies,
has 4 voices, and was last updated by jacquesgermain
3 months, 1 week ago.

Topic Details
Forum: Support Plateforme : Graphiques, Données & Courtiers
Language: French
Started: 10/28/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...