Complex classes like Trader often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Trader, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 15 | class Trader implements TraderContract |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The error messages. |
||
| 19 | * |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected static $errors = [ |
||
| 23 | self::ERR_LIB_NOT_INITIALIZE => 'Library not initialized', |
||
| 24 | self::ERR_BAD_PARAM => 'Bad parameter', |
||
| 25 | self::ERR_ALLOC_ERR => 'Allocation error', |
||
| 26 | self::ERR_GROUP_NOT_FOUND => 'Group not found', |
||
| 27 | self::ERR_FUNC_NOT_FOUND => 'Function not found', |
||
| 28 | self::ERR_INVALID_HANDLE => 'Invalid handle', |
||
| 29 | self::ERR_INVALID_PARAM_HOLDER => 'Invalid parameter holder', |
||
| 30 | self::ERR_INVALID_PARAM_HOLDER_TYPE => 'Invalid parameter holder type', |
||
| 31 | self::ERR_INVALID_PARAM_FUNCTION => 'Invalid parameter function', |
||
| 32 | self::ERR_INPUT_NOT_ALL_INITIALIZE => 'Input not all initialized', |
||
| 33 | self::ERR_OUTPUT_NOT_ALL_INITIALIZE => 'Output not all initialized', |
||
| 34 | self::ERR_OUT_OF_RANGE_START_INDEX => 'Out of range on start index', |
||
| 35 | self::ERR_OUT_OF_RANGE_END_INDEX => 'Out of range on end index', |
||
| 36 | self::ERR_INVALID_LIST_TYPE => 'Invalid list type', |
||
| 37 | self::ERR_BAD_OBJECT => 'Bad object', |
||
| 38 | self::ERR_NOT_SUPPORTED => 'Not supported', |
||
| 39 | self::ERR_INTERNAL_ERROR => 'Internal error', |
||
| 40 | self::ERR_UNKNOWN_ERROR => 'Unknown error', |
||
| 41 | ]; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Vector Trigonometric ACos. |
||
| 45 | * |
||
| 46 | * Calculates the arc cosine for each value in real and returns the resulting array. |
||
| 47 | * |
||
| 48 | * @param array $real Array of real values. |
||
| 49 | * |
||
| 50 | * @return array Returns an array with calculated data. |
||
| 51 | */ |
||
| 52 | 2 | public function acos(array $real): array |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Chaikin A/D Line. |
||
| 63 | * |
||
| 64 | * @param array $high High price, array of real values. |
||
| 65 | * @param array $low Low price, array of real values. |
||
| 66 | * @param array $close Closing price, array of real values. |
||
| 67 | * @param array $volume Volume traded, array of real values. |
||
| 68 | * |
||
| 69 | * @return array Returns an array with calculated data. |
||
| 70 | */ |
||
| 71 | 2 | public function ad(array $high, array $low, array $close, array $volume): array |
|
| 79 | |||
| 80 | /** |
||
| 81 | * Vector Arithmetic Add. |
||
| 82 | * |
||
| 83 | * Calculates the vector addition of real0 to real1 and returns the resulting vector. |
||
| 84 | * |
||
| 85 | * @param array $real0 Array of real values. |
||
| 86 | * @param array $real1 Array of real values. |
||
| 87 | * |
||
| 88 | * @return array Returns an array with calculated data. |
||
| 89 | */ |
||
| 90 | 2 | public function add(array $real0, array $real1): array |
|
| 98 | |||
| 99 | /** |
||
| 100 | * Chaikin A/D Oscillator. |
||
| 101 | * |
||
| 102 | * @param array $high High price, array of real values. |
||
| 103 | * @param array $low Low price, array of real values. |
||
| 104 | * @param array $close Closing price, array of real values. |
||
| 105 | * @param array $volume Volume traded, array of real values. |
||
| 106 | * @param int $fastPeriod Number of period for the fast MA. Valid range from 2 to 100000. |
||
| 107 | * @param int $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. |
||
| 108 | * |
||
| 109 | * @return array Returns an array with calculated data. |
||
| 110 | */ |
||
| 111 | 2 | public function adosc( |
|
| 125 | |||
| 126 | /** |
||
| 127 | * Average Directional Movement Index. |
||
| 128 | * |
||
| 129 | * @param array $high High price, array of real values. |
||
| 130 | * @param array $low Low price, array of real values. |
||
| 131 | * @param array $close Closing price, array of real values. |
||
| 132 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 133 | * |
||
| 134 | * @return array Returns an array with calculated data. |
||
| 135 | */ |
||
| 136 | 2 | public function adx(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 144 | |||
| 145 | /** |
||
| 146 | * Average Directional Movement Index Rating. |
||
| 147 | * |
||
| 148 | * @param array $high High price, array of real values. |
||
| 149 | * @param array $low Low price, array of real values. |
||
| 150 | * @param array $close Closing price, array of real values. |
||
| 151 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 152 | * |
||
| 153 | * @return array Returns an array with calculated data. |
||
| 154 | */ |
||
| 155 | 2 | public function adxr(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 163 | |||
| 164 | /** |
||
| 165 | * Absolute Price Oscillator. |
||
| 166 | * |
||
| 167 | * @param array $real Array of real values. |
||
| 168 | * @param int $fastPeriod Number of period for the fast MA. Valid range from 2 to 100000. |
||
| 169 | * @param int $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. |
||
| 170 | * @param int $mAType Type of Moving Average. MA_TYPE_* series of constants should be used. |
||
| 171 | * |
||
| 172 | * @return array Returns an array with calculated data. |
||
| 173 | */ |
||
| 174 | 2 | public function apo(array $real, int $fastPeriod = 12, int $slowPeriod = 26, int $mAType = 0): array |
|
| 182 | |||
| 183 | /** |
||
| 184 | * Aroon. |
||
| 185 | * |
||
| 186 | * @param array $high High price, array of real values. |
||
| 187 | * @param array $low Low price, array of real values. |
||
| 188 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 189 | * |
||
| 190 | * @return array Returns an array with calculated data. |
||
| 191 | */ |
||
| 192 | 2 | public function aroon(array $high, array $low, int $timePeriod = 14): array |
|
| 200 | |||
| 201 | /** |
||
| 202 | * Aroon Oscillator. |
||
| 203 | * |
||
| 204 | * @param array $high High price, array of real values. |
||
| 205 | * @param array $low Low price, array of real values. |
||
| 206 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 207 | * |
||
| 208 | * @return array Returns an array with calculated data. |
||
| 209 | */ |
||
| 210 | 2 | public function aroonosc(array $high, array $low, int $timePeriod = 14): array |
|
| 218 | |||
| 219 | /** |
||
| 220 | * Vector Trigonometric ASin. |
||
| 221 | * |
||
| 222 | * @param array $real Array of real values. |
||
| 223 | * |
||
| 224 | * @return array Returns an array with calculated data. |
||
| 225 | */ |
||
| 226 | 2 | public function asin(array $real): array |
|
| 234 | |||
| 235 | /** |
||
| 236 | * Vector Trigonometric ATan. |
||
| 237 | * |
||
| 238 | * @param array $real Array of real values. |
||
| 239 | * |
||
| 240 | * @return array Returns an array with calculated data. |
||
| 241 | */ |
||
| 242 | 2 | public function atan(array $real): array |
|
| 250 | |||
| 251 | /** |
||
| 252 | * Average True Range. |
||
| 253 | * |
||
| 254 | * @param array $high High price, array of real values. |
||
| 255 | * @param array $low Low price, array of real values. |
||
| 256 | * @param array $close Closing price, array of real values. |
||
| 257 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 258 | * |
||
| 259 | * @return array Returns an array with calculated data. |
||
| 260 | */ |
||
| 261 | 2 | public function atr(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 269 | |||
| 270 | /** |
||
| 271 | * Average Price. |
||
| 272 | * |
||
| 273 | * @param array $open Opening price, array of real values. |
||
| 274 | * @param array $high High price, array of real values. |
||
| 275 | * @param array $low Low price, array of real values. |
||
| 276 | * @param array $close Closing price, array of real values. |
||
| 277 | * |
||
| 278 | * @return array Returns an array with calculated data. |
||
| 279 | */ |
||
| 280 | 2 | public function avgprice(array $open, array $high, array $low, array $close): array |
|
| 288 | |||
| 289 | /** |
||
| 290 | * Bollinger Bands. |
||
| 291 | * |
||
| 292 | * @param array $real Array of real values. |
||
| 293 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 294 | * @param float $nbDevUp Deviation multiplier for upper band. Valid range from REAL_MIN to REAL_MAX. |
||
| 295 | * @param float $nbDevDn Deviation multiplier for lower band. Valid range from REAL_MIN to REAL_MAX. |
||
| 296 | * @param int $mAType Type of Moving Average. MA_TYPE_* series of constants should be used. |
||
| 297 | * |
||
| 298 | * @return array Returns an array with calculated data. |
||
| 299 | */ |
||
| 300 | 2 | public function bbands( |
|
| 313 | |||
| 314 | /** |
||
| 315 | * Beta. |
||
| 316 | * |
||
| 317 | * @param array $real0 Array of real values. |
||
| 318 | * @param array $real1 Array of real values. |
||
| 319 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 320 | * |
||
| 321 | * @return array Returns an array with calculated data. |
||
| 322 | */ |
||
| 323 | 2 | public function beta(array $real0, array $real1, int $timePeriod = 5): array |
|
| 331 | |||
| 332 | /** |
||
| 333 | * Balance Of Power. |
||
| 334 | * |
||
| 335 | * @param array $open Opening price, array of real values. |
||
| 336 | * @param array $high High price, array of real values. |
||
| 337 | * @param array $low Low price, array of real values. |
||
| 338 | * @param array $close Closing price, array of real values. |
||
| 339 | * |
||
| 340 | * @return array Returns an array with calculated data. |
||
| 341 | */ |
||
| 342 | 2 | public function bop(array $open, array $high, array $low, array $close): array |
|
| 350 | |||
| 351 | /** |
||
| 352 | * Commodity Channel Index. |
||
| 353 | * |
||
| 354 | * @param array $high High price, array of real values. |
||
| 355 | * @param array $low Low price, array of real values. |
||
| 356 | * @param array $close Closing price, array of real values. |
||
| 357 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 358 | * |
||
| 359 | * @return array Returns an array with calculated data. |
||
| 360 | */ |
||
| 361 | 2 | public function cci(array $high, array $low, array $close, int $timePeriod = null): array |
|
| 369 | |||
| 370 | /** |
||
| 371 | * Two Crows. |
||
| 372 | * |
||
| 373 | * @param array $open Opening price, array of real values. |
||
| 374 | * @param array $high High price, array of real values. |
||
| 375 | * @param array $low Low price, array of real values. |
||
| 376 | * @param array $close Closing price, array of real values. |
||
| 377 | * |
||
| 378 | * @return array Returns an array with calculated data. |
||
| 379 | */ |
||
| 380 | 2 | public function cdl2crows(array $open, array $high, array $low, array $close): array |
|
| 388 | |||
| 389 | /** |
||
| 390 | * Three Black Crows. |
||
| 391 | * |
||
| 392 | * @param array $open Opening price, array of real values. |
||
| 393 | * @param array $high High price, array of real values. |
||
| 394 | * @param array $low Low price, array of real values. |
||
| 395 | * @param array $close Closing price, array of real values. |
||
| 396 | * |
||
| 397 | * @return array Returns an array with calculated data. |
||
| 398 | */ |
||
| 399 | 2 | public function cdl3blackcrows(array $open, array $high, array $low, array $close): array |
|
| 407 | |||
| 408 | /** |
||
| 409 | * Three Inside Up/Down. |
||
| 410 | * |
||
| 411 | * @param array $open Opening price, array of real values. |
||
| 412 | * @param array $high High price, array of real values. |
||
| 413 | * @param array $low Low price, array of real values. |
||
| 414 | * @param array $close Closing price, array of real values. |
||
| 415 | * |
||
| 416 | * @return array Returns an array with calculated data. |
||
| 417 | */ |
||
| 418 | 2 | public function cdl3inside(array $open, array $high, array $low, array $close): array |
|
| 426 | |||
| 427 | /** |
||
| 428 | * Three-Line Strike |
||
| 429 | * |
||
| 430 | * @param array $open Opening price, array of real values. |
||
| 431 | * @param array $high High price, array of real values. |
||
| 432 | * @param array $low Low price, array of real values. |
||
| 433 | * @param array $close Closing price, array of real values. |
||
| 434 | * |
||
| 435 | * @return array Returns an array with calculated data. |
||
| 436 | */ |
||
| 437 | 2 | public function cdl3linestrike(array $open, array $high, array $low, array $close): array |
|
| 445 | |||
| 446 | /** |
||
| 447 | * Three Outside Up/Down. |
||
| 448 | * |
||
| 449 | * @param array $open Opening price, array of real values. |
||
| 450 | * @param array $high High price, array of real values. |
||
| 451 | * @param array $low Low price, array of real values. |
||
| 452 | * @param array $close Closing price, array of real values. |
||
| 453 | * |
||
| 454 | * @return array Returns an array with calculated data. |
||
| 455 | */ |
||
| 456 | 2 | public function cdl3outside(array $open, array $high, array $low, array $close): array |
|
| 464 | |||
| 465 | /** |
||
| 466 | * Three Stars In The South. |
||
| 467 | * |
||
| 468 | * @param array $open Opening price, array of real values. |
||
| 469 | * @param array $high High price, array of real values. |
||
| 470 | * @param array $low Low price, array of real values. |
||
| 471 | * @param array $close Closing price, array of real values. |
||
| 472 | * |
||
| 473 | * @return array Returns an array with calculated data. |
||
| 474 | */ |
||
| 475 | 2 | public function cdl3starsinsouth(array $open, array $high, array $low, array $close): array |
|
| 483 | |||
| 484 | /** |
||
| 485 | * Three Advancing White Soldiers. |
||
| 486 | * |
||
| 487 | * @param array $open Opening price, array of real values. |
||
| 488 | * @param array $high High price, array of real values. |
||
| 489 | * @param array $low Low price, array of real values. |
||
| 490 | * @param array $close Closing price, array of real values. |
||
| 491 | * |
||
| 492 | * @return array Returns an array with calculated data. |
||
| 493 | */ |
||
| 494 | 2 | public function cdl3whitesoldiers(array $open, array $high, array $low, array $close): array |
|
| 502 | |||
| 503 | /** |
||
| 504 | * Abandoned Baby. |
||
| 505 | * |
||
| 506 | * @param array $open Opening price, array of real values. |
||
| 507 | * @param array $high High price, array of real values. |
||
| 508 | * @param array $low Low price, array of real values. |
||
| 509 | * @param array $close Closing price, array of real values. |
||
| 510 | * @param float $penetration Percentage of penetration of a candle within another candle. |
||
| 511 | * |
||
| 512 | * @return array Returns an array with calculated data. |
||
| 513 | */ |
||
| 514 | 2 | public function cdlabandonedbaby( |
|
| 527 | |||
| 528 | /** |
||
| 529 | * Advance Block. |
||
| 530 | * |
||
| 531 | * @param array $open Opening price, array of real values. |
||
| 532 | * @param array $high High price, array of real values. |
||
| 533 | * @param array $low Low price, array of real values. |
||
| 534 | * @param array $close Closing price, array of real values. |
||
| 535 | * |
||
| 536 | * @return array Returns an array with calculated data. |
||
| 537 | */ |
||
| 538 | 2 | public function cdladvanceblock(array $open, array $high, array $low, array $close): array |
|
| 546 | |||
| 547 | /** |
||
| 548 | * Belt-hold. |
||
| 549 | * |
||
| 550 | * @param array $open Opening price, array of real values. |
||
| 551 | * @param array $high High price, array of real values. |
||
| 552 | * @param array $low Low price, array of real values. |
||
| 553 | * @param array $close Closing price, array of real values. |
||
| 554 | * |
||
| 555 | * @return array Returns an array with calculated data. |
||
| 556 | */ |
||
| 557 | 2 | public function cdlbelthold(array $open, array $high, array $low, array $close): array |
|
| 565 | |||
| 566 | /** |
||
| 567 | * Breakaway. |
||
| 568 | * |
||
| 569 | * @param array $open Opening price, array of real values. |
||
| 570 | * @param array $high High price, array of real values. |
||
| 571 | * @param array $low Low price, array of real values. |
||
| 572 | * @param array $close Closing price, array of real values. |
||
| 573 | * |
||
| 574 | * @return array Returns an array with calculated data. |
||
| 575 | */ |
||
| 576 | 2 | public function cdlbreakaway(array $open, array $high, array $low, array $close): array |
|
| 584 | |||
| 585 | /** |
||
| 586 | * Closing Marubozu. |
||
| 587 | * |
||
| 588 | * @param array $open Opening price, array of real values. |
||
| 589 | * @param array $high High price, array of real values. |
||
| 590 | * @param array $low Low price, array of real values. |
||
| 591 | * @param array $close Closing price, array of real values. |
||
| 592 | * |
||
| 593 | * @return array Returns an array with calculated data. |
||
| 594 | */ |
||
| 595 | 2 | public function cdlclosingmarubozu(array $open, array $high, array $low, array $close): array |
|
| 603 | |||
| 604 | /** |
||
| 605 | * Concealing Baby Swallow. |
||
| 606 | * |
||
| 607 | * @param array $open Opening price, array of real values. |
||
| 608 | * @param array $high High price, array of real values. |
||
| 609 | * @param array $low Low price, array of real values. |
||
| 610 | * @param array $close Closing price, array of real values. |
||
| 611 | * |
||
| 612 | * @return array Returns an array with calculated data. |
||
| 613 | */ |
||
| 614 | 2 | public function cdlconcealbabyswall(array $open, array $high, array $low, array $close): array |
|
| 622 | |||
| 623 | /** |
||
| 624 | * Counterattack. |
||
| 625 | * |
||
| 626 | * @param array $open Opening price, array of real values. |
||
| 627 | * @param array $high High price, array of real values. |
||
| 628 | * @param array $low Low price, array of real values. |
||
| 629 | * @param array $close Closing price, array of real values. |
||
| 630 | * |
||
| 631 | * @return array Returns an array with calculated data. |
||
| 632 | */ |
||
| 633 | 2 | public function cdlcounterattack(array $open, array $high, array $low, array $close): array |
|
| 641 | |||
| 642 | /** |
||
| 643 | * Dark Cloud Cover. |
||
| 644 | * |
||
| 645 | * @param array $open Opening price, array of real values. |
||
| 646 | * @param array $high High price, array of real values. |
||
| 647 | * @param array $low Low price, array of real values. |
||
| 648 | * @param array $close Closing price, array of real values. |
||
| 649 | * @param float $penetration Percentage of penetration of a candle within another candle. |
||
| 650 | * |
||
| 651 | * @return array Returns an array with calculated data. |
||
| 652 | */ |
||
| 653 | 2 | public function cdldarkcloudcover( |
|
| 666 | |||
| 667 | /** |
||
| 668 | * Doji. |
||
| 669 | * |
||
| 670 | * @param array $open Opening price, array of real values. |
||
| 671 | * @param array $high High price, array of real values. |
||
| 672 | * @param array $low Low price, array of real values. |
||
| 673 | * @param array $close Closing price, array of real values. |
||
| 674 | * |
||
| 675 | * @return array Returns an array with calculated data. |
||
| 676 | */ |
||
| 677 | 2 | public function cdldoji(array $open, array $high, array $low, array $close): array |
|
| 685 | |||
| 686 | /** |
||
| 687 | * Doji Star. |
||
| 688 | * |
||
| 689 | * @param array $open Opening price, array of real values. |
||
| 690 | * @param array $high High price, array of real values. |
||
| 691 | * @param array $low Low price, array of real values. |
||
| 692 | * @param array $close Closing price, array of real values. |
||
| 693 | * |
||
| 694 | * @return array Returns an array with calculated data. |
||
| 695 | */ |
||
| 696 | 2 | public function cdldojistar(array $open, array $high, array $low, array $close): array |
|
| 704 | |||
| 705 | /** |
||
| 706 | * Dragonfly Doji. |
||
| 707 | * |
||
| 708 | * @param array $open Opening price, array of real values. |
||
| 709 | * @param array $high High price, array of real values. |
||
| 710 | * @param array $low Low price, array of real values. |
||
| 711 | * @param array $close Closing price, array of real values. |
||
| 712 | * |
||
| 713 | * @return array Returns an array with calculated data. |
||
| 714 | */ |
||
| 715 | 2 | public function cdldragonflydoji(array $open, array $high, array $low, array $close): array |
|
| 723 | |||
| 724 | /** |
||
| 725 | * Engulfing Pattern. |
||
| 726 | * |
||
| 727 | * @param array $open Opening price, array of real values. |
||
| 728 | * @param array $high High price, array of real values. |
||
| 729 | * @param array $low Low price, array of real values. |
||
| 730 | * @param array $close Closing price, array of real values. |
||
| 731 | * |
||
| 732 | * @return array Returns an array with calculated data. |
||
| 733 | */ |
||
| 734 | 2 | public function cdlengulfing(array $open, array $high, array $low, array $close): array |
|
| 742 | |||
| 743 | /** |
||
| 744 | * Evening Doji Star. |
||
| 745 | * |
||
| 746 | * @param array $open Opening price, array of real values. |
||
| 747 | * @param array $high High price, array of real values. |
||
| 748 | * @param array $low Low price, array of real values. |
||
| 749 | * @param array $close Closing price, array of real values. |
||
| 750 | * @param float $penetration Percentage of penetration of a candle within another candle. |
||
| 751 | * |
||
| 752 | * @return array Returns an array with calculated data. |
||
| 753 | */ |
||
| 754 | 2 | public function cdleveningdojistar( |
|
| 767 | |||
| 768 | /** |
||
| 769 | * Evening Star. |
||
| 770 | * |
||
| 771 | * @param array $open Opening price, array of real values. |
||
| 772 | * @param array $high High price, array of real values. |
||
| 773 | * @param array $low Low price, array of real values. |
||
| 774 | * @param array $close Closing price, array of real values. |
||
| 775 | * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. |
||
| 776 | * |
||
| 777 | * @return array Returns an array with calculated data. |
||
| 778 | */ |
||
| 779 | 2 | public function cdleveningstar( |
|
| 792 | |||
| 793 | /** |
||
| 794 | * Up/Down-gap side-by-side white lines. |
||
| 795 | * |
||
| 796 | * @param array $open Opening price, array of real values. |
||
| 797 | * @param array $high High price, array of real values. |
||
| 798 | * @param array $low Low price, array of real values. |
||
| 799 | * @param array $close Closing price, array of real values. |
||
| 800 | * |
||
| 801 | * @return array Returns an array with calculated data. |
||
| 802 | */ |
||
| 803 | 2 | public function cdlgapsidesidewhite(array $open, array $high, array $low, array $close): array |
|
| 811 | |||
| 812 | /** |
||
| 813 | * Gravestone Doji. |
||
| 814 | * |
||
| 815 | * @param array $open Opening price, array of real values. |
||
| 816 | * @param array $high High price, array of real values. |
||
| 817 | * @param array $low Low price, array of real values. |
||
| 818 | * @param array $close Closing price, array of real values. |
||
| 819 | * |
||
| 820 | * @return array Returns an array with calculated data. |
||
| 821 | */ |
||
| 822 | 2 | public function cdlgravestonedoji(array $open, array $high, array $low, array $close): array |
|
| 830 | |||
| 831 | /** |
||
| 832 | * Hammer. |
||
| 833 | * |
||
| 834 | * @param array $open Opening price, array of real values. |
||
| 835 | * @param array $high High price, array of real values. |
||
| 836 | * @param array $low Low price, array of real values. |
||
| 837 | * @param array $close Closing price, array of real values. |
||
| 838 | * |
||
| 839 | * @return array Returns an array with calculated data. |
||
| 840 | */ |
||
| 841 | 2 | public function cdlhammer(array $open, array $high, array $low, array $close): array |
|
| 849 | |||
| 850 | /** |
||
| 851 | * Hanging Man. |
||
| 852 | * |
||
| 853 | * @param array $open Opening price, array of real values. |
||
| 854 | * @param array $high High price, array of real values. |
||
| 855 | * @param array $low Low price, array of real values. |
||
| 856 | * @param array $close Closing price, array of real values. |
||
| 857 | * |
||
| 858 | * @return array Returns an array with calculated data. |
||
| 859 | */ |
||
| 860 | 2 | public function cdlhangingman(array $open, array $high, array $low, array $close): array |
|
| 868 | |||
| 869 | /** |
||
| 870 | * Harami Pattern. |
||
| 871 | * |
||
| 872 | * @param array $open Opening price, array of real values. |
||
| 873 | * @param array $high High price, array of real values. |
||
| 874 | * @param array $low Low price, array of real values. |
||
| 875 | * @param array $close Closing price, array of real values. |
||
| 876 | * |
||
| 877 | * @return array Returns an array with calculated data. |
||
| 878 | */ |
||
| 879 | 2 | public function cdlharami(array $open, array $high, array $low, array $close): array |
|
| 887 | |||
| 888 | /** |
||
| 889 | * Harami Cross Pattern. |
||
| 890 | * |
||
| 891 | * @param array $open Opening price, array of real values. |
||
| 892 | * @param array $high High price, array of real values. |
||
| 893 | * @param array $low Low price, array of real values. |
||
| 894 | * @param array $close Closing price, array of real values. |
||
| 895 | * |
||
| 896 | * @return array Returns an array with calculated data. |
||
| 897 | */ |
||
| 898 | 2 | public function cdlharamicross(array $open, array $high, array $low, array $close): array |
|
| 906 | |||
| 907 | /** |
||
| 908 | * High-Wave Candle. |
||
| 909 | * |
||
| 910 | * @param array $open Opening price, array of real values. |
||
| 911 | * @param array $high High price, array of real values. |
||
| 912 | * @param array $low Low price, array of real values. |
||
| 913 | * @param array $close Closing price, array of real values. |
||
| 914 | * |
||
| 915 | * @return array Returns an array with calculated data. |
||
| 916 | */ |
||
| 917 | 2 | public function cdlhighwave(array $open, array $high, array $low, array $close): array |
|
| 925 | |||
| 926 | /** |
||
| 927 | * Hikkake Pattern. |
||
| 928 | * |
||
| 929 | * @param array $open Opening price, array of real values. |
||
| 930 | * @param array $high High price, array of real values. |
||
| 931 | * @param array $low Low price, array of real values. |
||
| 932 | * @param array $close Closing price, array of real values. |
||
| 933 | * |
||
| 934 | * @return array Returns an array with calculated data. |
||
| 935 | */ |
||
| 936 | 2 | public function cdlhikkake(array $open, array $high, array $low, array $close): array |
|
| 944 | |||
| 945 | /** |
||
| 946 | * Modified Hikkake Pattern. |
||
| 947 | * |
||
| 948 | * @param array $open Opening price, array of real values. |
||
| 949 | * @param array $high High price, array of real values. |
||
| 950 | * @param array $low Low price, array of real values. |
||
| 951 | * @param array $close Closing price, array of real values. |
||
| 952 | * |
||
| 953 | * @return array Returns an array with calculated data. |
||
| 954 | */ |
||
| 955 | 2 | public function cdlhikkakemod(array $open, array $high, array $low, array $close): array |
|
| 963 | |||
| 964 | /** |
||
| 965 | * Homing Pigeon. |
||
| 966 | * |
||
| 967 | * @param array $open Opening price, array of real values. |
||
| 968 | * @param array $high High price, array of real values. |
||
| 969 | * @param array $low Low price, array of real values. |
||
| 970 | * @param array $close Closing price, array of real values. |
||
| 971 | * |
||
| 972 | * @return array Returns an array with calculated data. |
||
| 973 | */ |
||
| 974 | 2 | public function cdlhomingpigeon(array $open, array $high, array $low, array $close): array |
|
| 982 | |||
| 983 | /** |
||
| 984 | * Identical Three Crows. |
||
| 985 | * |
||
| 986 | * @param array $open Opening price, array of real values. |
||
| 987 | * @param array $high High price, array of real values. |
||
| 988 | * @param array $low Low price, array of real values. |
||
| 989 | * @param array $close Closing price, array of real values. |
||
| 990 | * |
||
| 991 | * @return array Returns an array with calculated data. |
||
| 992 | */ |
||
| 993 | 2 | public function cdlidentical3crows(array $open, array $high, array $low, array $close): array |
|
| 1001 | |||
| 1002 | /** |
||
| 1003 | * In-Neck Pattern. |
||
| 1004 | * |
||
| 1005 | * @param array $open Opening price, array of real values. |
||
| 1006 | * @param array $high High price, array of real values. |
||
| 1007 | * @param array $low Low price, array of real values. |
||
| 1008 | * @param array $close Closing price, array of real values. |
||
| 1009 | * |
||
| 1010 | * @return array Returns an array with calculated data. |
||
| 1011 | */ |
||
| 1012 | 2 | public function cdlinneck(array $open, array $high, array $low, array $close): array |
|
| 1020 | |||
| 1021 | /** |
||
| 1022 | * Inverted Hammer. |
||
| 1023 | * |
||
| 1024 | * @param array $open Opening price, array of real values. |
||
| 1025 | * @param array $high High price, array of real values. |
||
| 1026 | * @param array $low Low price, array of real values. |
||
| 1027 | * @param array $close Closing price, array of real values. |
||
| 1028 | * |
||
| 1029 | * @return array Returns an array with calculated data. |
||
| 1030 | */ |
||
| 1031 | 2 | public function cdlinvertedhammer(array $open, array $high, array $low, array $close): array |
|
| 1039 | |||
| 1040 | /** |
||
| 1041 | * Kicking. |
||
| 1042 | * |
||
| 1043 | * @param array $open Opening price, array of real values. |
||
| 1044 | * @param array $high High price, array of real values. |
||
| 1045 | * @param array $low Low price, array of real values. |
||
| 1046 | * @param array $close Closing price, array of real values. |
||
| 1047 | * |
||
| 1048 | * @return array Returns an array with calculated data. |
||
| 1049 | */ |
||
| 1050 | 2 | public function cdlkicking(array $open, array $high, array $low, array $close): array |
|
| 1058 | |||
| 1059 | /** |
||
| 1060 | * Kicking - bull/bear determined by the longer marubozu. |
||
| 1061 | * |
||
| 1062 | * @param array $open Opening price, array of real values. |
||
| 1063 | * @param array $high High price, array of real values. |
||
| 1064 | * @param array $low Low price, array of real values. |
||
| 1065 | * @param array $close Closing price, array of real values. |
||
| 1066 | * |
||
| 1067 | * @return array Returns an array with calculated data. |
||
| 1068 | */ |
||
| 1069 | 2 | public function cdlkickingbylength(array $open, array $high, array $low, array $close): array |
|
| 1077 | |||
| 1078 | /** |
||
| 1079 | * Ladder Bottom. |
||
| 1080 | * |
||
| 1081 | * @param array $open Opening price, array of real values. |
||
| 1082 | * @param array $high High price, array of real values. |
||
| 1083 | * @param array $low Low price, array of real values. |
||
| 1084 | * @param array $close Closing price, array of real values. |
||
| 1085 | * |
||
| 1086 | * @return array Returns an array with calculated data. |
||
| 1087 | */ |
||
| 1088 | 2 | public function cdlladderbottom(array $open, array $high, array $low, array $close): array |
|
| 1096 | |||
| 1097 | /** |
||
| 1098 | * Long Legged Doji. |
||
| 1099 | * |
||
| 1100 | * @param array $open Opening price, array of real values. |
||
| 1101 | * @param array $high High price, array of real values. |
||
| 1102 | * @param array $low Low price, array of real values. |
||
| 1103 | * @param array $close Closing price, array of real values. |
||
| 1104 | * |
||
| 1105 | * @return array Returns an array with calculated data. |
||
| 1106 | */ |
||
| 1107 | 2 | public function cdllongleggeddoji(array $open, array $high, array $low, array $close): array |
|
| 1115 | |||
| 1116 | /** |
||
| 1117 | * Long Line Candle. |
||
| 1118 | * |
||
| 1119 | * @param array $open Opening price, array of real values. |
||
| 1120 | * @param array $high High price, array of real values. |
||
| 1121 | * @param array $low Low price, array of real values. |
||
| 1122 | * @param array $close Closing price, array of real values. |
||
| 1123 | * |
||
| 1124 | * @return array Returns an array with calculated data. |
||
| 1125 | */ |
||
| 1126 | 2 | public function cdllongline(array $open, array $high, array $low, array $close): array |
|
| 1134 | |||
| 1135 | /** |
||
| 1136 | * Marubozu. |
||
| 1137 | * |
||
| 1138 | * @param array $open Opening price, array of real values. |
||
| 1139 | * @param array $high High price, array of real values. |
||
| 1140 | * @param array $low Low price, array of real values. |
||
| 1141 | * @param array $close Closing price, array of real values. |
||
| 1142 | * |
||
| 1143 | * @return array Returns an array with calculated data. |
||
| 1144 | */ |
||
| 1145 | 2 | public function cdlmarubozu(array $open, array $high, array $low, array $close): array |
|
| 1153 | |||
| 1154 | /** |
||
| 1155 | * Matching Low. |
||
| 1156 | * |
||
| 1157 | * @param array $open Opening price, array of real values. |
||
| 1158 | * @param array $high High price, array of real values. |
||
| 1159 | * @param array $low Low price, array of real values. |
||
| 1160 | * @param array $close Closing price, array of real values. |
||
| 1161 | * |
||
| 1162 | * @return array Returns an array with calculated data. |
||
| 1163 | */ |
||
| 1164 | 2 | public function cdlmatchinglow(array $open, array $high, array $low, array $close): array |
|
| 1172 | |||
| 1173 | /** |
||
| 1174 | * Mat Hold. |
||
| 1175 | * |
||
| 1176 | * @param array $open Opening price, array of real values. |
||
| 1177 | * @param array $high High price, array of real values. |
||
| 1178 | * @param array $low Low price, array of real values. |
||
| 1179 | * @param array $close Closing price, array of real values. |
||
| 1180 | * @param float $penetration Percentage of penetration of a candle within another candle. |
||
| 1181 | * |
||
| 1182 | * @return array Returns an array with calculated data. |
||
| 1183 | */ |
||
| 1184 | 2 | public function cdlmathold( |
|
| 1197 | |||
| 1198 | /** |
||
| 1199 | * Morning Doji Star. |
||
| 1200 | * |
||
| 1201 | * @param array $open Opening price, array of real values. |
||
| 1202 | * @param array $high High price, array of real values. |
||
| 1203 | * @param array $low Low price, array of real values. |
||
| 1204 | * @param array $close Closing price, array of real values. |
||
| 1205 | * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. |
||
| 1206 | * |
||
| 1207 | * @return array Returns an array with calculated data. |
||
| 1208 | */ |
||
| 1209 | 2 | public function cdlmorningdojistar( |
|
| 1222 | |||
| 1223 | /** |
||
| 1224 | * Morning Star. |
||
| 1225 | * |
||
| 1226 | * @param array $open Opening price, array of real values. |
||
| 1227 | * @param array $high High price, array of real values. |
||
| 1228 | * @param array $low Low price, array of real values. |
||
| 1229 | * @param array $close Closing price, array of real values. |
||
| 1230 | * @param float $penetration Percentage of penetration of a candle within another candle. |
||
| 1231 | * |
||
| 1232 | * @return array Returns an array with calculated data. |
||
| 1233 | */ |
||
| 1234 | 2 | public function cdlmorningstar( |
|
| 1247 | |||
| 1248 | /** |
||
| 1249 | * On-Neck Pattern. |
||
| 1250 | * |
||
| 1251 | * @param array $open Opening price, array of real values. |
||
| 1252 | * @param array $high High price, array of real values. |
||
| 1253 | * @param array $low Low price, array of real values. |
||
| 1254 | * @param array $close Closing price, array of real values. |
||
| 1255 | * |
||
| 1256 | * @return array Returns an array with calculated data. |
||
| 1257 | */ |
||
| 1258 | 2 | public function cdlonneck(array $open, array $high, array $low, array $close): array |
|
| 1266 | |||
| 1267 | /** |
||
| 1268 | * Piercing Pattern. |
||
| 1269 | * |
||
| 1270 | * @param array $open Opening price, array of real values. |
||
| 1271 | * @param array $high High price, array of real values. |
||
| 1272 | * @param array $low Low price, array of real values. |
||
| 1273 | * @param array $close Closing price, array of real values. |
||
| 1274 | * |
||
| 1275 | * @return array Returns an array with calculated data. |
||
| 1276 | */ |
||
| 1277 | 2 | public function cdlpiercing(array $open, array $high, array $low, array $close): array |
|
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Rickshaw Man. |
||
| 1288 | * |
||
| 1289 | * @param array $open Opening price, array of real values. |
||
| 1290 | * @param array $high High price, array of real values. |
||
| 1291 | * @param array $low Low price, array of real values. |
||
| 1292 | * @param array $close Closing price, array of real values. |
||
| 1293 | * |
||
| 1294 | * @return array Returns an array with calculated data. |
||
| 1295 | */ |
||
| 1296 | 2 | public function cdlrickshawman(array $open, array $high, array $low, array $close): array |
|
| 1304 | |||
| 1305 | /** |
||
| 1306 | * Rising/Falling Three Methods. |
||
| 1307 | * |
||
| 1308 | * @param array $open Opening price, array of real values. |
||
| 1309 | * @param array $high High price, array of real values. |
||
| 1310 | * @param array $low Low price, array of real values. |
||
| 1311 | * @param array $close Closing price, array of real values. |
||
| 1312 | * |
||
| 1313 | * @return array Returns an array with calculated data. |
||
| 1314 | */ |
||
| 1315 | 2 | public function cdlrisefall3methods(array $open, array $high, array $low, array $close): array |
|
| 1323 | |||
| 1324 | /** |
||
| 1325 | * Separating Lines. |
||
| 1326 | * |
||
| 1327 | * @param array $open Opening price, array of real values. |
||
| 1328 | * @param array $high High price, array of real values. |
||
| 1329 | * @param array $low Low price, array of real values. |
||
| 1330 | * @param array $close Closing price, array of real values. |
||
| 1331 | * |
||
| 1332 | * @return array Returns an array with calculated data. |
||
| 1333 | */ |
||
| 1334 | 2 | public function cdlseparatinglines(array $open, array $high, array $low, array $close): array |
|
| 1342 | |||
| 1343 | /** |
||
| 1344 | * Shooting Star. |
||
| 1345 | * |
||
| 1346 | * @param array $open Opening price, array of real values. |
||
| 1347 | * @param array $high High price, array of real values. |
||
| 1348 | * @param array $low Low price, array of real values. |
||
| 1349 | * @param array $close Closing price, array of real values. |
||
| 1350 | * |
||
| 1351 | * @return array Returns an array with calculated data. |
||
| 1352 | */ |
||
| 1353 | 2 | public function cdlshootingstar(array $open, array $high, array $low, array $close): array |
|
| 1361 | |||
| 1362 | /** |
||
| 1363 | * Short Line Candle. |
||
| 1364 | * |
||
| 1365 | * @param array $open Opening price, array of real values. |
||
| 1366 | * @param array $high High price, array of real values. |
||
| 1367 | * @param array $low Low price, array of real values. |
||
| 1368 | * @param array $close Closing price, array of real values. |
||
| 1369 | * |
||
| 1370 | * @return array Returns an array with calculated data. |
||
| 1371 | */ |
||
| 1372 | 2 | public function cdlshortline(array $open, array $high, array $low, array $close): array |
|
| 1380 | |||
| 1381 | /** |
||
| 1382 | * Spinning Top. |
||
| 1383 | * |
||
| 1384 | * @param array $open Opening price, array of real values. |
||
| 1385 | * @param array $high High price, array of real values. |
||
| 1386 | * @param array $low Low price, array of real values. |
||
| 1387 | * @param array $close Closing price, array of real values. |
||
| 1388 | * |
||
| 1389 | * @return array Returns an array with calculated data. |
||
| 1390 | */ |
||
| 1391 | 2 | public function cdlspinningtop(array $open, array $high, array $low, array $close): array |
|
| 1399 | |||
| 1400 | /** |
||
| 1401 | * Stalled Pattern. |
||
| 1402 | * |
||
| 1403 | * @param array $open Opening price, array of real values. |
||
| 1404 | * @param array $high High price, array of real values. |
||
| 1405 | * @param array $low Low price, array of real values. |
||
| 1406 | * @param array $close Closing price, array of real values. |
||
| 1407 | * |
||
| 1408 | * @return array Returns an array with calculated data. |
||
| 1409 | */ |
||
| 1410 | 2 | public function cdlstalledpattern(array $open, array $high, array $low, array $close): array |
|
| 1418 | |||
| 1419 | /** |
||
| 1420 | * Stick Sandwich. |
||
| 1421 | * |
||
| 1422 | * @param array $open Opening price, array of real values. |
||
| 1423 | * @param array $high High price, array of real values. |
||
| 1424 | * @param array $low Low price, array of real values. |
||
| 1425 | * @param array $close Closing price, array of real values. |
||
| 1426 | * |
||
| 1427 | * @return array Returns an array with calculated data. |
||
| 1428 | */ |
||
| 1429 | 2 | public function cdlsticksandwich(array $open, array $high, array $low, array $close): array |
|
| 1437 | |||
| 1438 | /** |
||
| 1439 | * Takuri (Dragonfly Doji with very long lower shadow). |
||
| 1440 | * |
||
| 1441 | * @param array $open Opening price, array of real values. |
||
| 1442 | * @param array $high High price, array of real values. |
||
| 1443 | * @param array $low Low price, array of real values. |
||
| 1444 | * @param array $close Closing price, array of real values. |
||
| 1445 | * |
||
| 1446 | * @return array Returns an array with calculated data. |
||
| 1447 | */ |
||
| 1448 | 2 | public function cdltakuri(array $open, array $high, array $low, array $close): array |
|
| 1456 | |||
| 1457 | /** |
||
| 1458 | * Tasuki Gap. |
||
| 1459 | * |
||
| 1460 | * @param array $open Opening price, array of real values. |
||
| 1461 | * @param array $high High price, array of real values. |
||
| 1462 | * @param array $low Low price, array of real values. |
||
| 1463 | * @param array $close Closing price, array of real values. |
||
| 1464 | * |
||
| 1465 | * @return array Returns an array with calculated data. |
||
| 1466 | */ |
||
| 1467 | 2 | public function cdltasukigap(array $open, array $high, array $low, array $close): array |
|
| 1475 | |||
| 1476 | /** |
||
| 1477 | * Thrusting Pattern. |
||
| 1478 | * |
||
| 1479 | * @param array $open Opening price, array of real values. |
||
| 1480 | * @param array $high High price, array of real values. |
||
| 1481 | * @param array $low Low price, array of real values. |
||
| 1482 | * @param array $close Closing price, array of real values. |
||
| 1483 | * |
||
| 1484 | * @return array Returns an array with calculated data. |
||
| 1485 | */ |
||
| 1486 | 2 | public function cdlthrusting(array $open, array $high, array $low, array $close): array |
|
| 1494 | |||
| 1495 | /** |
||
| 1496 | * Tristar Pattern. |
||
| 1497 | * |
||
| 1498 | * @param array $open Opening price, array of real values. |
||
| 1499 | * @param array $high High price, array of real values. |
||
| 1500 | * @param array $low Low price, array of real values. |
||
| 1501 | * @param array $close Closing price, array of real values. |
||
| 1502 | * |
||
| 1503 | * @return array Returns an array with calculated data. |
||
| 1504 | */ |
||
| 1505 | 2 | public function cdltristar(array $open, array $high, array $low, array $close): array |
|
| 1513 | |||
| 1514 | /** |
||
| 1515 | * Unique 3 River. |
||
| 1516 | * |
||
| 1517 | * @param array $open Opening price, array of real values. |
||
| 1518 | * @param array $high High price, array of real values. |
||
| 1519 | * @param array $low Low price, array of real values. |
||
| 1520 | * @param array $close Closing price, array of real values. |
||
| 1521 | * |
||
| 1522 | * @return array Returns an array with calculated data. |
||
| 1523 | */ |
||
| 1524 | 2 | public function cdlunique3river(array $open, array $high, array $low, array $close): array |
|
| 1532 | |||
| 1533 | /** |
||
| 1534 | * Upside Gap Two Crows. |
||
| 1535 | * |
||
| 1536 | * @param array $open Opening price, array of real values. |
||
| 1537 | * @param array $high High price, array of real values. |
||
| 1538 | * @param array $low Low price, array of real values. |
||
| 1539 | * @param array $close Closing price, array of real values. |
||
| 1540 | * |
||
| 1541 | * @return array Returns an array with calculated data. |
||
| 1542 | */ |
||
| 1543 | 2 | public function cdlupsidegap2crows(array $open, array $high, array $low, array $close): array |
|
| 1551 | |||
| 1552 | /** |
||
| 1553 | * Upside/Downside Gap Three Methods. |
||
| 1554 | * |
||
| 1555 | * @param array $open Opening price, array of real values. |
||
| 1556 | * @param array $high High price, array of real values. |
||
| 1557 | * @param array $low Low price, array of real values. |
||
| 1558 | * @param array $close Closing price, array of real values. |
||
| 1559 | * |
||
| 1560 | * @return array Returns an array with calculated data. |
||
| 1561 | */ |
||
| 1562 | 2 | public function cdlxsidegap3methods(array $open, array $high, array $low, array $close): array |
|
| 1570 | |||
| 1571 | /** |
||
| 1572 | * Vector Ceil. |
||
| 1573 | * |
||
| 1574 | * Calculates the next highest integer for each value in real and returns the resulting array. |
||
| 1575 | * |
||
| 1576 | * @param array $real Array of real values. |
||
| 1577 | * |
||
| 1578 | * @return array Returns an array with calculated data. |
||
| 1579 | */ |
||
| 1580 | 2 | public function ceil(array $real): array |
|
| 1588 | |||
| 1589 | /** |
||
| 1590 | * Chande Momentum Oscillator. |
||
| 1591 | * |
||
| 1592 | * @param array $real Array of real values. |
||
| 1593 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1594 | * |
||
| 1595 | * @return array Returns an array with calculated data. |
||
| 1596 | */ |
||
| 1597 | 2 | public function cmo(array $real, int $timePeriod = 14): array |
|
| 1605 | |||
| 1606 | /** |
||
| 1607 | * Pearson's Correlation Coefficient (r). |
||
| 1608 | * |
||
| 1609 | * @param array $real0 Array of real values. |
||
| 1610 | * @param array $real1 Array of real values. |
||
| 1611 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1612 | * |
||
| 1613 | * @return array Returns an array with calculated data. |
||
| 1614 | */ |
||
| 1615 | 2 | public function correl(array $real0, array $real1, int $timePeriod = 30): array |
|
| 1623 | |||
| 1624 | /** |
||
| 1625 | * Vector Trigonometric Cos. |
||
| 1626 | * |
||
| 1627 | * Calculates the cosine for each value in real and returns the resulting array. |
||
| 1628 | * |
||
| 1629 | * @param array $real Array of real values. |
||
| 1630 | * |
||
| 1631 | * @return array Returns an array with calculated data. |
||
| 1632 | */ |
||
| 1633 | 2 | public function cos(array $real): array |
|
| 1641 | |||
| 1642 | /** |
||
| 1643 | * Vector Trigonometric Cosh. |
||
| 1644 | * |
||
| 1645 | * Calculates the hyperbolic cosine for each value in real and returns the resulting array. |
||
| 1646 | * |
||
| 1647 | * @param array $real Array of real values. |
||
| 1648 | * |
||
| 1649 | * @return array Returns an array with calculated data. |
||
| 1650 | */ |
||
| 1651 | 2 | public function cosh(array $real): array |
|
| 1659 | |||
| 1660 | /** |
||
| 1661 | * Double Exponential Moving Average. |
||
| 1662 | * |
||
| 1663 | * @param array $real Array of real values. |
||
| 1664 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1665 | * |
||
| 1666 | * @return array Returns an array with calculated data. |
||
| 1667 | */ |
||
| 1668 | 2 | public function dema(array $real, int $timePeriod = 30): array |
|
| 1676 | |||
| 1677 | /** |
||
| 1678 | * Vector Arithmetic Div. |
||
| 1679 | * |
||
| 1680 | * Divides each value from real0 by the corresponding value from real1 and returns the resulting array. |
||
| 1681 | * |
||
| 1682 | * @param array $real0 Array of real values. |
||
| 1683 | * @param array $real1 Array of real values. |
||
| 1684 | * |
||
| 1685 | * @return array Returns an array with calculated data. |
||
| 1686 | */ |
||
| 1687 | 2 | public function div(array $real0, array $real1): array |
|
| 1695 | |||
| 1696 | /** |
||
| 1697 | * Directional Movement Index. |
||
| 1698 | * |
||
| 1699 | * @param array $high High price, array of real values. |
||
| 1700 | * @param array $low Low price, array of real values. |
||
| 1701 | * @param array $close Closing price, array of real values. |
||
| 1702 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1703 | * |
||
| 1704 | * @return array Returns an array with calculated data. |
||
| 1705 | */ |
||
| 1706 | 2 | public function dx(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 1714 | |||
| 1715 | /** |
||
| 1716 | * Exponential Moving Average. |
||
| 1717 | * |
||
| 1718 | * @param array $real Array of real values. |
||
| 1719 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1720 | * |
||
| 1721 | * @return array Returns an array with calculated data. |
||
| 1722 | */ |
||
| 1723 | 2 | public function ema(array $real, int $timePeriod = 30): array |
|
| 1731 | |||
| 1732 | /** |
||
| 1733 | * Get error code. |
||
| 1734 | * |
||
| 1735 | * Get error code of the last operation. |
||
| 1736 | * |
||
| 1737 | * @return int Returns the error code identified by one of the ERR_* constants. |
||
| 1738 | */ |
||
| 1739 | 2 | public function errno(): int |
|
| 1743 | |||
| 1744 | /** |
||
| 1745 | * Vector Arithmetic Exp. |
||
| 1746 | * |
||
| 1747 | * Calculates e raised to the power of each value in real. Returns an array with the calculated data. |
||
| 1748 | * |
||
| 1749 | * @param array $real Array of real values. |
||
| 1750 | * |
||
| 1751 | * @return array Returns an array with calculated data. |
||
| 1752 | */ |
||
| 1753 | 2 | public function exp(array $real): array |
|
| 1761 | |||
| 1762 | /** |
||
| 1763 | * Vector Floor. |
||
| 1764 | * |
||
| 1765 | * Calculates the next lowest integer for each value in real and returns the resulting array. |
||
| 1766 | * |
||
| 1767 | * @param array $real Array of real values. |
||
| 1768 | * |
||
| 1769 | * @return array Returns an array with calculated data. |
||
| 1770 | */ |
||
| 1771 | 2 | public function floor(array $real): array |
|
| 1779 | |||
| 1780 | /** |
||
| 1781 | * Get compatibility mode. |
||
| 1782 | * |
||
| 1783 | * Get compatibility mode which affects the way calculations are done by all the extension functions. |
||
| 1784 | * |
||
| 1785 | * @return int Returns the compatibility mode id which can be identified by COMPATIBILITY_* series of constants. |
||
| 1786 | */ |
||
| 1787 | 2 | public function get_compat(): int |
|
| 1791 | |||
| 1792 | /** |
||
| 1793 | * Get unstable period. |
||
| 1794 | * |
||
| 1795 | * Get unstable period factor for a particular function. |
||
| 1796 | * |
||
| 1797 | * @param int $functionId Function ID the factor to be read for. FUNC_UNST_* series of constants should be used. |
||
| 1798 | * |
||
| 1799 | * @return int Returns the unstable period factor for the corresponding function. |
||
| 1800 | */ |
||
| 1801 | 2 | public function get_unstable_period(int $functionId): int |
|
| 1805 | |||
| 1806 | /** |
||
| 1807 | * Hilbert Transform - Dominant Cycle Period. |
||
| 1808 | * |
||
| 1809 | * @param array $real Array of real values. |
||
| 1810 | * |
||
| 1811 | * @return array Returns an array with calculated data. |
||
| 1812 | */ |
||
| 1813 | 2 | public function ht_dcperiod(array $real): array |
|
| 1821 | |||
| 1822 | /** |
||
| 1823 | * Hilbert Transform - Dominant Cycle Phase. |
||
| 1824 | * |
||
| 1825 | * @param array $real Array of real values. |
||
| 1826 | * |
||
| 1827 | * @return array Returns an array with calculated data. |
||
| 1828 | */ |
||
| 1829 | 2 | public function ht_dcphase(array $real): array |
|
| 1837 | |||
| 1838 | /** |
||
| 1839 | * Hilbert Transform - Phasor Components. |
||
| 1840 | * |
||
| 1841 | * @param array $open Opening price, array of real values. |
||
| 1842 | * @param array $close Closing price, array of real values. |
||
| 1843 | * |
||
| 1844 | * @return array Returns an array with calculated data. |
||
| 1845 | */ |
||
| 1846 | 2 | public function ht_phasor(array $open, array $close): array |
|
| 1854 | |||
| 1855 | /** |
||
| 1856 | * Hilbert Transform - Phasor Components. |
||
| 1857 | * |
||
| 1858 | * @param array $open Opening price, array of real values. |
||
| 1859 | * @param array $close Closing price, array of real values. |
||
| 1860 | * |
||
| 1861 | * @return array Returns an array with calculated data. |
||
| 1862 | */ |
||
| 1863 | 2 | public function ht_sine(array $open, array $close): array |
|
| 1871 | |||
| 1872 | /** |
||
| 1873 | * Hilbert Transform - Instantaneous Trendline. |
||
| 1874 | * |
||
| 1875 | * @param array $real Array of real values. |
||
| 1876 | * |
||
| 1877 | * @return array Returns an array with calculated data. |
||
| 1878 | */ |
||
| 1879 | 2 | public function ht_trendline(array $real): array |
|
| 1887 | |||
| 1888 | /** |
||
| 1889 | * Hilbert Transform - Trend vs Cycle Mode. |
||
| 1890 | * |
||
| 1891 | * @param array $real Array of real values. |
||
| 1892 | * |
||
| 1893 | * @return array Returns an array with calculated data. |
||
| 1894 | */ |
||
| 1895 | 2 | public function ht_trendmode(array $real): array |
|
| 1903 | |||
| 1904 | /** |
||
| 1905 | * Kaufman Adaptive Moving Average. |
||
| 1906 | * |
||
| 1907 | * @param array $real Array of real values. |
||
| 1908 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1909 | * |
||
| 1910 | * @return array Returns an array with calculated data. |
||
| 1911 | */ |
||
| 1912 | 2 | public function kama(array $real, int $timePeriod = 30): array |
|
| 1920 | |||
| 1921 | /** |
||
| 1922 | * Linear Regression Angle. |
||
| 1923 | * |
||
| 1924 | * @param array $real Array of real values. |
||
| 1925 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1926 | * |
||
| 1927 | * @return array Returns an array with calculated data. |
||
| 1928 | */ |
||
| 1929 | 2 | public function linearreg_angle(array $real, int $timePeriod = 14): array |
|
| 1937 | |||
| 1938 | /** |
||
| 1939 | * Linear Regression Angle. |
||
| 1940 | * |
||
| 1941 | * @param array $real Array of real values. |
||
| 1942 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1943 | * |
||
| 1944 | * @return array Returns an array with calculated data. |
||
| 1945 | */ |
||
| 1946 | 2 | public function linearreg_intercept(array $real, int $timePeriod = 14): array |
|
| 1954 | |||
| 1955 | /** |
||
| 1956 | * Linear Regression Slope. |
||
| 1957 | * |
||
| 1958 | * @param array $real Array of real values. |
||
| 1959 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1960 | * |
||
| 1961 | * @return array Returns an array with calculated data. |
||
| 1962 | */ |
||
| 1963 | 2 | public function linearreg_slope(array $real, int $timePeriod = 14): array |
|
| 1971 | |||
| 1972 | /** |
||
| 1973 | * Linear Regression. |
||
| 1974 | * |
||
| 1975 | * @param array $real Array of real values. |
||
| 1976 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 1977 | * |
||
| 1978 | * @return array Returns an array with calculated data. |
||
| 1979 | */ |
||
| 1980 | 2 | public function linearreg(array $real, int $timePeriod = 14): array |
|
| 1988 | |||
| 1989 | /** |
||
| 1990 | * Vector Log Natural. |
||
| 1991 | * |
||
| 1992 | * Calculates the natural logarithm for each value in real and returns the resulting array. |
||
| 1993 | * |
||
| 1994 | * @param array $real Array of real values. |
||
| 1995 | * |
||
| 1996 | * @return array Returns an array with calculated data. |
||
| 1997 | */ |
||
| 1998 | 2 | public function ln(array $real): array |
|
| 2006 | |||
| 2007 | /** |
||
| 2008 | * Vector Log10. |
||
| 2009 | * |
||
| 2010 | * Calculates the base-10 logarithm for each value in real and returns the resulting array. |
||
| 2011 | * |
||
| 2012 | * @param array $real Array of real values. |
||
| 2013 | * |
||
| 2014 | * @return array Returns an array with calculated data. |
||
| 2015 | */ |
||
| 2016 | 2 | public function log10(array $real): array |
|
| 2024 | |||
| 2025 | /** |
||
| 2026 | * Moving average. |
||
| 2027 | * |
||
| 2028 | * @param array $real Array of real values. |
||
| 2029 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2030 | * @param int $mAType Type of Moving Average. MA_TYPE_* series of constants should be used. |
||
| 2031 | * |
||
| 2032 | * @return array Returns an array with calculated data. |
||
| 2033 | */ |
||
| 2034 | 2 | public function ma(array $real, int $timePeriod = 30, int $mAType = 0): array |
|
| 2042 | |||
| 2043 | /** |
||
| 2044 | * Moving Average Convergence/Divergence. |
||
| 2045 | * |
||
| 2046 | * @param array $real Array of real values. |
||
| 2047 | * @param int $fastPeriod Number of period for the fast MA. Valid range from 2 to 100000. |
||
| 2048 | * @param int $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. |
||
| 2049 | * @param int $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. |
||
| 2050 | * |
||
| 2051 | * @return array Returns an array with calculated data. |
||
| 2052 | */ |
||
| 2053 | 2 | public function macd( |
|
| 2065 | |||
| 2066 | /** |
||
| 2067 | * Moving Average Convergence/Divergence with controllable Moving Average type. |
||
| 2068 | * |
||
| 2069 | * @param array $real Array of real values. |
||
| 2070 | * @param int $fastPeriod Number of period for the fast MA. Valid range from 2 to 100000. |
||
| 2071 | * @param int $fastMAType Type of Moving Average for fast MA. MA_TYPE_* series of constants should be used. |
||
| 2072 | * @param int $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. |
||
| 2073 | * @param int $slowMAType Type of Moving Average for fast MA. MA_TYPE_* series of constants should be used. |
||
| 2074 | * @param int $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. |
||
| 2075 | * |
||
| 2076 | * @return array Returns an array with calculated data. |
||
| 2077 | */ |
||
| 2078 | 2 | public function macdext( |
|
| 2092 | |||
| 2093 | /** |
||
| 2094 | * Moving Average Convergence/Divergence Fix 12/26. |
||
| 2095 | * |
||
| 2096 | * @param array $real Array of real values. |
||
| 2097 | * @param int $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. |
||
| 2098 | * |
||
| 2099 | * @return array Returns an array with calculated data. |
||
| 2100 | */ |
||
| 2101 | 2 | public function macdfix(array $real, int $signalPeriod = 9): array |
|
| 2109 | |||
| 2110 | /** |
||
| 2111 | * MESA Adaptive Moving Average. |
||
| 2112 | * |
||
| 2113 | * @param array $real Array of real values. |
||
| 2114 | * @param float $fastLimit Upper limit use in the adaptive algorithm. Valid range from 0.01 to 0.99. |
||
| 2115 | * @param float $slowLimit Lower limit use in the adaptive algorithm. Valid range from 0.01 to 0.99. |
||
| 2116 | * |
||
| 2117 | * @return array Returns an array with calculated data. |
||
| 2118 | */ |
||
| 2119 | 2 | public function mama(array $real, float $fastLimit = 0.5, float $slowLimit = 0.05): array |
|
| 2127 | |||
| 2128 | /** |
||
| 2129 | * Moving average with variable period |
||
| 2130 | * |
||
| 2131 | * @param array $real Array of real values. |
||
| 2132 | * @param array $periods Array of real values. |
||
| 2133 | * @param int $minPeriod Value less than minimum will be changed to Minimum period. Valid range from 2 to 100000 |
||
| 2134 | * @param int $maxPeriod Value higher than maximum will be changed to Maximum period. Valid range from 2 to 100000 |
||
| 2135 | * @param int $mAType Type of Moving Average. MA_TYPE_* series of constants should be used. |
||
| 2136 | * |
||
| 2137 | * @return array Returns an array with calculated data. |
||
| 2138 | */ |
||
| 2139 | 2 | public function mavp( |
|
| 2152 | |||
| 2153 | /** |
||
| 2154 | * Highest value over a specified period. |
||
| 2155 | * |
||
| 2156 | * @param array $real Array of real values. |
||
| 2157 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2158 | * |
||
| 2159 | * @return array Returns an array with calculated data. |
||
| 2160 | */ |
||
| 2161 | 2 | public function max(array $real, int $timePeriod = 30): array |
|
| 2169 | |||
| 2170 | /** |
||
| 2171 | * Index of highest value over a specified period |
||
| 2172 | * |
||
| 2173 | * @param array $real Array of real values. |
||
| 2174 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2175 | * |
||
| 2176 | * @return array Returns an array with calculated data. |
||
| 2177 | */ |
||
| 2178 | 2 | public function maxindex(array $real, int $timePeriod = 30): array |
|
| 2186 | |||
| 2187 | /** |
||
| 2188 | * Median Price. |
||
| 2189 | * |
||
| 2190 | * @param array $high High price, array of real values. |
||
| 2191 | * @param array $low Low price, array of real values. |
||
| 2192 | * |
||
| 2193 | * @return array Returns an array with calculated data. |
||
| 2194 | */ |
||
| 2195 | 2 | public function medprice(array $high, array $low): array |
|
| 2203 | |||
| 2204 | /** |
||
| 2205 | * Money Flow Index. |
||
| 2206 | * |
||
| 2207 | * @param array $high High price, array of real values. |
||
| 2208 | * @param array $low Low price, array of real values. |
||
| 2209 | * @param array $close Closing price, array of real values. |
||
| 2210 | * @param array $volume Volume traded, array of real values. |
||
| 2211 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2212 | * |
||
| 2213 | * @return array Returns an array with calculated data. |
||
| 2214 | */ |
||
| 2215 | 2 | public function mfi(array $high, array $low, array $close, array $volume, int $timePeriod = 14): array |
|
| 2223 | |||
| 2224 | /** |
||
| 2225 | * MidPoint over period. |
||
| 2226 | * |
||
| 2227 | * @param array $real Array of real values. |
||
| 2228 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2229 | * |
||
| 2230 | * @return array Returns an array with calculated data. |
||
| 2231 | */ |
||
| 2232 | 2 | public function midpoint(array $real, int $timePeriod = 14): array |
|
| 2240 | |||
| 2241 | /** |
||
| 2242 | * Midpoint Price over period. |
||
| 2243 | * |
||
| 2244 | * @param array $high High price, array of real values. |
||
| 2245 | * @param array $low Low price, array of real values. |
||
| 2246 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2247 | * |
||
| 2248 | * @return array Returns an array with calculated data. |
||
| 2249 | */ |
||
| 2250 | 2 | public function midprice(array $high, array $low, int $timePeriod = 14): array |
|
| 2258 | |||
| 2259 | /** |
||
| 2260 | * Lowest value over a specified period. |
||
| 2261 | * |
||
| 2262 | * @param array $real Array of real values. |
||
| 2263 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2264 | * |
||
| 2265 | * @return array Returns an array with calculated data. |
||
| 2266 | */ |
||
| 2267 | 2 | public function min(array $real, int $timePeriod = 30): array |
|
| 2275 | |||
| 2276 | /** |
||
| 2277 | * Index of lowest value over a specified period. |
||
| 2278 | * |
||
| 2279 | * @param array $real Array of real values. |
||
| 2280 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2281 | * |
||
| 2282 | * @return array Returns an array with calculated data. |
||
| 2283 | */ |
||
| 2284 | 2 | public function minindex(array $real, int $timePeriod = 30): array |
|
| 2292 | |||
| 2293 | /** |
||
| 2294 | * Lowest and highest values over a specified period. |
||
| 2295 | * |
||
| 2296 | * @param array $real Array of real values. |
||
| 2297 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2298 | * |
||
| 2299 | * @return array Returns an array with calculated data. |
||
| 2300 | */ |
||
| 2301 | 2 | public function minmax(array $real, int $timePeriod = 30): array |
|
| 2309 | |||
| 2310 | /** |
||
| 2311 | * Indexes of lowest and highest values over a specified period. |
||
| 2312 | * |
||
| 2313 | * @param array $real Array of real values. |
||
| 2314 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2315 | * |
||
| 2316 | * @return array Returns an array with calculated data. |
||
| 2317 | */ |
||
| 2318 | 2 | public function minmaxindex(array $real, int $timePeriod = 30): array |
|
| 2326 | |||
| 2327 | /** |
||
| 2328 | * Minus Directional Indicator. |
||
| 2329 | * |
||
| 2330 | * @param array $high High price, array of real values. |
||
| 2331 | * @param array $low Low price, array of real values. |
||
| 2332 | * @param array $close Closing price, array of real values. |
||
| 2333 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2334 | * |
||
| 2335 | * @return array Returns an array with calculated data. |
||
| 2336 | */ |
||
| 2337 | 2 | public function minus_di(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 2345 | |||
| 2346 | /** |
||
| 2347 | * Minus Directional Movement. |
||
| 2348 | * |
||
| 2349 | * @param array $high High price, array of real values. |
||
| 2350 | * @param array $low Low price, array of real values. |
||
| 2351 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2352 | * |
||
| 2353 | * @return array Returns an array with calculated data. |
||
| 2354 | */ |
||
| 2355 | 2 | public function minus_dm(array $high, array $low, int $timePeriod = 14): array |
|
| 2363 | |||
| 2364 | /** |
||
| 2365 | * Momentum. |
||
| 2366 | * |
||
| 2367 | * @param array $real Array of real values. |
||
| 2368 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2369 | * |
||
| 2370 | * @return array Returns an array with calculated data. |
||
| 2371 | */ |
||
| 2372 | 2 | public function mom(array $real, int $timePeriod = 10): array |
|
| 2380 | |||
| 2381 | /** |
||
| 2382 | * Vector Arithmetic Mult. |
||
| 2383 | * |
||
| 2384 | * Calculates the vector dot product of real0 with real1 and returns the resulting vector. |
||
| 2385 | * |
||
| 2386 | * @param array $real0 Array of real values. |
||
| 2387 | * @param array $real1 Array of real values. |
||
| 2388 | * |
||
| 2389 | * @return array Returns an array with calculated data. |
||
| 2390 | */ |
||
| 2391 | 2 | public function mult(array $real0, array $real1): array |
|
| 2399 | |||
| 2400 | /** |
||
| 2401 | * Normalized Average True Range. |
||
| 2402 | * |
||
| 2403 | * @param array $high High price, array of real values. |
||
| 2404 | * @param array $low Low price, array of real values. |
||
| 2405 | * @param array $close Closing price, array of real values. |
||
| 2406 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2407 | * |
||
| 2408 | * @return array Returns an array with calculated data. |
||
| 2409 | */ |
||
| 2410 | 2 | public function natr(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 2418 | |||
| 2419 | /** |
||
| 2420 | * On Balance Volume. |
||
| 2421 | * |
||
| 2422 | * @param array $real Array of real values. |
||
| 2423 | * @param array $volume Volume traded, array of real values. |
||
| 2424 | * |
||
| 2425 | * @return array Returns an array with calculated data. |
||
| 2426 | */ |
||
| 2427 | 2 | public function obv(array $real, array $volume): array |
|
| 2435 | |||
| 2436 | /** |
||
| 2437 | * Plus Directional Indicator. |
||
| 2438 | * |
||
| 2439 | * @param array $high High price, array of real values. |
||
| 2440 | * @param array $low Low price, array of real values. |
||
| 2441 | * @param array $close Closing price, array of real values. |
||
| 2442 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2443 | * |
||
| 2444 | * @return array Returns an array with calculated data. |
||
| 2445 | */ |
||
| 2446 | 2 | public function plus_di(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 2454 | |||
| 2455 | /** |
||
| 2456 | * Plus Directional Movement. |
||
| 2457 | * |
||
| 2458 | * @param array $high High price, array of real values. |
||
| 2459 | * @param array $low Low price, array of real values. |
||
| 2460 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2461 | * |
||
| 2462 | * @return array Returns an array with calculated data. |
||
| 2463 | */ |
||
| 2464 | 2 | public function plus_dm(array $high, array $low, int $timePeriod = 14): array |
|
| 2472 | |||
| 2473 | /** |
||
| 2474 | * Percentage Price Oscillator. |
||
| 2475 | * |
||
| 2476 | * @param array $real Array of real values. |
||
| 2477 | * @param int $fastPeriod Number of period for the fast MA. Valid range from 2 to 100000. |
||
| 2478 | * @param int $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. |
||
| 2479 | * @param int $mAType Type of Moving Average. MA_TYPE_* series of constants should be used. |
||
| 2480 | * |
||
| 2481 | * @return array Returns an array with calculated data. |
||
| 2482 | */ |
||
| 2483 | 2 | public function ppo(array $real, int $fastPeriod = 12, int $slowPeriod = 26, int $mAType = 0): array |
|
| 2491 | |||
| 2492 | /** |
||
| 2493 | * Rate of change : ((price/prevPrice)-1)*100. |
||
| 2494 | * |
||
| 2495 | * @param array $real Array of real values. |
||
| 2496 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2497 | * |
||
| 2498 | * @return array Returns an array with calculated data. |
||
| 2499 | */ |
||
| 2500 | 2 | public function roc(array $real, int $timePeriod = 10): array |
|
| 2508 | |||
| 2509 | /** |
||
| 2510 | * Rate of change Percentage: (price-prevPrice)/prevPrice. |
||
| 2511 | * |
||
| 2512 | * @param array $real Array of real values. |
||
| 2513 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2514 | * |
||
| 2515 | * @return array Returns an array with calculated data. |
||
| 2516 | */ |
||
| 2517 | 2 | public function rocp(array $real, int $timePeriod = 10): array |
|
| 2525 | |||
| 2526 | /** |
||
| 2527 | * Rate of change ratio 100 scale: (price/prevPrice)*100. |
||
| 2528 | * |
||
| 2529 | * @param array $real Array of real values. |
||
| 2530 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2531 | * |
||
| 2532 | * @return array Returns an array with calculated data. |
||
| 2533 | */ |
||
| 2534 | 2 | public function rocr100(array $real, int $timePeriod = 10): array |
|
| 2542 | |||
| 2543 | /** |
||
| 2544 | * Rate of change ratio: (price/prevPrice). |
||
| 2545 | * |
||
| 2546 | * @param array $real Array of real values. |
||
| 2547 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2548 | * |
||
| 2549 | * @return array Returns an array with calculated data. |
||
| 2550 | */ |
||
| 2551 | 2 | public function rocr(array $real, int $timePeriod = 10): array |
|
| 2559 | |||
| 2560 | /** |
||
| 2561 | * Relative Strength Index. |
||
| 2562 | * |
||
| 2563 | * @param array $real Array of real values. |
||
| 2564 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2565 | * |
||
| 2566 | * @return array Returns an array with calculated data. |
||
| 2567 | */ |
||
| 2568 | 2 | public function rsi(array $real, int $timePeriod = 14): array |
|
| 2576 | |||
| 2577 | /** |
||
| 2578 | * Parabolic SAR. |
||
| 2579 | * |
||
| 2580 | * @param array $high High price, array of real values. |
||
| 2581 | * @param array $low Low price, array of real values. |
||
| 2582 | * @param float $acceleration Acceleration Factor used up to the Maximum value. Valid range from 0 to REAL_MAX. |
||
| 2583 | * @param float $maximum Acceleration Factor Maximum value. Valid range from 0 to REAL_MAX. |
||
| 2584 | * |
||
| 2585 | * @return array Returns an array with calculated data. |
||
| 2586 | */ |
||
| 2587 | 2 | public function sar(array $high, array $low, float $acceleration = 0.02, float $maximum = 0.2): array |
|
| 2595 | |||
| 2596 | /** |
||
| 2597 | * Parabolic SAR - Extended. |
||
| 2598 | * |
||
| 2599 | * @param array $high High price, array of real values. |
||
| 2600 | * @param array $low Low price, array of real values. |
||
| 2601 | * @param float $startValue Start value and direction. 0 for Auto, >0 for Long, <0 for Short. Valid range from REAL_MIN to REAL_MAX. |
||
| 2602 | * @param float $offsetOnReverse Percent offset added/removed to initial stop on short/long reversal. Valid range from 0 to REAL_MAX. |
||
| 2603 | * @param float $accelerationInitLong Acceleration Factor initial value for the Long direction. Valid range from 0 to REAL_MAX. |
||
| 2604 | * @param float $accelerationLong Acceleration Factor for the Long direction. Valid range from 0 to REAL_MAX. |
||
| 2605 | * @param float $accelerationMaxLong Acceleration Factor maximum value for the Long direction. Valid range from 0 to REAL_MAX. |
||
| 2606 | * @param float $accelerationInitShort Acceleration Factor initial value for the Short direction. Valid range from 0 to REAL_MAX. |
||
| 2607 | * @param float $accelerationShort Acceleration Factor for the Short direction. Valid range from 0 to REAL_MAX. |
||
| 2608 | * @param float $accelerationMaxShort Acceleration Factor maximum value for the Short direction. Valid range from 0 to REAL_MAX. |
||
| 2609 | * |
||
| 2610 | * @return array Returns an array with calculated data. |
||
| 2611 | */ |
||
| 2612 | 2 | public function sarext( |
|
| 2641 | |||
| 2642 | /** |
||
| 2643 | * Set compatibility mode. |
||
| 2644 | * |
||
| 2645 | * Set compatibility mode which will affect the way calculations are done by all the extension functions. |
||
| 2646 | * |
||
| 2647 | * @param int $compatId Compatibility Id. COMPATIBILITY_* series of constants should be used. |
||
| 2648 | */ |
||
| 2649 | 2 | public function set_compat(int $compatId) |
|
| 2653 | |||
| 2654 | /** |
||
| 2655 | * Set unstable period. |
||
| 2656 | * |
||
| 2657 | * Influences unstable period factor for functions, which are sensible to it. More information about unstable periods can be found on the » TA-Lib API documentation page. |
||
| 2658 | * |
||
| 2659 | * @param int $functionId Function ID the factor should be set for. FUNC_UNST_* constant series can be used to affect the corresponding function. |
||
| 2660 | * @param int $timePeriod Unstable period value. |
||
| 2661 | */ |
||
| 2662 | 2 | public function set_unstable_period(int $functionId, int $timePeriod) |
|
| 2666 | |||
| 2667 | /** |
||
| 2668 | * Vector Trigonometric Sin. |
||
| 2669 | * |
||
| 2670 | * Calculates the sine for each value in real and returns the resulting array. |
||
| 2671 | * |
||
| 2672 | * @param array $real Array of real values. |
||
| 2673 | * |
||
| 2674 | * @return array Returns an array with calculated data. |
||
| 2675 | */ |
||
| 2676 | 2 | public function sin(array $real): array |
|
| 2684 | |||
| 2685 | /** |
||
| 2686 | * Vector Trigonometric Sinh. |
||
| 2687 | * |
||
| 2688 | * Calculates the hyperbolic sine for each value in real and returns the resulting array. |
||
| 2689 | * |
||
| 2690 | * @param array $real Array of real values. |
||
| 2691 | * |
||
| 2692 | * @return array Returns an array with calculated data. |
||
| 2693 | */ |
||
| 2694 | 2 | public function sinh(array $real): array |
|
| 2702 | |||
| 2703 | /** |
||
| 2704 | * Simple Moving Average. |
||
| 2705 | * |
||
| 2706 | * @param array $real Array of real values. |
||
| 2707 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2708 | * |
||
| 2709 | * @return array Returns an array with calculated data. |
||
| 2710 | */ |
||
| 2711 | 2 | public function sma(array $real, int $timePeriod = 30): array |
|
| 2719 | |||
| 2720 | /** |
||
| 2721 | * Vector Square Root. |
||
| 2722 | * |
||
| 2723 | * Calculates the square root of each value in real and returns the resulting array. |
||
| 2724 | * |
||
| 2725 | * @param array $real Array of real values. |
||
| 2726 | * |
||
| 2727 | * @return array Returns an array with calculated data. |
||
| 2728 | */ |
||
| 2729 | 2 | public function sqrt(array $real): array |
|
| 2737 | |||
| 2738 | /** |
||
| 2739 | * Standard Deviation. |
||
| 2740 | * |
||
| 2741 | * @param array $real Array of real values. |
||
| 2742 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2743 | * @param float $nbDev Number of deviations |
||
| 2744 | * |
||
| 2745 | * @return array Returns an array with calculated data. |
||
| 2746 | */ |
||
| 2747 | 2 | public function stddev(array $real, int $timePeriod = 5, float $nbDev = 1.0): array |
|
| 2755 | |||
| 2756 | /** |
||
| 2757 | * Stochastic. |
||
| 2758 | * |
||
| 2759 | * @param array $high High price, array of real values. |
||
| 2760 | * @param array $low Low price, array of real values. |
||
| 2761 | * @param array $close Time period for building the Fast-K line. Valid range from 1 to 100000. |
||
| 2762 | * @param int $fastK_Period Time period for building the Fast-K line. Valid range from 1 to 100000. |
||
| 2763 | * @param int $slowK_Period Smoothing for making the Slow-K line. Valid range from 1 to 100000, usually set to 3. |
||
| 2764 | * @param int $slowK_MAType Type of Moving Average for Slow-K. MA_TYPE_* series of constants should be used. |
||
| 2765 | * @param int $slowD_Period Smoothing for making the Slow-D line. Valid range from 1 to 100000. |
||
| 2766 | * @param int $slowD_MAType Type of Moving Average for Slow-D. MA_TYPE_* series of constants should be used. |
||
| 2767 | * |
||
| 2768 | * @return array Returns an array with calculated data. |
||
| 2769 | */ |
||
| 2770 | 2 | public function stoch( |
|
| 2795 | |||
| 2796 | /** |
||
| 2797 | * Stochastic Fast. |
||
| 2798 | * |
||
| 2799 | * @param array $high High price, array of real values. |
||
| 2800 | * @param array $low Low price, array of real values. |
||
| 2801 | * @param array $close Time period for building the Fast-K line. Valid range from 1 to 100000. |
||
| 2802 | * @param int $fastK_Period Time period for building the Fast-K line. Valid range from 1 to 100000. |
||
| 2803 | * @param int $fastD_Period Smoothing for making the Fast-D line. Valid range from 1 to 100000, usually set to 3. |
||
| 2804 | * @param int $fastD_MAType Type of Moving Average for Fast-D. MA_TYPE_* series of constants should be used. |
||
| 2805 | * |
||
| 2806 | * @return array Returns an array with calculated data. |
||
| 2807 | */ |
||
| 2808 | 2 | public function stochf( |
|
| 2829 | |||
| 2830 | /** |
||
| 2831 | * Stochastic Relative Strength Index. |
||
| 2832 | * |
||
| 2833 | * @param array $real Array of real values. |
||
| 2834 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2835 | * @param int $fastK_Period Time period for building the Fast-K line. Valid range from 1 to 100000. |
||
| 2836 | * @param int $fastD_Period Smoothing for making the Fast-D line. Valid range from 1 to 100000, usually set to 3. |
||
| 2837 | * @param int $fastD_MAType Type of Moving Average for Fast-D. MA_TYPE_* series of constants should be used. |
||
| 2838 | * |
||
| 2839 | * @return array Returns an array with calculated data. |
||
| 2840 | */ |
||
| 2841 | 2 | public function stochrsi( |
|
| 2860 | |||
| 2861 | /** |
||
| 2862 | * Vector Arithmetic Subtraction. |
||
| 2863 | * |
||
| 2864 | * Calculates the vector subtraction of real1 from real0 and returns the resulting vector. |
||
| 2865 | * |
||
| 2866 | * @param array $real0 Array of real values. |
||
| 2867 | * @param array $real1 Array of real values. |
||
| 2868 | * |
||
| 2869 | * @return array Returns an array with calculated data. |
||
| 2870 | */ |
||
| 2871 | 2 | public function sub(array $real0, array $real1): array |
|
| 2879 | |||
| 2880 | /** |
||
| 2881 | * Summation. |
||
| 2882 | * |
||
| 2883 | * @param array $real Array of real values. |
||
| 2884 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2885 | * |
||
| 2886 | * @return array Returns an array with calculated data. |
||
| 2887 | */ |
||
| 2888 | 2 | public function sum(array $real, int $timePeriod = 30): array |
|
| 2896 | |||
| 2897 | /** |
||
| 2898 | * Triple Exponential Moving Average (T3). |
||
| 2899 | * |
||
| 2900 | * @param array $real Array of real values. |
||
| 2901 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2902 | * @param float $vFactor Volume Factor. Valid range from 1 to 0. |
||
| 2903 | * |
||
| 2904 | * @return array Returns an array with calculated data. |
||
| 2905 | */ |
||
| 2906 | 2 | public function t3(array $real, int $timePeriod = 5, float $vFactor = 0.7): array |
|
| 2914 | |||
| 2915 | /** |
||
| 2916 | * Vector Trigonometric Tan. |
||
| 2917 | * |
||
| 2918 | * Calculates the tangent for each value in real and returns the resulting array. |
||
| 2919 | * |
||
| 2920 | * @param array $real Array of real values. |
||
| 2921 | * |
||
| 2922 | * @return array Returns an array with calculated data. |
||
| 2923 | */ |
||
| 2924 | 2 | public function tan(array $real): array |
|
| 2932 | |||
| 2933 | /** |
||
| 2934 | * Vector Trigonometric Tanh. |
||
| 2935 | * |
||
| 2936 | * Calculates the hyperbolic tangent for each value in real and returns the resulting array. |
||
| 2937 | * |
||
| 2938 | * @param array $real Array of real values. |
||
| 2939 | * |
||
| 2940 | * @return array Returns an array with calculated data. |
||
| 2941 | */ |
||
| 2942 | 2 | public function tanh(array $real): array |
|
| 2950 | |||
| 2951 | /** |
||
| 2952 | * Triple Exponential Moving Average. |
||
| 2953 | * |
||
| 2954 | * @param array $real Array of real values. |
||
| 2955 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2956 | * |
||
| 2957 | * @return array Returns an array with calculated data. |
||
| 2958 | */ |
||
| 2959 | 2 | public function tema(array $real, int $timePeriod = 30): array |
|
| 2967 | |||
| 2968 | /** |
||
| 2969 | * True Range. |
||
| 2970 | * |
||
| 2971 | * @param array $high High price, array of real values. |
||
| 2972 | * @param array $low Low price, array of real values. |
||
| 2973 | * @param array $close Closing price, array of real values. |
||
| 2974 | * |
||
| 2975 | * @return array Returns an array with calculated data. |
||
| 2976 | */ |
||
| 2977 | 2 | public function trange(array $high, array $low, array $close): array |
|
| 2985 | |||
| 2986 | /** |
||
| 2987 | * Triangular Moving Average. |
||
| 2988 | * |
||
| 2989 | * @param array $real Array of real values. |
||
| 2990 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 2991 | * |
||
| 2992 | * @return array Returns an array with calculated data. |
||
| 2993 | */ |
||
| 2994 | 2 | public function trima(array $real, int $timePeriod = 30): array |
|
| 3002 | |||
| 3003 | /** |
||
| 3004 | * 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA. |
||
| 3005 | * |
||
| 3006 | * @param array $real Array of real values. |
||
| 3007 | * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. |
||
| 3008 | * |
||
| 3009 | * @return array Returns an array with calculated data. |
||
| 3010 | */ |
||
| 3011 | 2 | public function trix(array $real, int $timePeriod = 30): array |
|
| 3019 | |||
| 3020 | /** |
||
| 3021 | * Time Series Forecast. |
||
| 3022 | * |
||
| 3023 | * @param array $real Array of real values. |
||
| 3024 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 3025 | * |
||
| 3026 | * @return array Returns an array with calculated data. |
||
| 3027 | */ |
||
| 3028 | 2 | public function tsf(array $real, int $timePeriod = 14): array |
|
| 3036 | |||
| 3037 | /** |
||
| 3038 | * Typical Price. |
||
| 3039 | * |
||
| 3040 | * @param array $high High price, array of real values. |
||
| 3041 | * @param array $low Low price, array of real values. |
||
| 3042 | * @param array $close Closing price, array of real values. |
||
| 3043 | * |
||
| 3044 | * @return array Returns an array with calculated data. |
||
| 3045 | */ |
||
| 3046 | 2 | public function typprice(array $high, array $low, array $close): array |
|
| 3054 | |||
| 3055 | /** |
||
| 3056 | * Ultimate Oscillator. |
||
| 3057 | * |
||
| 3058 | * @param array $high High price, array of real values. |
||
| 3059 | * @param array $low Low price, array of real values. |
||
| 3060 | * @param array $close Closing price, array of real values. |
||
| 3061 | * @param int $timePeriod1 Number of bars for 1st period. Valid range from 1 to 100000. |
||
| 3062 | * @param int $timePeriod2 Number of bars for 2nd period. Valid range from 1 to 100000. |
||
| 3063 | * @param int $timePeriod3 Number of bars for 3rd period. Valid range from 1 to 100000. |
||
| 3064 | * |
||
| 3065 | * @return array Returns an array with calculated data. |
||
| 3066 | */ |
||
| 3067 | 2 | public function ultosc( |
|
| 3081 | |||
| 3082 | /** |
||
| 3083 | * Variance. |
||
| 3084 | * |
||
| 3085 | * @param array $real Array of real values. |
||
| 3086 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 3087 | * @param float $nbDev Number of deviations |
||
| 3088 | * |
||
| 3089 | * @return array Returns an array with calculated data. |
||
| 3090 | */ |
||
| 3091 | 2 | public function var(array $real, int $timePeriod = 5, float $nbDev = 1.0): array |
|
| 3099 | |||
| 3100 | /** |
||
| 3101 | * Weighted Close Price. |
||
| 3102 | * |
||
| 3103 | * @param array $high High price, array of real values. |
||
| 3104 | * @param array $low Low price, array of real values. |
||
| 3105 | * @param array $close Closing price, array of real values. |
||
| 3106 | * |
||
| 3107 | * @return array Returns an array with calculated data. |
||
| 3108 | */ |
||
| 3109 | 2 | public function wclprice(array $high, array $low, array $close): array |
|
| 3117 | |||
| 3118 | /** |
||
| 3119 | * Williams' %R. |
||
| 3120 | * |
||
| 3121 | * @param array $high High price, array of real values. |
||
| 3122 | * @param array $low Low price, array of real values. |
||
| 3123 | * @param array $close Closing price, array of real values. |
||
| 3124 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 3125 | * |
||
| 3126 | * @return array Returns an array with calculated data. |
||
| 3127 | */ |
||
| 3128 | 2 | public function willr(array $high, array $low, array $close, int $timePeriod = 14): array |
|
| 3136 | |||
| 3137 | /** |
||
| 3138 | * Weighted Moving Average. |
||
| 3139 | * |
||
| 3140 | * @param array $real Array of real values. |
||
| 3141 | * @param int $timePeriod Number of period. Valid range from 2 to 100000. |
||
| 3142 | * |
||
| 3143 | * @return array Returns an array with calculated data. |
||
| 3144 | */ |
||
| 3145 | 4 | public function wma(array $real, int $timePeriod = 30): array |
|
| 3153 | |||
| 3154 | /** |
||
| 3155 | * Handle errors. |
||
| 3156 | */ |
||
| 3157 | 318 | protected function handleErrors() |
|
| 3164 | } |
||
| 3165 |