Incorrect ENGULFING ?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #65284 quote
    robertogozzi
    Moderator
    Master

    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.

    x-1.jpg x-1.jpg
    #65916 quote
    robertogozzi
    Moderator
    Master

    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.

    xEngulfing-H4.jpg xEngulfing-H4.jpg
    #65954 quote
    Nicolas
    Keymaster
    Master

    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..).

    #65957 quote
    robertogozzi
    Moderator
    Master

    Yes, I just found Eur/Mxn, h4. It’s not an engulfing pattern!

    xEngulfing-H4-predefined-list.jpg xEngulfing-H4-predefined-list.jpg
    #65966 quote
    Nicolas
    Keymaster
    Master

    These are all I found in “currencies” list, 4 hours timeframe. All goods for me. No EUR/MXN. I’m with PRT-CFD.

    robertogozzi thanked this post
    engulfing-pattern-screener.png engulfing-pattern-screener.png
    #65974 quote
    robertogozzi
    Moderator
    Master

    At present I can’t find other incorrect pairs.

    Thank you Nicolas!

    #65991 quote
    robertogozzi
    Moderator
    Master

    Sorry Nicolas, I just found another pair, NzdJpy, h4.

    xEngulfing-H4-1.jpg xEngulfing-H4-1.jpg
    #65993 quote
    robertogozzi
    Moderator
    Master

    Now another one, AudUsd, h4.

    xEngulfing-H4-2.jpg xEngulfing-H4-2.jpg
    #66052 quote
    Nicolas
    Keymaster
    Master

    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 …

    robertogozzi thanked this post
    #66067 quote
    robertogozzi
    Moderator
    Master

    Thank you Nicolas, I appreciated!

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

Incorrect ENGULFING ?


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 9 replies,
has 2 voices, and was last updated by robertogozzi
7 years, 12 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/14/2018
Status: Active
Attachments: 6 files
Logo Logo
Loading...