PRC MACD Screener

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #248392 quote
    segie
    Participant
    Senior

    Hi,

    Please help me with a screener for the code below. For a bull cross over.

    Regards,
    Segie

    //PRC_MACD Platinum | indicator
    //29.09.2016
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    //short = 12
    //long = 26
    //signal = 9
    // --- end of settings
    
    EMAshort1 = exponentialaverage[short](close)
    EMAshort2 = exponentialaverage[short](EMAshort1)
    DifferenceShort = EMAshort1 - EMAshort2
    ZeroLagShort = EMAshort1 + DifferenceShort
    
    EMAlong1 = exponentialaverage[long](close)
    EMAlong2 = exponentialaverage[long](EMAlong1)
    DifferenceLong = EMAlong1 - EMAlong2
    ZeroLagLong = EMAlong1 + DifferenceLong
    
    ZeroLagMACD = ZeroLagShort - ZeroLagLong
    
    signal1=ExponentialAverage[signal](ZEROLAGMACD)
    signal2=ExponentialAverage[signal](signal1)
    DIFFERENCE2=signal1-signal2
    
    SignalMACD=signal1+DIFFERENCE2
    
    if signalMACD>=zerolagMACD then
    r=255
    g=69
    b=0
    else
    r=54
    g=224
    b=208
    endif
    
    drawbarchart(signalMACD,zerolagMACD,signalMACD,zerolagMACD) coloured(r,g,b)
    
    if zerolagMACD crosses over signalMACD or zerolagMACD crosses under signalMACD then
    drawtext("●",barindex,signalMACD,Dialog,Bold,12) coloured(r,g,b)
    endif
    
    
    RETURN ZeroLagMACD coloured(54,224,208) style(dottedline,1 ) as "Zero Lag MACD", SignalMACD coloured(255,69,0) style(line,2) as "Signal MACD", 0 coloured(100,100,100) as "zero line"
    
    #248396 quote
    jacquesgermain
    Participant
    Senior

    Hello

    with screener [flag=1](flag as “flag”) for  bullish , change to screener [flag=2](flag as “flag”) if you want bearish :

    // — settings
    short = 12
    long = 26
    signal = 9
    // — end of settings
    EMAshort1 = exponentialaverage[short](close)
    EMAshort2 = exponentialaverage[short](EMAshort1)
    DifferenceShort = EMAshort1 – EMAshort2
    ZeroLagShort = EMAshort1 + DifferenceShort
    flag=0

    EMAlong1 = exponentialaverage[long](close)
    EMAlong2 = exponentialaverage[long](EMAlong1)
    DifferenceLong = EMAlong1 – EMAlong2
    ZeroLagLong = EMAlong1 + DifferenceLong

    ZeroLagMACD = ZeroLagShort – ZeroLagLong

    signal1=ExponentialAverage[signal](ZEROLAGMACD)
    signal2=ExponentialAverage[signal](signal1)
    DIFFERENCE2=signal1-signal2
    SignalMACD=signal1+DIFFERENCE2
    if zerolagMACD crosses over signalMACD then
    flag=1
    endif
    if zerolagMACD crosses under signalMACD then
    flag=2
    endif

    screener [flag=1](flag as “flag”)

    Iván González, robertogozzi and segie thanked this post
    #248412 quote
    segie
    Participant
    Senior

    Thank you. How can I add these conditions as well:

    C2=Close < MA20 (price trading below 20 day simple moving average) C3= close>=0.5 and close<=6 (price value between 0.5 and 6)

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

PRC MACD Screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
segie @segie Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by segie
8 months, 2 weeks ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/19/2025
Status: Active
Attachments: No files
Logo Logo
Loading...