FOLLOWLINE INDICATOR neutre

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #214840 quote
    supertiti
    Participant
    Master

    Bonjour à tous,

    Serait-il possible (à priori oui) de différencier la couleur de l’indicateur (une troisième couleur) quand celui – ci est à l’intérieur des bandes de Bollinger.

    Ceci afin d’attraper les phases de sur-achat ou sur-vente.

    Bons trades à tous.

     

    //PRC_FollowLine indicator 03.04.2020
    //Nicolas @ www.prorealcode.com //converted from MT4 code //Sharing ProRealTime knowledge
    
    // --- settings
    //BBperiod      = 21 
    //BBdeviations  = 1  
    //ATRperiod     = 5
    //UseATRfilter  = 0 //0=false ; 1=true  perso = 1
    // --- end of settings
    defparam calculateonlastbars = 150
    
    BBUpper=average[BBperiod](close)+std[BBperiod]*BBdeviations
    BBLower=average[BBperiod](close)-std[BBperiod]*BBdeviations
    //-----------------------------------------------------------------------------------
    
    if(close>BBUpper) then
    BBSignal=1
    endif
    if(close<BBLower) then
    BBSignal=-1
    endif
    
    if(BBSignal>0) then
    if(UseATRfilter) then
    TrendLine=low-averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=low
    endif
    if(TrendLine<TrendLine[1]) then
    TrendLine=TrendLine[1]
    endif
    endif
    //---
    if(BBSignal<0) then
    if(UseATRfilter) then
    TrendLine=high+averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=high
    endif
    if(TrendLine>TrendLine[1]) then
    TrendLine=TrendLine[1]
    endif
    endif
    //---
    
    iTrend=iTrend[1]
    if(TrendLine>TrendLine[1]) then
    iTrend=1
    endif
    if(TrendLine<TrendLine[1]) then
    iTrend=-1
    endif
    
    if itrend>0 then
    r=255   //0
    g=0     //191
    b=255   //255
    else
    r=72    //220
    g=0     //20
    b=255   //60
    endif
    ///////////////////////////////////////////////////////////
    
    ///////////////////////////////////////////////////////////
    return trendline coloured(r,g,b) style(dottedline1 ,5)
    
    //The FollowLine indicator is a trend following indicator. The blue/red lines are activated when the price closes above the upper Bollinger band or below the lower one.
    
    //Once the trigger of the trend direction is made, the FollowLine will be placed at High or Low (depending of the trend).
    
    //An ATR filter can be selected to place the line at a more distance level than the normal mode settled at candles Highs/Lows.
    
    Followline-Index.jpg Followline-Index.jpg
    #214928 quote
    JS
    Participant
    Senior

    Salut,

    Par exemple, vous pouvez faire dépendre les couleurs de :

    1. Close>BBUpper
    2. Close>BBLower et Close<BBUpper
    3. Close<BBLower

    (Vous obtenez un autre type d’indicateur à cause de cela…)

     
    // --- settings
    BBperiod      = 20
    BBdeviations  = 1
    ATRperiod     = 5
    UseATRfilter  = 0 //0=false ; 1=true  perso = 1
    // --- end of settings
    BBUpper=average[BBperiod](close)+std[BBperiod]*BBdeviations
    BBLower=average[BBperiod](close)-std[BBperiod]*BBdeviations
    //-----------------------------------------------------------------------------------
    if(close>BBUpper) then
    BBSignal=1
    endif
    If (Close<BBUpper) and (Close>BBLower) then
    BBSignal=0
    EndIf
    if(close<BBLower) then
    BBSignal=-1
    endif
    //---
    if(BBSignal>0) then
    if(UseATRfilter) then
    TrendLine=low-averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=low
    endif
    endif
    //---
    if(BBSignal=0) then
    if(UseATRfilter) then
    TrendLine=(High+Low)/2-averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=(High+Low)/2
    endif
    endif
    //---
    if(BBSignal<0) then
    if(UseATRfilter) then
    TrendLine=high+averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=high
    endif
    endif
    //---
    if BBSignal>0 then
    iTrend=1
    endif
    if BBSignal=0 then
    iTrend=0
    endif
    if BBSignal=-1 then
    iTrend=-1
    endif
    
    if iTrend>0 then
    r=0   //0
    g=255     //191
    b=0   //255
    EndIf
    If iTrend=0 then
    r=0
    g=0
    b=255
    EndIf
    If iTrend<0 then
    r=255    //220
    g=0     //20
    b=0   //60
    endif
    
    return trendline coloured(r,g,b) style(dottedline1 ,5)//, BBUpper Coloured("Green"),BBLower Coloured("Red")
    
    Scherm­afbeelding-2023-05-20-om-10.50.15.png Scherm­afbeelding-2023-05-20-om-10.50.15.png Scherm­afbeelding-2023-05-20-om-10.50.44.png Scherm­afbeelding-2023-05-20-om-10.50.44.png
    #214934 quote
    supertiti
    Participant
    Master
    Merci JS pour ton aide. Bon week end
    JS thanked this post
    #214956 quote
    JS
    Participant
    Senior
    Salut,

    Je pense que ce graphique donne une image plus claire…

    J’ai fait quelques ajustements, d’abord le « Low » a été utilisé lorsque le prix est passé au-dessus du BBUpper et maintenant j’utilise le « High » pour une image plus claire…

    Il en va de même pour le prix en dessous du BBLower, il fonctionne maintenant avec le « Low » au lieu du « High »…  

    // --- settings
    BBperiod      = 20
    BBdeviations  = 1
    ATRperiod     = 5
    UseATRfilter  = 0 //0=false ; 1=true  perso = 1
    // --- end of settings
    BBUpper=average[BBperiod](close)+std[BBperiod]*BBdeviations
    BBLower=average[BBperiod](close)-std[BBperiod]*BBdeviations
    //-----------------------------------------------------------------------------------
    if(close>BBUpper) then
    BBSignal=1
    endif
    If (Close<BBUpper) and (Close>BBLower) then
    BBSignal=0
    EndIf
    if(close<BBLower) then
    BBSignal=-1
    endif
    //---
    if(BBSignal>0) then
    if(UseATRfilter) then
    TrendLine=High-averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    If High<High[1] then
    TrendLine=TrendLine[1]
    else
    TrendLine=High
    endif
    endif
    endif
    //---
    if(BBSignal=0) then
    if(UseATRfilter) then
    TrendLine=(High+Low)/2-averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    TrendLine=(High+Low)/2
    endif
    endif
    //---
    if(BBSignal<0) then
    if(UseATRfilter) then
    TrendLine=Low+averagetruerange[ATRperiod]
    endif
    if(not UseATRfilter) then
    If Low>Low[1] then
    TrendLine=TrendLine[1]
    else
    TrendLine=Low
    endif
    endif
    EndIf
    //---
    if BBSignal>0 then
    iTrend=1
    endif
    if BBSignal=0 then
    iTrend=0
    endif
    if BBSignal=-1 then
    iTrend=-1
    endif
    
    if iTrend>0 then
    r=0   //0
    g=255     //191
    b=0   //255
    EndIf
    If iTrend=0 then
    r=0
    g=0
    b=255
    EndIf
    If iTrend<0 then
    r=255    //220
    g=0     //20
    b=0   //60
    endif
    
    return trendline coloured(r,g,b) style(dottedline1 ,5)//, BBUpper Coloured("Green"),BBLower Coloured("Red")
    

    Scherm­afbeelding-2023-05-21-om-09.04.16.png Scherm­afbeelding-2023-05-21-om-09.04.16.png Scherm­afbeelding-2023-05-21-om-09.03.47.png Scherm­afbeelding-2023-05-21-om-09.03.47.png
    #214970 quote
    supertiti
    Participant
    Master
    Merci JS pour cet ajustement, est-ce que Nicolas qui est à l’origine du code pourrait donner son avis, l’indicateur tel quel ayant abandonné ses “plats” pouvant donner lieu de support ou résistance. Bon dimanche
    #214994 quote
    Nicolas
    Keymaster
    Master
    Merci à JS ! Voici ma version, ajouter ces lignes juste avant RETURN :
    if close<bbupper and close>bblower then 
     r=168
     g=168
     b=168
    endif
    #215008 quote
    supertiti
    Participant
    Master
    Super ! merci à vous deux, je joins une image du résultat sur Air Liquide comme exemple. dommage que l’on ai plus les plats comme dans le code original de Nicolas. Bonne journée et bons trades à tous.
    Followline-V2.jpg Followline-V2.jpg
    #215047 quote
    Nicolas
    Keymaster
    Master
    Si tu utilises la version originale de l’indicateur, alors ça ne changera que la couleur et pas la forme de la courbe.
    #215051 quote
    supertiti
    Participant
    Master
    merci pour l’info, j’y vais de ce pas… bonne journée
    #215054 quote
    supertiti
    Participant
    Master
    Après vérification c’est exactement ce que je souhaitais. merci beaucoup à vous deux. Bons trades
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

FOLLOWLINE INDICATOR neutre


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
supertiti @supertiti Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/17/2023
Status: Active
Attachments: 6 files
Logo Logo
Loading...