Affichage Band de Bollinger sur UT supérieure

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #203406 quote
    DanC78
    Participant
    Average

    Bonjour à tous,

    Je souhaiterais afficher sur un graphique Daily, les niveaux bandes de Bollinger en Weekly, mais avec un niveau recalculer lorsque le prix est égale au niveau actuel de la bande de Bollinger, donc un prix projeté dans le futur !

    Le niveaux ne s’affiche pas et à la place la mention n/d s’affiche, pourriez-vous svp m’aider à trouver d’où vient le problème ?

    Merci

     

    defparam drawonlastbaronly=true
    DEFPARAM CalculateOnLastBars = 5300
    Voffset = pipsize
    
    timeframe(weekly)
    
    
    uw= BollingerUp[20](Close)
    lw= Bollingerdown[20](Close)
    
    
    syD = (SUMMATION[19](Close)[1] + uw)/20
    syD2 = (SUMMATION[19](Close)[1] + lw)/20
    
    sy2D = (SUMMATION[19](SQUARE(Close))[1] + (SQUARE(uw)))/20
    sy2D2 = (SUMMATION[19](SQUARE(Close))[1] + (SQUARE(lw)))/20
    
    newSTDD = SQRT(sy2D-syD*syD)
    newSTDD2 = SQRT(sy2D2-syD2*syD2)
    
    avgD = (summation[19](Close)[1] + uw)/20
    avgD2 = (summation[19](Close)[1] + lw)/20
    
    uw1 = round(avgD+newSTDD*2)
    lw1 = round(lw)
    
    uw2 = round(uw)
    lw2 = round(avgD2-newSTDD2*2)
    
    sma20w = average[20](Close)
    
    if Close > sma20w then
    
    uwe = uw1
    lwe = lw1
    
    elsif Close < sma20w then
    
    lwe = lw2
    uwe = uw2
    
    Endif
    
    
    
    
    Timeframe(Daily)
    
    //Up
    
    DRAWTEXT("UW",barindex+2,uw,SansSerif,Bold,10)coloured(150,150,150)
    DRAWTEXT("#uwe#",barindex+7,uw,SansSerif,Bold,10)coloured(150,150,150)
    drawsegment(barindex+3,uw,barindex+4,uw) coloured(76,166,107)
    
    
    //Down
    
    
    DRAWTEXT("LW",barindex+2,lw,SansSerif,Bold,10)coloured(150,150,150)
    DRAWTEXT("#lwe#",barindex+7,lw,SansSerif,Bold,10)coloured(150,150,150)
    drawsegment(barindex+3,lw,barindex+4,lw) coloured(76,166,107)
    
    
    RETURN
    2022-11-02_12h43_22.jpg 2022-11-02_12h43_22.jpg
    #203409 quote
    DanC78
    Participant
    Average

    Précision, si j’affiche le code en Weekly, les données s’affichent correctement, le problème vient donc probablement de la gestion du MTF.

    #203416 quote
    JC_Bywan
    Moderator
    Master

    Le “n/d” semble venir des fois où le calcul des racines carrées est impossible en lignes 18 ou 19 car tentative de racine d’un nombre négatif, ça se propage à uw1 ou lw2 en lignes 24 ou 28, puis à uwe ou lwe en lignes (34 et 52) ou (39 et 60)

    #203418 quote
    DanC78
    Participant
    Average

    Je ne pense pas que cela vient de là, car lorsque je sélectionne le TF Weekly, l’affichage est correct, cf.image ci-jointe.

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

Affichage Band de Bollinger sur UT supérieure


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
DanC78 @danc78 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by DanC78
3 years, 4 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/02/2022
Status: Active
Attachments: 2 files
Logo Logo
Loading...