Demande d'aide programmation colorier un indicateur

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #78239 quote
    philvm69
    Participant
    Average

    Bonjour à tous, bonjour Nicolas,

    Débutant, je chercher à coder l’idée suivante et la mettre en couleur:

    avoir un indicateur flag qui prendrait les couleurs suivantes selon des conditions:

    p > mm50 et mm50 > mm200 –> vert

    mm50 > p > mm200 –> orange

    mm50 > mm200 > p –> rouge

    Votre aide m’aiderait beaucoup et je vous en remercie déjà,

    Philippe

    #78293 quote
    Nicolas
    Keymaster
    Legend

    Donc faire un histogramme avec des couleurs différentes selon ces conditions ?

    #78294 quote
    philvm69
    Participant
    Average

    Bonjour Nicolas,

    oui svp

    Merci

    #78386 quote
    Nicolas
    Keymaster
    Legend

    ok donc ce code devrait faire l’affaire :

    p = close
    mm50 = average[50]
    mm200 = average[200]
    
    green= p > mm50 and mm50 > mm200 //-> vert
    orange= mm50 > p and p > mm200 //-> orange
    red = mm50 > mm200 and mm200 > p //-> rouge
    
    if green then 
    r=0
    g=255
    elsif orange then 
    r=255
    g=128
    elsif red then 
    r=255
    g=0
    endif 
    
    return 1 coloured(r,g,0) style(histogram,2)
    histogram-color-signal-indicator.png histogram-color-signal-indicator.png
    #78430 quote
    philvm69
    Participant
    Average

    Merci Nicolas,

    Cordialement,

    Philippe

Viewing 5 posts - 1 through 5 (of 5 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

Demande d'aide programmation colorier un indicateur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
philvm69 @philvm69 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by philvm69
8 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 08/15/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...