php / doc-en

English PHP documentation
482 stars 722 forks source link

trader_cdlengulfing() always returning false #3159

Open pandglobal opened 7 months ago

pandglobal commented 7 months ago

From manual page: https://php.net/function.trader-cdlengulfing


This trader_cdlengulfing() needs to be updated as it returns false always, even when an engulfing pattern was submitted to it yet it returns false. same thing with most of trader candle sticks pattern detecting function. Example: // Previous candle (1st) $prev_open = 25; $prev_high = 30; $prev_low = 20; $prev_close = 22;

// Current candle (2nd) $current_open = 18; $current_high = 48; $current_low = 15; $current_close = 40;

$open = array($prev_open, $current_open); $high = array($prev_high, $current_high); $low = array($prev_low, $current_low); $close = array($prev_close, $current_close);

$engulfing = trader_cdlengulfing($open, $high, $low, $close); var_dump($engulfing);

damianwadley commented 7 months ago

According to the source, it returns false on failure but will otherwise return an array. Are you sure you're using the function correctly? Any errors reported by trader_errno?

pandglobal commented 7 months ago

no errors, just var_dump return boolen false, and if the array is more than 2 it returns an arrays of empty values instead of boolen. Also look at the previous candle data and current candle data i provided and also my usage of the function is correct but the results is always false