Probleme pour code affichage niveau ATR

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #245628 quote
    maxlys
    Participant
    Senior

    Bonjour, J’essaye de faire afficher sur le panneau de prix des niveaux haut et bas suivant 1 et 2x ATR

    Mais au niveau des 4 lignes commençant par drawtext PRT me signale une erreur au niveau des signes +.

    Pourriez vous m’indiquer quelle est l’erreur dans mon code et comment le modifier ?

    // Paramètres
    atrPeriod = 14
    myATR = AverageTrueRange[atrPeriod]
    basePrice = close  // on évite le mot réservé 'price'
    
    // Calcul des niveaux
    high1ATR = basePrice + myATR
    low1ATR  = basePrice - myATR
    high2ATR = basePrice + 2 * myATR
    low2ATR  = basePrice - 2 * myATR
    
    // Affichage texte uniquement sur la dernière bougie
    
    if barindex = lastbarindex then
    drawtext("1x ATR Max: " + high1ATR, barindex, high1ATR, dialog, red, 12)
    drawtext("1x ATR Min: " + low1ATR, barindex, low1ATR, dialog, red, 12)
    drawtext("2x ATR Max: " + high2ATR, barindex, high2ATR, dialog, blue, 12)
    drawtext("2x ATR Min: " + low2ATR, barindex, low2ATR, dialog, blue, 12)
    
    endif
    
    return high1ATR as "Max 1x ATR", low1ATR as "Min 1x ATR", high2ATR as "Max 2x ATR", low2ATR as "Min 2x ATR"

     

     

     

     

     

    merci

    #245629 quote
    fifi743
    Participant
    Master

    j’ai pas verifié

     

    drawtext("1x ATR Max:#high1ATR", barindex, high1ATR, dialog, red, 12)
    #245630 quote
    fifi743
    Participant
    Master

    bon j’ai tout modifié

    // Paramètres
    atrPeriod = 14
    myATR = AverageTrueRange[atrPeriod]
    basePrice = close  // on évite le mot réservé 'price'
     
    // Calcul des niveaux
    high1ATR = basePrice + myATR
    low1ATR  = basePrice - myATR
    high2ATR = basePrice + 2 * myATR
    low2ATR  = basePrice - 2 * myATR
     
    // Affichage texte uniquement sur la dernière bougie
     
    if IsLastBarUpdate  then
    drawtext("1x ATR Max: :#high1ATR#", barindex, high1ATR, dialog, bold, 12)coloured("red")
    drawtext("1x ATR Min: #low1ATR#", barindex, low1ATR, dialog, bold, 12)coloured("red")
    drawtext("2x ATR Max: #high2ATR#", barindex, high2ATR, dialog, bold, 12)coloured("blue")
    drawtext("2x ATR Min: #low2ATR#", barindex, low2ATR, dialog,bold, 12)coloured("blue")
     
    endif
     
    return high1ATR as "Max 1x ATR", low1ATR as "Min 1x ATR", high2ATR as "Max 2x ATR", low2ATR as "Min 2x ATR"
    
    Iván González thanked this post
    #245633 quote
    maxlys
    Participant
    Senior

    Merci beaucoup pour ce retour rapide.

    #248816 quote
    fleglo
    Participant
    Junior

    Bonjour, je n’ai pas trouvé d’autres forum plus proche que mon pb ATR sur le sujet.

    J’ai un souci avec les différences entre les indicateurs de PRT et les mêmes de la fonction Graph, notamment les RSI et l’ATR qui ne correspondent pas du tout ce qui fausse tout le travail.

    Comment résoudre ce problème svp ?

    je joints une capture juste après l’intradaybarindex = 0 d’un ATR 66(close)

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

Probleme pour code affichage niveau ATR


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
maxlys @maxlys Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by fleglo
6 months, 4 weeks ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/06/2025
Status: Active
Attachments: 2 files
Logo Logo
Loading...