| 1 | <?php |
||
| 10 | class HilbertTransformTrendVersusCycleModeIndicator implements Indicator |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Invoke the indicator. |
||
| 14 | * |
||
| 15 | * @param Collection $ohlcv |
||
| 16 | * @param bool $numPeriods |
||
| 17 | * |
||
| 18 | * @return int |
||
| 19 | * |
||
| 20 | * @throws Throwable |
||
| 21 | */ |
||
| 22 | public function __invoke(Collection $ohlcv, bool $numPeriods = false): int |
||
| 57 | } |
||
| 58 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: