Hi Guys
I have an issue with the code below in that for the Engulfing and Outside bars the screener is displaying results a week late? Ie it searches for a price action signal but doesn’t display the most current weekly candle, but the one prior? Yet when I use the same code in a standalone screener (ie just engulfing and outside bars) it reports the correct, latest bar in the results? Any help would be apricated as I use this scanner each weekend on the UK shares universe!
//Bullish/Bearish Candle Detector
//Detection of Hammer / Shooting Star
Hammer = (((high - low)>3*(open -close)) and ((close - low)/(.001 + high - low) > 0.6) and ((open - low)/(.001 + high - low) > 0.6))
Shooter = (open[1] < close[1] and open > close[1] and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close))
//shooter wick
Indy6 = (close = highest[10](high[0]))
//Hammer Wick
Indy7 = (close = lowest[10](low[0]))
//detect BUOB
BUOB =((close[1] < open[1]) and (open[0] < low [1]) AND (close > open[1]) and (close [0] > high [1])and (close > open))
//detect BEOB
BEOB =((close[1] > open [1]) and (close[0] < low [1]) AND (open[0] > high[1]) and (close [0] < low [1]) and (close < open))
//detect BEEB
BEEB = ((close[1] > open [1]) and (open[0] >=close [1]) and (close[0] < open [1]) and (close < open))
//detect BUEB
BUEB = ((close[1] < open[1]) and (open <= close[1]) and (close > open[1]) and (close > open))
C1 = BUOB
C1a = BUEB
C2 = BEOB
C2a = BEEB
C3a= Hammer
C3b= Shooter
//Detection of IB Bull
IBBull = (open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] )
//Detection of Bear IB
IBBear = (close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] )
// Close greater or less than 10 ema
MAH = (close < exponentialaverage[10])
MAL = (close > exponentialaverage[10])
///Screener for Price Action
Screener [c1 and MAL]((close/DClose(1)-1)*100 AS "%VAR" )//detect BUOB
Screener [c1a and MAL]((close/DClose(1)-1)*100 AS "%VAR" )//detect BUEB
Screener [c2 and MAH]((close/DClose(1)-1)*100 AS "%VAR" )//detect BEOB
Screener [c2a and MAH]((close/DClose(1)-1)*100 AS "%VAR" )//detect BEEB
Screener [c3a and MAL and Indy7]((close/DClose(1)-1)*100 AS "%VAR" )//detect Hammer
Screener [c3b and MAH and Indy6]((close/DClose(1)-1)*100 AS "%VAR" )//detect Shooter
screener [IBBull]((close/DClose(1)-1)*100 AS "%VAR" )//detect Inside Bar with bull trend
screener [IBBear]((close/DClose(1)-1)*100 AS "%VAR" )// detect IB with bear trend
And yet here is the standalone screener?
//detect BUOB
BUOB =((close[1] < open[1]) and (open[0] < low [1]) AND (close > open[1]) and (close [0] > high [1])and (close > open))
//detect BEOB
BEOB =((close[1] > open [1]) and (close[0] < low [1]) AND (open[0] > high[1]) and (close [0] < low [1]) and (close < open))
//detect BEEB
BEEB = ((close[1] > open [1]) and (open[0] >=close [1]) and (close[0] < open [1]) and (close < open))
//detect BUEB
BUEB = ((close[1] < open[1]) and (open <= close[1]) and (close > open[1]) and (close > open))
MA1 = exponentialaverage[10](close)
C1 = close > MA1
C2 = Close < MA1
Screener [BUOB and C1]
Screener [BEOB and C2]
Screener [BEEB and C2]
Screener [BUEB and C1]
All I did was copy the above code into the main price action screener?
Many thanks in anticipation of help!
Do you have end-of-day-data?
If yes, then on the weekly TF you’ll have data updated when each weekly candlestick closes, while for daily TF when a daily candlestick closes.
Hi Robert
Yes, I’m using end of day data as I trade shares on a weekly basis. I couldn’t understand why one scanner showed the most previous week’s candles and the other two weeks prior, yet both scanners as using the same code as far as I can see??
Why are you using all those SCREENER instructions at the end, just one is allowed.
I’m afraid the last one overrides the previous three.
Code is read from top to bottom, so only the last screener instruction will be used by ProScreener.
If you have only EOD data, on a weekly chart, all results are delayed of one week.
Robert – thanks so much!! That solved the issue. All these years using ‘screener’ and I didn’t one you should only have one screener line command per script. That totally explains why it was never working properly! Thanks again!
I have replaced all the screener lines with one command line that seems to work much better:
Screener [(c1 and c5) or (c2 and c6) or (c3a and C5 and Indy7) or (c3b and c6 and Indy6) or (DCC and Indy6) or (PL and Indy7) or (IBBull and C5) or (IBBear and C6) ]((close/DClose(1)-1)*100 AS "%VAR" )