PRC MACD screener with conditions
Forums › ProRealTime English forum › ProScreener support › PRC MACD screener with conditions
- This topic has 3 replies, 3 voices, and was last updated 23 hours ago by
segie.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
06/20/2025 at 3:10 PM #248455PRC MACD SCREENER123456789101112131415161718192021222324252627282930// — settingsshort = 12long = 26signal = 9// — end of settingsEMAshort1 = exponentialaverage[short](close)EMAshort2 = exponentialaverage[short](EMAshort1)DifferenceShort = EMAshort1 – EMAshort2ZeroLagShort = EMAshort1 + DifferenceShortflag=0EMAlong1 = exponentialaverage[long](close)EMAlong2 = exponentialaverage[long](EMAlong1)DifferenceLong = EMAlong1 – EMAlong2ZeroLagLong = EMAlong1 + DifferenceLongZeroLagMACD = ZeroLagShort – ZeroLagLongsignal1=ExponentialAverage[signal](ZEROLAGMACD)signal2=ExponentialAverage[signal](signal1)DIFFERENCE2=signal1-signal2SignalMACD=signal1+DIFFERENCE2if zerolagMACD crosses over signalMACD thenflag=1endifif zerolagMACD crosses under signalMACD thenflag=2endifscreener [flag=1](flag as “flag”)
Hi,
How can I add these conditions to the attached screener:
1. Trading under 20 day simple moving average
2. Price rang between 1 and 20
Regards,
Segie
06/20/2025 at 3:42 PM #248456Try this one, not tested as at least one variable is missing:
12345678910111213141516171819202122232425262728293031323334// — settingsshort = 12long = 26signal = 9// — end of settingsEMAshort1 = exponentialaverage[short](close)EMAshort2 = exponentialaverage[short](EMAshort1)DifferenceShort = EMAshort1 - EMAshort2ZeroLagShort = EMAshort1 + DifferenceShortflag=0EMAlong1 = exponentialaverage[long](close)EMAlong2 = exponentialaverage[long](EMAlong1)DifferenceLong = EMAlong1 - EMAlong2ZeroLagLong = EMAlong1 + DifferenceLongZeroLagMACD = ZeroLagShort - ZeroLagLongsignal1=ExponentialAverage[signal](ZEROLAGMACD)signal2=ExponentialAverage[signal](signal1)DIFFERENCE2=signal1-signal2L1 = zerolagMACD crosses over signalMACDL2 = close > average[20,0](close)S1 = zerolagMACD crosses under signalMACDS2 = close < average[20,0](close)C1 = (close >= 1) AND (close <= 20)if L1 AND L2 AND C1 thenflag=1endifif S1 AND S2 AND C1 thenflag=2endifscreener [flag=1](flag as "flag")if you also want to get short signals, simply remove “=1” from the last line.
1 user thanked author for this post.
06/20/2025 at 3:43 PM #248457here you have the code:
12345678910111213141516171819202122232425262728293031323334353637// — settingsshort = 12long = 26signal = 9// — end of settingsEMAshort1 = exponentialaverage[short](close)EMAshort2 = exponentialaverage[short](EMAshort1)DifferenceShort = EMAshort1 - EMAshort2ZeroLagShort = EMAshort1 + DifferenceShortflag=0EMAlong1 = exponentialaverage[long](close)EMAlong2 = exponentialaverage[long](EMAlong1)DifferenceLong = EMAlong1 - EMAlong2ZeroLagLong = EMAlong1 + DifferenceLongZeroLagMACD = ZeroLagShort - ZeroLagLongsignal1=ExponentialAverage[signal](ZEROLAGMACD)signal2=ExponentialAverage[signal](signal1)DIFFERENCE2=signal1-signal2SignalMACD=signal1+DIFFERENCE2if zerolagMACD crosses over signalMACD thenflag=1endifif zerolagMACD crosses under signalMACD thenflag=2endif// Trading under SMA20sma20 = average[20](close)TradingUnderSma = close<sma20// Price between 1-20PriceRang = close>=1 and close<=20screener [flag=1 and TradingUnderSma and PriceRang](flag as "flag")2 users thanked author for this post.
06/21/2025 at 6:31 PM #248482 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: