Arrêt de la coloration

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #251145 quote
    Lurubu
    Participant
    Senior

    Bonjour,

    J’ai deux moyennes mobile dont je colore l(intervalle différemment selon qu’elles se rapprochent ou s’éloignent.

    Mais lors du changement d’écartement la dernière couleur se continue hors limite.

    Comment éviter cela ?

    Merci d’avance

    timeframe(4 hours,updateonclose)
    MMc=ExponentialAverage[5](TypicalPrice)
    MMl=ExponentialAverage[8](TypicalPrice)
    Ecart=MMc-MMl
    
    
    if ecart>=ecart[1] then
    colorbetween(MMl,MMc,250,0,0,50)
    else
    colorbetween(MMl,MMc,250,0,0,20)
    endif
    
    timeframe(default)
    return MMc as"MMc"coloured(255,0,0)style(line,2),MMl as"MMl"coloured(85,136,0)style(line,2)
    Couleur.png Couleur.png
    #251155 quote
    Iván González
    Moderator
    Master

    Traductor said:

    Pour éviter cela, tu dois écrire une seule ligne avec l’instruction colorbetween.
    Remplace cette partie de ton code par celle-ci :

    if ecart>=ecart[1] then
       alpha=20
    else
       alpha=50
    endif
    
    colorbetween(MMl,MMc,250,0,0,alpha)
    robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Arrêt de la coloration


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Lurubu @lurubu Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
5 months, 1 week ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/19/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...