Colorer les bougies en fonction de la position du close et de 2 moyennes mobiles

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

    Bonjour à tous

    Je tente de me créer un indicateur qui me colore les bougies en fonction de la position de close par rapport  a son positionnement par rapport a 2 moyennes mobiles mais aussi en fonction des positions de cette même moyenne mobiles

    Ce sont mes conditions en C1,C2 , ….C6

    Et avoir une couleur différentes pour chaque condition

    Ci dessous je que j’ai tenté de faire, mais cela ne fonctionne pas, j’ai déjà une erreur au niveau des conditions.

    Merci de me donner un coup de main a modifier ce code pour le rendre fonctionnel ?

    Merci

     

    Colour = 0
    a = average[50]
    b = average[200]
    
    c1 = close > a > b
    c2 = a > close > b
    c3 = a > b > close
    c4 = b > a > close
    c5 = b > close > a
    c6 = close > b > a
    
    if c1 Then
    DRAWCANDLE(open, high, low, close)COLOURED(0,255,0)//vert
    colour=1
    
    elsif c2 then
    DRAWCANDLE(open, high, low, close)COLOURED(255,255,0)//jaune
    colour=2
    
    elsif c3 then
    
    DRAWCANDLE(open, high, low, close)COLOURED(253,63,146)//rose
    
    colour=3
    
    elsif c4 then
    
    DRAWCANDLE(open, high, low, close)COLOURED(255,0,0)//rouge
    
    colour=4
    
    elsif c5 then
    
    DRAWCANDLE(open, high, low, close)COLOURED(37,253,233)//bleu cyan
    
    colour=5
    
    elsif c6 then
    
    DRAWCANDLE(open, high, low, close)COLOURED(121,28,248)//bleu
    
    colour=6
    
    endif
    
    RETURN colour
    #213857 quote
    fifi743
    Participant
    Master

    comme ceci

     

     

    Colour = 0
    a = average[50]
    b = average[200]
     
    c1 = close > a and a > b
    c2 = a > close and close > b
    c3 = a > b and b > close
    c4 = b > a and a> close
    c5 = b > close and close> a
    c6 = close > b and b > a
     
    if c1 Then
    
    colour=1
     R=0
     V=255
     b=0
    elsif c2 then
    
    colour=2
     R=255
    V=255
    b=0
    elsif c3 then
     
     
    colour=3
     R=253
    V=63
    b=146
    elsif c4 then
    
    colour=4
     R=255
    V=0
    b=0
    elsif c5 then
    colour=5
     R=37
    V=253
    b=233
    elsif c6 then
     
    colour=6
     R=121
    V=28
    b=248
    endif
     DRAWCANDLE(open, high, low, close)COLOURED(r,v,b)//bleu
    //colour
    RETURN
    #213858 quote
    fifi743
    Participant
    Master

    je viens de me rendre compte que j’ai fait une erreur

    
    Colour = 0
    aa = average[50]
    bb = average[200]
     
    c1 = close > aa and aa > bb
    c2 = aa > close and close > bb
    c3 = aa > bb and bb > close
    c4 = bb > aa and aa> close
    c5 = bb > close and close> aa
    c6 = close > bb and bb > aa
     
    if c1 Then
     
    colour=1
    R=0
    V=255
    b=0
    elsif c2 then
     
    colour=2
    R=255
    V=255
    b=0
    elsif c3 then
     
     
    colour=3
    R=253
    V=63
    b=146
    elsif c4 then
     
    colour=4
    R=255
    V=0
    b=0
    elsif c5 then
    colour=5
    R=37
    V=253
    b=233
    elsif c6 then
     
    colour=6
    R=121
    V=28
    b=248
    endif
    DRAWCANDLE(open, high, low, close)COLOURED(r,v,b)
    RETURN
    Nicolas thanked this post
    #213865 quote
    maxlys
    Participant
    Senior

    Merci pour ce retour rapide.

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

Colorer les bougies en fonction de la position du close et de 2 moyennes mobiles


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
maxlys @maxlys Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/29/2023
Status: Active
Attachments: No files
Logo Logo
Loading...