I want to call the function xxx() and execute getCdl(). In getCdl() function i want to call the method dynamically. But this gives an error Call to undefined function trader_cdl2crows. But when i execute trader_cdl2crows() directly it works.
How can achieve this? :)
Functions:
public function xxx(){
$cdls = [
'trader_cdl2crows',
'trader_cdl3blackcrows',
'trader_cdl3inside',
'trader_cdl3linestrike',
etc,etc,etc
$result = [];
foreach ($cdls as $cdl) {
$result[$cdl] = $this->getCdl($cdl,$ticksPerType);
}
vardump($result);
}
private function getCdl($method,$ticksPerType){
return $method(
$ticksPerType[$this->ticks::TICK_TYPE_OPEN],
$ticksPerType[$this->ticks::TICK_TYPE_HIGH],
$ticksPerType[$this->ticks::TICK_TYPE_LOW],
$ticksPerType[$this->ticks::TICK_TYPE_CLOSE]
);
}
trader_cdl2crowsa function, or is it a method of your class? (same for others)_andc.