I am having troubles with my proscreener to detect engulfing patterns on a Daily chart (I did not test other TFs, so far).
ProScreener sometimes reports incorrect results.
This is my code:
ONCE BodySize = 10 * pipsize //Body is required to be at least 10 pips large
Engulf = 0 //Variable used for criterion
Body = abs(open - close) //This is the BODY of the candle
Bearish = open > close //BEARish candle
Bullish = open < close //BULLish candle
IF Bearish[1] THEN //Previous candle was BEARish
IF open <= close[1] AND close >= open[1] AND Bullish THEN // this candle's Open must be <= previous Close AND Close >= previous Open AND must be Bullish
Engulf = (Body > Body[1]) AND (Body >= BodySize) // this candle's Body > than previous one AND >= desired size
ENDIF
ELSIF Bullish[1] THEN //Previous candle was BULLish
IF open >= close[1] AND close <= open[1] AND Bearish THEN // this candle's Open must be >= previous Close AND Close <= previous Open AND must be Bearish
Engulf = (Body > Body[1]) AND (Body >= BodySize) // this candle's Body > than previous one AND >= desired size
ENDIF
ENDIF
SCREENER[Engulf]
I tried so many time to study my code, but can’t find any logic error. An engulfing pattern must have a greater body, no gaps (unless they are part of the engulfing itself) and going the other way round.
I attach a screensot of current Aud/Jpy daily chart.
I also tested it on Eur/Cad, h4, still working incorrectly.
Oddly enough, most of the times it works finely on Daily, h4 and h1 TFs. Can’t figure out what may cause this behaviour occasionally.
I tried to remove ONCE in line 1, but the output doesn’t change.
Have no results in Forex pairs right now, but all good ones on the Euronext shares list though, daily timeframe. I do not see any problem in your code. Do the problem exist on ‘predefined list’ too? I see you are using personalized ones.. (just in case..).
Yes, I just found Eur/Mxn, h4. It’s not an engulfing pattern!
These are all I found in “currencies” list, 4 hours timeframe. All goods for me. No EUR/MXN. I’m with PRT-CFD.
At present I can’t find other incorrect pairs.
Thank you Nicolas!
Sorry Nicolas, I just found another pair, NzdJpy, h4.
Now another one, AudUsd, h4.
Since I can’t replicate the problem with my own personal account @ PRT-CFD, I suggest:
_ compare every variable value with the one on the chart by using the sorting criteria : SCREENER [engulfing] (myvariable)
_ open a new support ticket …
Thank you Nicolas, I appreciated!