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?