3 registered members (Ayumi, Akow, monk12),
1,413
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
CDLEngulfing() what does it return?
#431691
10/22/13 16:54
10/22/13 16:54
|
Joined: May 2013
Posts: 245
swingtraderkk
OP
Member
|
OP
Member
Joined: May 2013
Posts: 245
|
Hi all, What exactly does CDLEngulfing() return? I've been playing with this and can't make sense of the returns. The manual says: "The CDL functions return a value of -100% for bearish patterns, +100% for bullish patterns, and 0 for no pattern match. They use the current asset price series." I expected then that bullish engulfing candles would return either 1 or 100, & bearish engulfing would return -1 or -100 but that does not appear to be the case.
function run()
{
BarPeriod = 30;
vars cl = series(priceClose());
vars ema = series(EMA(cl,67));
vars sma = series(SMA(cl,13));
if ((sma[0]>ema[0]) and (CDLEngulfing() == 100)) reverseLong(1);
if ((sma[0]<ema[0]) and (CDLEngulfing() == -100)) reverseShort(1);
plot("EMA",ema[0],0,GREEN);
plot("SMA",sma[0],0,ORANGE);
plot("CDL",CDLEngulfing(),NEW,BLUE);
}
How do the cdl functions work? should they return a % similarity to the patterns or simply a 100%, -100%, 0?
|
|
|
Re: CDLEngulfing() what does it return?
[Re: jcl]
#431697
10/22/13 17:16
10/22/13 17:16
|
Joined: May 2013
Posts: 245
swingtraderkk
OP
Member
|
OP
Member
Joined: May 2013
Posts: 245
|
Engulfing candle patterns can be either bullish or bearish. The bullish engulfing candlestick is a well-known candle pattern composed of two candle lines. The first one is black and the second is a white one that is taller than the prior black candle, engulfing it or overlapping the black candle’s body. from Thomas Bulkowski's pattern site: http://thepatternsite.com/BullEngulfing.html Opposite for Bearish engulfing. The manual then needs to be amended to indicate whether the CDLEngulfing is either for bullish or bearish patterns. CDLEngulfing(): int Engulfing Pattern. Bullish + Bearish. I also suspect that it is not returning correct values even assuming it is only returning bearish patterns. If you run the script and look at the plot, there are significant periods where it returns 100s and periods where it returns only 0.
Last edited by swingtraderkk; 10/22/13 17:17. Reason: quote from manual
|
|
|
|