Pin bar modified

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

    Bonjour,

    Je vous partage le code d’un indicateur trouvé ici meme, qui detecte automatiquement les “pin bar”

    Cependant il les detecte toutes et j’aimerais un filtre à savoir, affiché le spin bar negative si : la bougie et rouge avec meche au dessus, positive si : bougie verte avec meche en dessous.

    En gardant les memes conditions que ‘lindaciteur d’origine, merci de me venir en aide.

    value = 0
    clong1 = low < low[1] and low<low[2]
    clong2 = close >= low[1]-1 and open >= low[1]-1
    clong3 = abs(open - close) < 4*range/10
    clong4 = open > (low + range*5/10) and close > (low + range*5/10)
    cshort1 = high > high[1] and high > high[2]
    cshort2 = close <= high[1]+1 and open <= high[1]+1
    cshort3 = abs(open - close) < 4*range/10
    cshort4 = open < (high - range*5/10) and close < (high - range*5/10)
    
    if clong1 and clong2 and clong3 and clong4 then
    value = 10
    elsif cshort1 and cshort2 and cshort3 and cshort4 then
    value = -10
    endif
    
    return value

     

    Ps : désolé, je n’arrive pas le partager correctement ..

    Alai-n thanked this post
    1.png 1.png
    #74038 quote
    Nicolas
    Keymaster
    Master

    Comme ceci ? J’ai uniquement ajouté un test de la couleur de la bougie.

    value = 0
    clong1 = low < low[1] and low<low[2]
    clong2 = close >= low[1]-1 and open >= low[1]-1
    clong3 = abs(open - close) < 4*range/10
    clong4 = open > (low + range*5/10) and close > (low + range*5/10)
    cshort1 = high > high[1] and high > high[2]
    cshort2 = close <= high[1]+1 and open <= high[1]+1
    cshort3 = abs(open - close) < 4*range/10
    cshort4 = open < (high - range*5/10) and close < (high - range*5/10)
    
    if clong1 and clong2 and clong3 and clong4 and close>open then
    value = 10
    elsif cshort1 and cshort2 and cshort3 and cshort4 and close<open then
    value = -10
    endif
    
    return value
    swapping and Alai-n thanked this post
    #74081 quote
    Ramahu
    Participant
    Senior

    C’est parfait Nicolas merci 😀

    #74266 quote
    JohnScher
    Participant
    Veteran

    just a little

     

    clong1 = low < low[1] and low<low[2]
    clong2 = close >= low[1]-1 and open >= low[1]-1
    clong3 = abs(open - close) < 4*range/10
    clong4 = open > (low + range*5/10) and close > (low + range*5/10)
    cshort1 = high > high[1] and high > high[2]
    cshort2 = close <= high[1]+1 and open <= high[1]+1
    cshort3 = abs(open - close) < 4*range/10
    cshort4 = open < (high - range*5/10) and close < (high - range*5/10)
    
    
    // graphics on Chart
    rL = 255
    gL = 0
    bL = 0
    
    rS = 0
    gS = 0
    bS = 255
    
    PIP                 = 10*Pipsize   ///ARROW DISTANCE
    LIN                 = 3             //LENGTH OF SEGMENT OF SUPPORT OR RESISTENCE
    RESISTENCE          = 1*Pipsize    //DISTANCE OF THE SEGMENT OF THE RESISTENCE
    SUPPORT             = 1*Pipsize
    
    if clong1 and clong2 and clong3 and clong4 and close>open then
    DRAWARROWDOWN(barindex,HIGH+PIP)coloured(rS,gS,bS)
    DRAWSEGMENT(barindex,HIGH+RESISTENCE,barindex-LIN, HIGH+RESISTENCE) coloured(rS,gS,bS)
    elsif cshort1 and cshort2 and cshort3 and cshort4 and close<open then
    DRAWARROWUP(barindex,LOW-PIP)coloured(rL,gL,bL)
    DRAWSEGMENT(barindex,LOW-SUPPORT,barindex-LIN, LOW-SUPPORT )coloured(rL,gL,bL)
    endif
     
    return
    
    swapping, Nicolas and Alai-n thanked this post
    #74328 quote
    Alai-n
    Participant
    Veteran

    Très sympa ces codes…!

    Cependant il y a une règle pour définir les Pin Bar, qui dit que (Open,Close) doivent être comprises dans le (High[1]-Low[1]).

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

Pin bar modified


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Ramahu @ramahu Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by Alai-n
7 years, 8 months ago.

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