Screener NonLagMA Colored

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #159768 quote
    PRC_2021
    Participant
    Average

    Bonjour Nicolas,

    Serait il possible de convertir l’indicateur “NonLagMA Colored” en screnner détectant le passage du jaune au vert.

    Pour rappel, voici le lien et le code de l’indicateur en question :

    NonLagMA Colored

    Merci par avance.

    Manu

    //PRC_NonLagDot Colored | indicator
    //16.12.2020
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //Converted from MT4 version
    
    // --- parameters
    Length        = 10
    Filter        = 0
    Deviation     = 0
    Color = 1 //1=true ; 0=false
    ColorBarBack = 0
    // ---
    
    Price         = customclose
    cCycle= 4
    if barindex>Length then
    pi=3.1415926535
    Coeff= 3*pi
    Phase=Length-1
    Len=Length*cCycle + Phase
    
    Weight=0
    Sum=0
    t=0
    
    for i =0 to Len-1 do
    g=1.0/(Coeff*t+1)
    if (t<=0.5) then
    g=1
    endif
    beta=Cos(pi*t)
    alfa=g * beta
    pprice = price[i]
    Sum=Sum+(alfa*pprice)
    Weight=Weight+alfa
    if(t < 1) then
    t=t+(1.0/(Phase-1))
    elsif (t < Len-1)then
    t=t+((2*cCycle-1)/(cCycle*Length-1))
    endif
    next
    
    if (Weight > 0)  then
    MABuffer=(1.0+Deviation/100)*Sum/Weight
    endif
    if (Filter>0) then
    if(Abs(MABuffer-MABuffer[1]) < Filter*Pointsize) then
    MABuffer=MABuffer[1]
    endif
    endif
    if Color then 
    if (MABuffer[0]-MABuffer[1] > Filter*Pointsize) then 
    trend= 1
    endif
    if (MABuffer[1]-MABuffer[0] > Filter*Pointsize) then 
    trend=-1
    endif
    
    trendmod=trend<>trend[1]
    if trend>0 then 
    r=0
    g=255
    elsif trend<0 then 
    r=255
    g=0
    endif
    if trendmod then 
    r=255
    g=255
    endif
    endif 
    endif
    
    return MABuffer coloured(r,g,0) style(line,2)
    #159773 quote
    Nicolas
    Keymaster
    Master

    Ci-dessous le screener qui détecte le passage du jaune au vert. Remarque: la détection se fait sur la bougie courante, donc le vert ne sera pas visible avant la fin de la bougie.

    //PRC_NonLagDot Colored | screener
    //29.01.2021
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- parameters
    Length        = 10
    Filter        = 0
    Deviation     = 0
    // ---
    
    Price         = close
    cCycle= 4
    if barindex>Length then
    pi=3.1415926535
    Coeff= 3*pi
    Phase=Length-1
    Len=Length*cCycle + Phase
    
    Weight=0
    Sum=0
    t=0
    
    for i =0 to Len-1 do
    g=1.0/(Coeff*t+1)
    if (t<=0.5) then
    g=1
    endif
    beta=Cos(pi*t)
    alfa=g * beta
    pprice = price[i]
    Sum=Sum+(alfa*pprice)
    Weight=Weight+alfa
    if(t < 1) then
    t=t+(1.0/(Phase-1))
    elsif (t < Len-1)then
    t=t+((2*cCycle-1)/(cCycle*Length-1))
    endif
    next
    
    if (Weight > 0)  then
    MABuffer=(1.0+Deviation/100)*Sum/Weight
    endif
    if (Filter>0) then
    if(Abs(MABuffer-MABuffer[1]) < Filter*Pointsize) then
    MABuffer=MABuffer[1]
    endif
    endif
    
    if (MABuffer[0]-MABuffer[1] > Filter*Pointsize) then
    trend= 1
    endif
    if (MABuffer[1]-MABuffer[0] > Filter*Pointsize) then
    trend=-1
    endif
    
    trendmod=trend<>trend[1]
    //if trend>0 then
    //r=0
    //g=255
    //elsif trend<0 then
    //r=255
    //g=0
    //endif
    //if trendmod then
    //r=255
    //g=255
    //endif
    
    
    endif
    test = trend>0 and trendmod[1]=1
    
    screener[test]
    PRC_2021 thanked this post
    #159978 quote
    PRC_2021
    Participant
    Average

    Super Merci Nicolas 🙂

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

Screener NonLagMA Colored


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
PRC_2021 @manu35250 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by PRC_2021
5 years, 1 month ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 01/29/2021
Status: Active
Attachments: No files
Logo Logo
Loading...