Incorrect ENGULFING ?

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

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    NicolasNicolas
    Keymaster
    Legend

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    NicolasNicolas
    Keymaster
    Legend

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    At present I can’t find other incorrect pairs.

    Thank you Nicolas!

    #65991 quote
    robertogozzirobertogozzi
    Moderator
    Legend

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

    xEngulfing-H4-1.jpg xEngulfing-H4-1.jpg
    #65993 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Now another one, AudUsd, h4.

    xEngulfing-H4-2.jpg xEngulfing-H4-2.jpg
    #66052 quote
    NicolasNicolas
    Keymaster
    Legend

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    Thank you Nicolas, I appreciated!

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Incorrect ENGULFING ?


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 9 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
8 years, 6 months ago.

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