diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..8f389ad --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,7 @@ +version = 1 + +test_patterns = ["Tests/*Test.php"] + +[[analyzers]] +name = "php" +enabled = true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4fbbbfe..ac168b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ .* !/.gitignore -vendor/ +!/.gitlab-ci.yml +/vendor/ +/logs/ +/metrics/ +*.bat diff --git a/README.md b/README.md index d0df610..1c85827 100644 --- a/README.md +++ b/README.md @@ -8,19 +8,21 @@ The extension and the source for it can be downloaded there. This project is just an interface to that extension, and does not work without it. +If you cannot install the PECL extension, try the [PHP Trader Native](https://github.com/LupeCode/phpTraderNative) project instead. + ### Requires PHP 7.0.0 or newer Variable types are set on all function parameters. -## Note About Mis-documented Functions - -The php.net documentation for trader_ht_phasor and trader_ht_sine are incorrect. This was discovered through unit testing of this interface. Both functions require a second parameter, a by reference array that extra data will be written into. +### Requires PECL Trader 0.4.1 or newer. -This interface has the correct version of those functions. +If you are using version 0.4.0, see the branch `trader-0.4.0` for that. -### Bug in Trader 0.4.0 +## Purpose -The PECL Trader package version 0.4.0 has a bug regarding the two functions above. Though the output parameters are required for the function to execute, they are not used. The returned array is a 2-Dimensional array with the return value and the output parameter combined. +This package is meant to help when using the Trader PECL package. +This is helpful if you do not have the code stub for the Trader Extension. +Loading this interface will provide your IDE with the function information and auto completing. ## How to use @@ -32,10 +34,21 @@ You can now use the exact named or the friendly named `\LupeCode\phpTraderInterface\Trader::pearsonCorrelationCoefficient($Open, $Close, 30)` -This is helpful if you do not have the code stub for the Trader Extension. Loading this interface will provide your IDE with the function information and auto completing. +## Metrics & Coverage +### PHP Metrics Report +To see the current report of metrics by PHP Metrics, visit [Metrics](https://projects.lupecode.com/phpTraderInterface/metrics/) +### PHP Unit Coverage +To see the current report of coverage by PHP Unit, visit [Coverage](https://projects.lupecode.com/phpTraderInterface/logs/report/) +### PHP Unit Test Results + * PHP 7.0 NTS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.0NTS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.0NTS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.0NTS.html) + * PHP 7.0 TS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.0TS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.0TS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.0TS.html) + * PHP 7.1 NTS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.1NTS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.1NTS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.1NTS.html) + * PHP 7.1 TS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.1TS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.1TS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.1TS.html) + * PHP 7.2 NTS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.2NTS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.2NTS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.2TS.html) + * PHP 7.2 TS [[XML]](https://projects.lupecode.com/phpTraderInterface/logs/logfile-7.2TS.xml) [[TXT]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.2TS.txt) [[HTML]](https://projects.lupecode.com/phpTraderInterface/logs/testdox-7.2TS.html) ## License -Copyright (C) 2016 Lupe Code, LLC.; Joshua Saige +Copyright (C) Lupe Code, LLC.; Joshua Lopez This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/Tests/TraderTest.php b/Tests/TraderTest.php index 72f079f..406200c 100644 --- a/Tests/TraderTest.php +++ b/Tests/TraderTest.php @@ -1,13 +1,15 @@ protected $Open = [ '37.560001', '36.889999', '36.25', '35.580002', '35.869999', '36.400002', '37.639999', '37.369999', @@ -178,1883 +180,1876 @@ class TraderTest extends PHPUnit_Framework_TestCase '14861600', '14752100', '14864300', '8462400', '9147300', '9506500', '8713200', '10057600', '16909400', '20529200', '19432500', '11803400', '7713000', '6398400', ]; + // -// + // public function testConstants_TRADER_MA_TYPE_SMA() { - $this->assertEquals(TRADER_MA_TYPE_SMA, Trader::$TRADER_MA_TYPE_SMA); + self::assertEquals(TRADER_MA_TYPE_SMA, Trader::$TRADER_MA_TYPE_SMA); } public function testConstants_TRADER_MA_TYPE_EMA() { - $this->assertEquals(TRADER_MA_TYPE_EMA, Trader::$TRADER_MA_TYPE_EMA); + self::assertEquals(TRADER_MA_TYPE_EMA, Trader::$TRADER_MA_TYPE_EMA); } public function testConstants_TRADER_MA_TYPE_WMA() { - $this->assertEquals(TRADER_MA_TYPE_WMA, Trader::$TRADER_MA_TYPE_WMA); + self::assertEquals(TRADER_MA_TYPE_WMA, Trader::$TRADER_MA_TYPE_WMA); } public function testConstants_TRADER_MA_TYPE_DEMA() { - $this->assertEquals(TRADER_MA_TYPE_DEMA, Trader::$TRADER_MA_TYPE_DEMA); + self::assertEquals(TRADER_MA_TYPE_DEMA, Trader::$TRADER_MA_TYPE_DEMA); } public function testConstants_TRADER_MA_TYPE_TEMA() { - $this->assertEquals(TRADER_MA_TYPE_TEMA, Trader::$TRADER_MA_TYPE_TEMA); + self::assertEquals(TRADER_MA_TYPE_TEMA, Trader::$TRADER_MA_TYPE_TEMA); } public function testConstants_TRADER_MA_TYPE_TRIMA() { - $this->assertEquals(TRADER_MA_TYPE_TRIMA, Trader::$TRADER_MA_TYPE_TRIMA); + self::assertEquals(TRADER_MA_TYPE_TRIMA, Trader::$TRADER_MA_TYPE_TRIMA); } public function testConstants_TRADER_MA_TYPE_KAMA() { - $this->assertEquals(TRADER_MA_TYPE_KAMA, Trader::$TRADER_MA_TYPE_KAMA); + self::assertEquals(TRADER_MA_TYPE_KAMA, Trader::$TRADER_MA_TYPE_KAMA); } public function testConstants_TRADER_MA_TYPE_MAMA() { - $this->assertEquals(TRADER_MA_TYPE_MAMA, Trader::$TRADER_MA_TYPE_MAMA); + self::assertEquals(TRADER_MA_TYPE_MAMA, Trader::$TRADER_MA_TYPE_MAMA); } public function testConstants_TRADER_MA_TYPE_T3() { - $this->assertEquals(TRADER_MA_TYPE_T3, Trader::$TRADER_MA_TYPE_T3); + self::assertEquals(TRADER_MA_TYPE_T3, Trader::$TRADER_MA_TYPE_T3); } public function testConstants_TRADER_REAL_MIN() { - $this->assertEquals(TRADER_REAL_MIN, Trader::$TRADER_REAL_MIN); + self::assertEquals(TRADER_REAL_MIN, Trader::$TRADER_REAL_MIN); } public function testConstants_TRADER_REAL_MAX() { - $this->assertEquals(TRADER_REAL_MAX, Trader::$TRADER_REAL_MAX); + self::assertEquals(TRADER_REAL_MAX, Trader::$TRADER_REAL_MAX); } public function testConstants_TRADER_FUNC_UNST_ADX() { - $this->assertEquals(TRADER_FUNC_UNST_ADX, Trader::$TRADER_FUNC_UNST_ADX); + self::assertEquals(TRADER_FUNC_UNST_ADX, Trader::$TRADER_FUNC_UNST_ADX); } public function testConstants_TRADER_FUNC_UNST_ADXR() { - $this->assertEquals(TRADER_FUNC_UNST_ADXR, Trader::$TRADER_FUNC_UNST_ADXR); + self::assertEquals(TRADER_FUNC_UNST_ADXR, Trader::$TRADER_FUNC_UNST_ADXR); } public function testConstants_TRADER_FUNC_UNST_ATR() { - $this->assertEquals(TRADER_FUNC_UNST_ATR, Trader::$TRADER_FUNC_UNST_ATR); + self::assertEquals(TRADER_FUNC_UNST_ATR, Trader::$TRADER_FUNC_UNST_ATR); } public function testConstants_TRADER_FUNC_UNST_CMO() { - $this->assertEquals(TRADER_FUNC_UNST_CMO, Trader::$TRADER_FUNC_UNST_CMO); + self::assertEquals(TRADER_FUNC_UNST_CMO, Trader::$TRADER_FUNC_UNST_CMO); } public function testConstants_TRADER_FUNC_UNST_DX() { - $this->assertEquals(TRADER_FUNC_UNST_DX, Trader::$TRADER_FUNC_UNST_DX); + self::assertEquals(TRADER_FUNC_UNST_DX, Trader::$TRADER_FUNC_UNST_DX); } public function testConstants_TRADER_FUNC_UNST_EMA() { - $this->assertEquals(TRADER_FUNC_UNST_EMA, Trader::$TRADER_FUNC_UNST_EMA); + self::assertEquals(TRADER_FUNC_UNST_EMA, Trader::$TRADER_FUNC_UNST_EMA); } public function testConstants_TRADER_FUNC_UNST_HT_DCPERIOD() { - $this->assertEquals(TRADER_FUNC_UNST_HT_DCPERIOD, Trader::$TRADER_FUNC_UNST_HT_DCPERIOD); + self::assertEquals(TRADER_FUNC_UNST_HT_DCPERIOD, Trader::$TRADER_FUNC_UNST_HT_DCPERIOD); } public function testConstants_TRADER_FUNC_UNST_HT_DCPHASE() { - $this->assertEquals(TRADER_FUNC_UNST_HT_DCPHASE, Trader::$TRADER_FUNC_UNST_HT_DCPHASE); + self::assertEquals(TRADER_FUNC_UNST_HT_DCPHASE, Trader::$TRADER_FUNC_UNST_HT_DCPHASE); } public function testConstants_TRADER_FUNC_UNST_HT_PHASOR() { - $this->assertEquals(TRADER_FUNC_UNST_HT_PHASOR, Trader::$TRADER_FUNC_UNST_HT_PHASOR); + self::assertEquals(TRADER_FUNC_UNST_HT_PHASOR, Trader::$TRADER_FUNC_UNST_HT_PHASOR); } public function testConstants_TRADER_FUNC_UNST_HT_TRENDLINE() { - $this->assertEquals(TRADER_FUNC_UNST_HT_TRENDLINE, Trader::$TRADER_FUNC_UNST_HT_TRENDLINE); + self::assertEquals(TRADER_FUNC_UNST_HT_TRENDLINE, Trader::$TRADER_FUNC_UNST_HT_TRENDLINE); } public function testConstants_TRADER_FUNC_UNST_HT_TRENDMODE() { - $this->assertEquals(TRADER_FUNC_UNST_HT_TRENDMODE, Trader::$TRADER_FUNC_UNST_HT_TRENDMODE); + self::assertEquals(TRADER_FUNC_UNST_HT_TRENDMODE, Trader::$TRADER_FUNC_UNST_HT_TRENDMODE); } public function testConstants_TRADER_FUNC_UNST_KAMA() { - $this->assertEquals(TRADER_FUNC_UNST_KAMA, Trader::$TRADER_FUNC_UNST_KAMA); + self::assertEquals(TRADER_FUNC_UNST_KAMA, Trader::$TRADER_FUNC_UNST_KAMA); } public function testConstants_TRADER_FUNC_UNST_MAMA() { - $this->assertEquals(TRADER_FUNC_UNST_MAMA, Trader::$TRADER_FUNC_UNST_MAMA); + self::assertEquals(TRADER_FUNC_UNST_MAMA, Trader::$TRADER_FUNC_UNST_MAMA); } public function testConstants_TRADER_FUNC_UNST_MFI() { - $this->assertEquals(TRADER_FUNC_UNST_MFI, Trader::$TRADER_FUNC_UNST_MFI); + self::assertEquals(TRADER_FUNC_UNST_MFI, Trader::$TRADER_FUNC_UNST_MFI); } public function testConstants_TRADER_FUNC_UNST_MINUS_DI() { - $this->assertEquals(TRADER_FUNC_UNST_MINUS_DI, Trader::$TRADER_FUNC_UNST_MINUS_DI); + self::assertEquals(TRADER_FUNC_UNST_MINUS_DI, Trader::$TRADER_FUNC_UNST_MINUS_DI); } public function testConstants_TRADER_FUNC_UNST_MINUS_DM() { - $this->assertEquals(TRADER_FUNC_UNST_MINUS_DM, Trader::$TRADER_FUNC_UNST_MINUS_DM); + self::assertEquals(TRADER_FUNC_UNST_MINUS_DM, Trader::$TRADER_FUNC_UNST_MINUS_DM); } public function testConstants_TRADER_FUNC_UNST_NATR() { - $this->assertEquals(TRADER_FUNC_UNST_NATR, Trader::$TRADER_FUNC_UNST_NATR); + self::assertEquals(TRADER_FUNC_UNST_NATR, Trader::$TRADER_FUNC_UNST_NATR); } public function testConstants_TRADER_FUNC_UNST_PLUS_DI() { - $this->assertEquals(TRADER_FUNC_UNST_PLUS_DI, Trader::$TRADER_FUNC_UNST_PLUS_DI); + self::assertEquals(TRADER_FUNC_UNST_PLUS_DI, Trader::$TRADER_FUNC_UNST_PLUS_DI); } public function testConstants_TRADER_FUNC_UNST_PLUS_DM() { - $this->assertEquals(TRADER_FUNC_UNST_PLUS_DM, Trader::$TRADER_FUNC_UNST_PLUS_DM); + self::assertEquals(TRADER_FUNC_UNST_PLUS_DM, Trader::$TRADER_FUNC_UNST_PLUS_DM); } public function testConstants_TRADER_FUNC_UNST_RSI() { - $this->assertEquals(TRADER_FUNC_UNST_RSI, Trader::$TRADER_FUNC_UNST_RSI); + self::assertEquals(TRADER_FUNC_UNST_RSI, Trader::$TRADER_FUNC_UNST_RSI); } public function testConstants_TRADER_FUNC_UNST_STOCHRSI() { - $this->assertEquals(TRADER_FUNC_UNST_STOCHRSI, Trader::$TRADER_FUNC_UNST_STOCHRSI); + self::assertEquals(TRADER_FUNC_UNST_STOCHRSI, Trader::$TRADER_FUNC_UNST_STOCHRSI); } public function testConstants_TRADER_FUNC_UNST_T3() { - $this->assertEquals(TRADER_FUNC_UNST_T3, Trader::$TRADER_FUNC_UNST_T3); + self::assertEquals(TRADER_FUNC_UNST_T3, Trader::$TRADER_FUNC_UNST_T3); } public function testConstants_TRADER_FUNC_UNST_ALL() { - $this->assertEquals(TRADER_FUNC_UNST_ALL, Trader::$TRADER_FUNC_UNST_ALL); + self::assertEquals(TRADER_FUNC_UNST_ALL, Trader::$TRADER_FUNC_UNST_ALL); } public function testConstants_TRADER_FUNC_UNST_NONE() { - $this->assertEquals(TRADER_FUNC_UNST_NONE, Trader::$TRADER_FUNC_UNST_NONE); + self::assertEquals(TRADER_FUNC_UNST_NONE, Trader::$TRADER_FUNC_UNST_NONE); } public function testConstants_TRADER_COMPATIBILITY_DEFAULT() { - $this->assertEquals(TRADER_COMPATIBILITY_DEFAULT, Trader::$TRADER_COMPATIBILITY_DEFAULT); + self::assertEquals(TRADER_COMPATIBILITY_DEFAULT, Trader::$TRADER_COMPATIBILITY_DEFAULT); } public function testConstants_TRADER_COMPATIBILITY_METASTOCK() { - $this->assertEquals(TRADER_COMPATIBILITY_METASTOCK, Trader::$TRADER_COMPATIBILITY_METASTOCK); + self::assertEquals(TRADER_COMPATIBILITY_METASTOCK, Trader::$TRADER_COMPATIBILITY_METASTOCK); } public function testConstants_TRADER_ERR_SUCCESS() { - $this->assertEquals(TRADER_ERR_SUCCESS, Trader::$TRADER_ERR_SUCCESS); + self::assertEquals(TRADER_ERR_SUCCESS, Trader::$TRADER_ERR_SUCCESS); } public function testConstants_TRADER_ERR_LIB_NOT_INITIALIZE() { - $this->assertEquals(TRADER_ERR_LIB_NOT_INITIALIZE, Trader::$TRADER_ERR_LIB_NOT_INITIALIZE); + self::assertEquals(TRADER_ERR_LIB_NOT_INITIALIZE, Trader::$TRADER_ERR_LIB_NOT_INITIALIZE); } public function testConstants_TRADER_ERR_BAD_PARAM() { - $this->assertEquals(TRADER_ERR_BAD_PARAM, Trader::$TRADER_ERR_BAD_PARAM); + self::assertEquals(TRADER_ERR_BAD_PARAM, Trader::$TRADER_ERR_BAD_PARAM); } public function testConstants_TRADER_ERR_ALLOC_ERR() { - $this->assertEquals(TRADER_ERR_ALLOC_ERR, Trader::$TRADER_ERR_ALLOC_ERR); + self::assertEquals(TRADER_ERR_ALLOC_ERR, Trader::$TRADER_ERR_ALLOC_ERR); } public function testConstants_TRADER_ERR_GROUP_NOT_FOUND() { - $this->assertEquals(TRADER_ERR_GROUP_NOT_FOUND, Trader::$TRADER_ERR_GROUP_NOT_FOUND); + self::assertEquals(TRADER_ERR_GROUP_NOT_FOUND, Trader::$TRADER_ERR_GROUP_NOT_FOUND); } public function testConstants_TRADER_ERR_FUNC_NOT_FOUND() { - $this->assertEquals(TRADER_ERR_FUNC_NOT_FOUND, Trader::$TRADER_ERR_FUNC_NOT_FOUND); + self::assertEquals(TRADER_ERR_FUNC_NOT_FOUND, Trader::$TRADER_ERR_FUNC_NOT_FOUND); } public function testConstants_TRADER_ERR_INVALID_HANDLE() { - $this->assertEquals(TRADER_ERR_INVALID_HANDLE, Trader::$TRADER_ERR_INVALID_HANDLE); + self::assertEquals(TRADER_ERR_INVALID_HANDLE, Trader::$TRADER_ERR_INVALID_HANDLE); } public function testConstants_TRADER_ERR_INVALID_PARAM_HOLDER() { - $this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER, Trader::$TRADER_ERR_INVALID_PARAM_HOLDER); + self::assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER, Trader::$TRADER_ERR_INVALID_PARAM_HOLDER); } public function testConstants_TRADER_ERR_INVALID_PARAM_HOLDER_TYPE() { - $this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER_TYPE, Trader::$TRADER_ERR_INVALID_PARAM_HOLDER_TYPE); + self::assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER_TYPE, Trader::$TRADER_ERR_INVALID_PARAM_HOLDER_TYPE); } public function testConstants_TRADER_ERR_INVALID_PARAM_FUNCTION() { - $this->assertEquals(TRADER_ERR_INVALID_PARAM_FUNCTION, Trader::$TRADER_ERR_INVALID_PARAM_FUNCTION); + self::assertEquals(TRADER_ERR_INVALID_PARAM_FUNCTION, Trader::$TRADER_ERR_INVALID_PARAM_FUNCTION); } public function testConstants_TRADER_ERR_INPUT_NOT_ALL_INITIALIZE() { - $this->assertEquals(TRADER_ERR_INPUT_NOT_ALL_INITIALIZE, Trader::$TRADER_ERR_INPUT_NOT_ALL_INITIALIZE); + self::assertEquals(TRADER_ERR_INPUT_NOT_ALL_INITIALIZE, Trader::$TRADER_ERR_INPUT_NOT_ALL_INITIALIZE); } public function testConstants_TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE() { - $this->assertEquals(TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE, Trader::$TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE); + self::assertEquals(TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE, Trader::$TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE); } public function testConstants_TRADER_ERR_OUT_OF_RANGE_START_INDEX() { - $this->assertEquals(TRADER_ERR_OUT_OF_RANGE_START_INDEX, Trader::$TRADER_ERR_OUT_OF_RANGE_START_INDEX); + self::assertEquals(TRADER_ERR_OUT_OF_RANGE_START_INDEX, Trader::$TRADER_ERR_OUT_OF_RANGE_START_INDEX); } public function testConstants_TRADER_ERR_OUT_OF_RANGE_END_INDEX() { - $this->assertEquals(TRADER_ERR_OUT_OF_RANGE_END_INDEX, Trader::$TRADER_ERR_OUT_OF_RANGE_END_INDEX); + self::assertEquals(TRADER_ERR_OUT_OF_RANGE_END_INDEX, Trader::$TRADER_ERR_OUT_OF_RANGE_END_INDEX); } public function testConstants_TRADER_ERR_INVALID_LIST_TYPE() { - $this->assertEquals(TRADER_ERR_INVALID_LIST_TYPE, Trader::$TRADER_ERR_INVALID_LIST_TYPE); + self::assertEquals(TRADER_ERR_INVALID_LIST_TYPE, Trader::$TRADER_ERR_INVALID_LIST_TYPE); } public function testConstants_TRADER_ERR_BAD_OBJECT() { - $this->assertEquals(TRADER_ERR_BAD_OBJECT, Trader::$TRADER_ERR_BAD_OBJECT); + self::assertEquals(TRADER_ERR_BAD_OBJECT, Trader::$TRADER_ERR_BAD_OBJECT); } public function testConstants_TRADER_ERR_NOT_SUPPORTED() { - $this->assertEquals(TRADER_ERR_NOT_SUPPORTED, Trader::$TRADER_ERR_NOT_SUPPORTED); + self::assertEquals(TRADER_ERR_NOT_SUPPORTED, Trader::$TRADER_ERR_NOT_SUPPORTED); } public function testConstants_TRADER_ERR_INTERNAL_ERROR() { - $this->assertEquals(TRADER_ERR_INTERNAL_ERROR, Trader::$TRADER_ERR_INTERNAL_ERROR); + self::assertEquals(TRADER_ERR_INTERNAL_ERROR, Trader::$TRADER_ERR_INTERNAL_ERROR); } public function testConstants_TRADER_ERR_UNKNOWN_ERROR() { - $this->assertEquals(TRADER_ERR_UNKNOWN_ERROR, Trader::$TRADER_ERR_UNKNOWN_ERROR); + self::assertEquals(TRADER_ERR_UNKNOWN_ERROR, Trader::$TRADER_ERR_UNKNOWN_ERROR); } -// + // -// + // public function testInterfaceFunctions_acos() { - $this->assertEquals(trader_acos(array_map('cos', $this->Close)), Trader::acos(array_map('cos', $this->Close))); + self::assertEquals(trader_acos(array_map('cos', $this->Close)), Trader::acos(array_map('cos', $this->Close))); } public function testInterfaceFunctions_ad() { - $this->assertEquals(trader_ad($this->High, $this->Low, $this->Close, $this->Volume), Trader::ad($this->High, $this->Low, $this->Close, $this->Volume)); + self::assertEquals(trader_ad($this->High, $this->Low, $this->Close, $this->Volume), Trader::ad($this->High, $this->Low, $this->Close, $this->Volume)); } public function testInterfaceFunctions_add() { - $this->assertEquals(trader_add($this->High, $this->Low), Trader::add($this->High, $this->Low)); + self::assertEquals(trader_add($this->High, $this->Low), Trader::add($this->High, $this->Low)); } public function testInterfaceFunctions_adosc() { - $this->assertEquals(trader_adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10), Trader::adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10)); + self::assertEquals(trader_adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10), Trader::adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10)); } public function testInterfaceFunctions_adx() { - $this->assertEquals(trader_adx($this->High, $this->Low, $this->Close, 14), Trader::adx($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_adx($this->High, $this->Low, $this->Close, 14), Trader::adx($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_adxr() { - $this->assertEquals(trader_adxr($this->High, $this->Low, $this->Close, 14), Trader::adxr($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_adxr($this->High, $this->Low, $this->Close, 14), Trader::adxr($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_apo() { - $this->assertEquals(trader_apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_aroon() { - $this->assertEquals(trader_aroon($this->High, $this->Low, 14), Trader::aroon($this->High, $this->Low, 14)); + self::assertEquals(trader_aroon($this->High, $this->Low, 14), Trader::aroon($this->High, $this->Low, 14)); } public function testInterfaceFunctions_arronosc() { - $this->assertEquals(trader_aroonosc($this->High, $this->Low, 14), Trader::aroonosc($this->High, $this->Low, 14)); + self::assertEquals(trader_aroonosc($this->High, $this->Low, 14), Trader::aroonosc($this->High, $this->Low, 14)); } public function testInterfaceFunctions_asin() { - $this->assertEquals(trader_asin(array_map('sin', $this->Close)), Trader::asin(array_map('sin', $this->Close))); + self::assertEquals(trader_asin(array_map('sin', $this->Close)), Trader::asin(array_map('sin', $this->Close))); } public function testInterfaceFunctions_atan() { - $this->assertEquals(trader_atan(array_map('tan', $this->Close)), Trader::atan(array_map('tan', $this->Close))); + self::assertEquals(trader_atan(array_map('tan', $this->Close)), Trader::atan(array_map('tan', $this->Close))); } public function testInterfaceFunctions_atr() { - $this->assertEquals(trader_atr($this->High, $this->Low, $this->Close, 14), Trader::atr($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_atr($this->High, $this->Low, $this->Close, 14), Trader::atr($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_avgprice() { - $this->assertEquals(trader_avgprice($this->Open, $this->High, $this->Low, $this->Close), Trader::avgprice($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_avgprice($this->Open, $this->High, $this->Low, $this->Close), Trader::avgprice($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_bbands() { - $this->assertEquals(trader_bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA), Trader::bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA), Trader::bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_beta() { - $this->assertEquals(trader_beta($this->Open, $this->Close, 5), Trader::beta($this->Open, $this->Close, 5)); + self::assertEquals(trader_beta($this->Open, $this->Close, 5), Trader::beta($this->Open, $this->Close, 5)); } public function testInterfaceFunctions_bop() { - $this->assertEquals(trader_bop($this->Open, $this->High, $this->Low, $this->Close), Trader::bop($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_bop($this->Open, $this->High, $this->Low, $this->Close), Trader::bop($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cci() { - $this->assertEquals(trader_cci($this->High, $this->Low, $this->Close, 14), Trader::cci($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_cci($this->High, $this->Low, $this->Close, 14), Trader::cci($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_cdl2crows() { - $this->assertEquals(trader_cdl2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl2crows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl2crows($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3blackcrows() { - $this->assertEquals(trader_cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3inside() { - $this->assertEquals(trader_cdl3inside($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3inside($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3inside($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3inside($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3linestrike() { - $this->assertEquals(trader_cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3outside() { - $this->assertEquals(trader_cdl3outside($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3outside($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3outside($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3outside($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3starsinsouth() { - $this->assertEquals(trader_cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdl3whitesoldiers() { - $this->assertEquals(trader_cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close), Trader::cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlabandonedbaby() { - $this->assertEquals(trader_cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdladvanceblock() { - $this->assertEquals(trader_cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close), Trader::cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close), Trader::cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlbelthold() { - $this->assertEquals(trader_cdlbelthold($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlbelthold($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlbelthold($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlbelthold($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlbreakaway() { - $this->assertEquals(trader_cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlclosingmarubozu() { - $this->assertEquals(trader_cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlconcealbabyswall() { - $this->assertEquals(trader_cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlcounterattack() { - $this->assertEquals(trader_cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdldarkcloudcover() { - $this->assertEquals(trader_cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5)); + self::assertEquals(trader_cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5)); } public function testInterfaceFunctions_cdldoji() { - $this->assertEquals(trader_cdldoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdldojistar() { - $this->assertEquals(trader_cdldojistar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldojistar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldojistar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldojistar($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdldragonflydoji() { - $this->assertEquals(trader_cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlengulfing() { - $this->assertEquals(trader_cdlengulfing($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlengulfing($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlengulfing($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlengulfing($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdleveningdojistar() { - $this->assertEquals(trader_cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testInterfaceFunctions_cdleveningstar() { - $this->assertEquals(trader_cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testInterfaceFunctions_cdlgapsidesidewhite() { - $this->assertEquals(trader_cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlgravestonedoji() { - $this->assertEquals(trader_cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhammer() { - $this->assertEquals(trader_cdlhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhammer($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhammer($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhangingman() { - $this->assertEquals(trader_cdlhangingman($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhangingman($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhangingman($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhangingman($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlharami() { - $this->assertEquals(trader_cdlharami($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlharami($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlharami($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlharami($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlharamicross() { - $this->assertEquals(trader_cdlharamicross($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlharamicross($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlharamicross($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlharamicross($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhighwave() { - $this->assertEquals(trader_cdlhighwave($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhighwave($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhighwave($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhighwave($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhikkake() { - $this->assertEquals(trader_cdlhikkake($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhikkake($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhikkake($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhikkake($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhikkakemod() { - $this->assertEquals(trader_cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlhomingpigeon() { - $this->assertEquals(trader_cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlidentical3crows() { - $this->assertEquals(trader_cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlinneck() { - $this->assertEquals(trader_cdlinneck($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlinneck($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlinneck($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlinneck($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlinvertedhammer() { - $this->assertEquals(trader_cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlkicking() { - $this->assertEquals(trader_cdlkicking($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlkicking($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlkicking($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlkicking($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlkickingbylength() { - $this->assertEquals(trader_cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlladderbottom() { - $this->assertEquals(trader_cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdllongleggeddoji() { - $this->assertEquals(trader_cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close), Trader::cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdllongline() { - $this->assertEquals(trader_cdllongline($this->Open, $this->High, $this->Low, $this->Close), Trader::cdllongline($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdllongline($this->Open, $this->High, $this->Low, $this->Close), Trader::cdllongline($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlmarubozu() { - $this->assertEquals(trader_cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlmatchinglow() { - $this->assertEquals(trader_cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlmathold() { - $this->assertEquals(trader_cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5)); + self::assertEquals(trader_cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5)); } public function testInterfaceFunctions_cdlmorningdojistar() { - $this->assertEquals(trader_cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testInterfaceFunctions_cdlmorningstar() { - $this->assertEquals(trader_cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testInterfaceFunctions_cdlonneck() { - $this->assertEquals(trader_cdlonneck($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlonneck($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlonneck($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlonneck($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlpiercing() { - $this->assertEquals(trader_cdlpiercing($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlpiercing($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlpiercing($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlpiercing($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlrickshawman() { - $this->assertEquals(trader_cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlrisefall3methods() { - $this->assertEquals(trader_cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlseparatinglines() { - $this->assertEquals(trader_cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlshootingstar() { - $this->assertEquals(trader_cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlshortline() { - $this->assertEquals(trader_cdlshortline($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlshortline($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlshortline($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlshortline($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlspinningtop() { - $this->assertEquals(trader_cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlstalledpattern() { - $this->assertEquals(trader_cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlsticksandwich() { - $this->assertEquals(trader_cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdltakuri() { - $this->assertEquals(trader_cdltakuri($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltakuri($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltakuri($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltakuri($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdltasukigap() { - $this->assertEquals(trader_cdltasukigap($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltasukigap($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltasukigap($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltasukigap($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlthrusting() { - $this->assertEquals(trader_cdlthrusting($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlthrusting($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlthrusting($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlthrusting($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdltristar() { - $this->assertEquals(trader_cdltristar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltristar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltristar($this->Open, $this->High, $this->Low, $this->Close), Trader::cdltristar($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlunique3river() { - $this->assertEquals(trader_cdlunique3river($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlunique3river($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlunique3river($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlunique3river($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlupsidegap2crows() { - $this->assertEquals(trader_cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_cdlxsidegap3methods() { - $this->assertEquals(trader_cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_ceil() { - $this->assertEquals(trader_ceil($this->Close), Trader::ceil($this->Close)); + self::assertEquals(trader_ceil($this->Close), Trader::ceil($this->Close)); } public function testInterfaceFunctions_cmo() { - $this->assertEquals(trader_cmo($this->Close, 14), Trader::cmo($this->Close, 14)); + self::assertEquals(trader_cmo($this->Close, 14), Trader::cmo($this->Close, 14)); } public function testInterfaceFunctions_correl() { - $this->assertEquals(trader_correl($this->Open, $this->Close, 30), Trader::correl($this->Open, $this->Close, 30)); + self::assertEquals(trader_correl($this->Open, $this->Close, 30), Trader::correl($this->Open, $this->Close, 30)); } public function testInterfaceFunctions_cos() { - $this->assertEquals(trader_cos($this->Close), Trader::cos($this->Close)); + self::assertEquals(trader_cos($this->Close), Trader::cos($this->Close)); } public function testInterfaceFunctions_cosh() { - $this->assertEquals(trader_cosh($this->Close), Trader::cosh($this->Close)); + self::assertEquals(trader_cosh($this->Close), Trader::cosh($this->Close)); } public function testInterfaceFunctions_dema() { - $this->assertEquals(trader_dema($this->Close, 30), Trader::dema($this->Close, 30)); + self::assertEquals(trader_dema($this->Close, 30), Trader::dema($this->Close, 30)); } public function testInterfaceFunctions_div() { - $this->assertEquals(trader_div($this->Open, $this->Close), Trader::div($this->Open, $this->Close)); + self::assertEquals(trader_div($this->Open, $this->Close), Trader::div($this->Open, $this->Close)); } public function testInterfaceFunctions_dx() { - $this->assertEquals(trader_dx($this->High, $this->Low, $this->Close, 14), Trader::dx($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_dx($this->High, $this->Low, $this->Close, 14), Trader::dx($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_ema() { - $this->assertEquals(trader_ema($this->Close, 30), Trader::ema($this->Close, 30)); + self::assertEquals(trader_ema($this->Close, 30), Trader::ema($this->Close, 30)); } public function testInterfaceFunctions_exp() { - $this->assertEquals(trader_exp($this->Close), Trader::exp($this->Close)); + self::assertEquals(trader_exp($this->Close), Trader::exp($this->Close)); } public function testInterfaceFunctions_floor() { - $this->assertEquals(trader_floor($this->Close), Trader::floor($this->Close)); + self::assertEquals(trader_floor($this->Close), Trader::floor($this->Close)); } public function testInterfaceFunctions_ht_dcperiod() { - $this->assertEquals(trader_ht_dcperiod($this->Close), Trader::ht_dcperiod($this->Close)); + self::assertEquals(trader_ht_dcperiod($this->Close), Trader::ht_dcperiod($this->Close)); } public function testInterfaceFunctions_ht_dcphase() { - $this->assertEquals(trader_ht_dcphase($this->Close), Trader::ht_dcphase($this->Close)); + self::assertEquals(trader_ht_dcphase($this->Close), Trader::ht_dcphase($this->Close)); } public function testInterfaceFunctions_ht_phasor() { - $inPhase1 = []; - $inPhase2 = []; - $this->assertEquals(trader_ht_phasor($this->Close, $inPhase1), Trader::ht_phasor($this->Close, $inPhase2)); + self::assertEquals(trader_ht_phasor($this->Close), Trader::ht_phasor($this->Close)); } public function testInterfaceFunctions_ht_sine() { - $sine1 = []; - $sine2 = []; - $this->assertEquals(trader_ht_sine($this->Close, $sine1), Trader::ht_sine($this->Close, $sine2)); + self::assertEquals(trader_ht_sine($this->Close), Trader::ht_sine($this->Close)); } public function testInterfaceFunctions_ht_trendline() { - $this->assertEquals(trader_ht_trendline($this->Close), Trader::ht_trendline($this->Close)); + self::assertEquals(trader_ht_trendline($this->Close), Trader::ht_trendline($this->Close)); } public function testInterfaceFunctions_ht_trendmode() { - $this->assertEquals(trader_ht_trendmode($this->Close), Trader::ht_trendmode($this->Close)); + self::assertEquals(trader_ht_trendmode($this->Close), Trader::ht_trendmode($this->Close)); } public function testInterfaceFunctions_kama() { - $this->assertEquals(trader_kama($this->Close, 30), Trader::kama($this->Close, 30)); + self::assertEquals(trader_kama($this->Close, 30), Trader::kama($this->Close, 30)); } public function testInterfaceFunctions_linearreg_angle() { - $this->assertEquals(trader_linearreg_angle($this->Close, 14), Trader::linearreg_angle($this->Close, 14)); + self::assertEquals(trader_linearreg_angle($this->Close, 14), Trader::linearreg_angle($this->Close, 14)); } public function testInterfaceFunctions_linearreg_intercept() { - $this->assertEquals(trader_linearreg_intercept($this->Close, 14), Trader::linearreg_intercept($this->Close, 14)); + self::assertEquals(trader_linearreg_intercept($this->Close, 14), Trader::linearreg_intercept($this->Close, 14)); } public function testInterfaceFunctions_linearreg_slope() { - $this->assertEquals(trader_linearreg_slope($this->Close, 14), Trader::linearreg_slope($this->Close, 14)); + self::assertEquals(trader_linearreg_slope($this->Close, 14), Trader::linearreg_slope($this->Close, 14)); } public function testInterfaceFunctions_linearreg() { - $this->assertEquals(trader_linearreg($this->Close, 14), Trader::linearreg($this->Close, 14)); + self::assertEquals(trader_linearreg($this->Close, 14), Trader::linearreg($this->Close, 14)); } public function testInterfaceFunctions_ln() { - $this->assertEquals(trader_ln($this->Close), Trader::ln($this->Close)); + self::assertEquals(trader_ln($this->Close), Trader::ln($this->Close)); } public function testInterfaceFunctions_log10() { - $this->assertEquals(trader_log10($this->Close), Trader::log10($this->Close)); + self::assertEquals(trader_log10($this->Close), Trader::log10($this->Close)); } public function testInterfaceFunctions_ma() { - $this->assertEquals(trader_ma($this->Close, 30, TRADER_MA_TYPE_SMA), Trader::ma($this->Close, 30, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_ma($this->Close, 30, TRADER_MA_TYPE_SMA), Trader::ma($this->Close, 30, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_macd() { - $this->assertEquals(trader_macd($this->Close, 12, 26, 9), Trader::macd($this->Close, 12, 26, 9)); + self::assertEquals(trader_macd($this->Close, 12, 26, 9), Trader::macd($this->Close, 12, 26, 9)); } public function testInterfaceFunctions_macdext() { - $this->assertEquals(trader_macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9), Trader::macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9)); + self::assertEquals(trader_macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9), Trader::macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9)); } public function testInterfaceFunctions_macdfix() { - $this->assertEquals(trader_macdfix($this->Close, 9), Trader::macdfix($this->Close, 9)); + self::assertEquals(trader_macdfix($this->Close, 9), Trader::macdfix($this->Close, 9)); } public function testInterfaceFunctions_mama() { - $this->assertEquals(trader_mama($this->Close, 0.5, 0.05), Trader::mama($this->Close, 0.5, 0.05)); + self::assertEquals(trader_mama($this->Close, 0.5, 0.05), Trader::mama($this->Close, 0.5, 0.05)); } public function testInterfaceFunctions_mavp() { - $this->assertEquals(trader_mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA), Trader::mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA), Trader::mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_max() { - $this->assertEquals(trader_max($this->Close, 30), Trader::max($this->Close, 30)); + self::assertEquals(trader_max($this->Close, 30), Trader::max($this->Close, 30)); } public function testInterfaceFunctions_maxindex() { - $this->assertEquals(trader_maxindex($this->Close, 30), Trader::maxindex($this->Close, 30)); + self::assertEquals(trader_maxindex($this->Close, 30), Trader::maxindex($this->Close, 30)); } public function testInterfaceFunctions_medprice() { - $this->assertEquals(trader_medprice($this->High, $this->Low), Trader::medprice($this->High, $this->Low)); + self::assertEquals(trader_medprice($this->High, $this->Low), Trader::medprice($this->High, $this->Low)); } public function testInterfaceFunctions_mfi() { - $this->assertEquals(trader_mfi($this->High, $this->Low, $this->Close, $this->Volume, 14), Trader::mfi($this->High, $this->Low, $this->Close, $this->Volume, 14)); + self::assertEquals(trader_mfi($this->High, $this->Low, $this->Close, $this->Volume, 14), Trader::mfi($this->High, $this->Low, $this->Close, $this->Volume, 14)); } public function testInterfaceFunctions_midpoint() { - $this->assertEquals(trader_midpoint($this->Close, 14), Trader::midpoint($this->Close, 14)); + self::assertEquals(trader_midpoint($this->Close, 14), Trader::midpoint($this->Close, 14)); } public function testInterfaceFunctions_midprice() { - $this->assertEquals(trader_midprice($this->High, $this->Low, 14), Trader::midprice($this->High, $this->Low, 14)); + self::assertEquals(trader_midprice($this->High, $this->Low, 14), Trader::midprice($this->High, $this->Low, 14)); } public function testInterfaceFunctions_min() { - $this->assertEquals(trader_min($this->High, 30), Trader::min($this->High, 30)); + self::assertEquals(trader_min($this->High, 30), Trader::min($this->High, 30)); } public function testInterfaceFunctions_minindex() { - $this->assertEquals(trader_minindex($this->High, 30), Trader::minindex($this->High, 30)); + self::assertEquals(trader_minindex($this->High, 30), Trader::minindex($this->High, 30)); } public function testInterfaceFunctions_minmax() { - $this->assertEquals(trader_minmax($this->High, 30), Trader::minmax($this->High, 30)); + self::assertEquals(trader_minmax($this->High, 30), Trader::minmax($this->High, 30)); } public function testInterfaceFunctions_minmaxindex() { - $this->assertEquals(trader_minmaxindex($this->High, 30), Trader::minmaxindex($this->High, 30)); + self::assertEquals(trader_minmaxindex($this->High, 30), Trader::minmaxindex($this->High, 30)); } public function testInterfaceFunctions_minus_di() { - $this->assertEquals(trader_minus_di($this->High, $this->Low, $this->Close, 14), Trader::minus_di($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_minus_di($this->High, $this->Low, $this->Close, 14), Trader::minus_di($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_minus_dmi() { - $this->assertEquals(trader_minus_dm($this->High, $this->Low, 14), Trader::minus_dm($this->High, $this->Low, 14)); + self::assertEquals(trader_minus_dm($this->High, $this->Low, 14), Trader::minus_dm($this->High, $this->Low, 14)); } public function testInterfaceFunctions_mom() { - $this->assertEquals(trader_mom($this->High, 10), Trader::mom($this->High, 10)); + self::assertEquals(trader_mom($this->High, 10), Trader::mom($this->High, 10)); } public function testInterfaceFunctions_mult() { - $this->assertEquals(trader_mult($this->Open, $this->Close), Trader::mult($this->Open, $this->Close)); + self::assertEquals(trader_mult($this->Open, $this->Close), Trader::mult($this->Open, $this->Close)); } public function testInterfaceFunctions_natr() { - $this->assertEquals(trader_natr($this->High, $this->Low, $this->Close, 14), Trader::natr($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_natr($this->High, $this->Low, $this->Close, 14), Trader::natr($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_obv() { - $this->assertEquals(trader_obv($this->Close, $this->Volume), Trader::obv($this->Close, $this->Volume)); + self::assertEquals(trader_obv($this->Close, $this->Volume), Trader::obv($this->Close, $this->Volume)); } public function testInterfaceFunctions_plus_di() { - $this->assertEquals(trader_plus_di($this->High, $this->Low, $this->Close, 14), Trader::plus_di($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_plus_di($this->High, $this->Low, $this->Close, 14), Trader::plus_di($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_plus_dm() { - $this->assertEquals(trader_plus_dm($this->High, $this->Low, 14), Trader::plus_dm($this->High, $this->Low, 14)); + self::assertEquals(trader_plus_dm($this->High, $this->Low, 14), Trader::plus_dm($this->High, $this->Low, 14)); } public function testInterfaceFunctions_ppo() { - $this->assertEquals(trader_ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_roc() { - $this->assertEquals(trader_roc($this->Close, 10), Trader::roc($this->Close, 10)); + self::assertEquals(trader_roc($this->Close, 10), Trader::roc($this->Close, 10)); } public function testInterfaceFunctions_rocp() { - $this->assertEquals(trader_rocp($this->Close, 10), Trader::rocp($this->Close, 10)); + self::assertEquals(trader_rocp($this->Close, 10), Trader::rocp($this->Close, 10)); } public function testInterfaceFunctions_rocr100() { - $this->assertEquals(trader_rocr100($this->Close, 10), Trader::rocr100($this->Close, 10)); + self::assertEquals(trader_rocr100($this->Close, 10), Trader::rocr100($this->Close, 10)); } public function testInterfaceFunctions_rocr() { - $this->assertEquals(trader_rocr($this->Close, 10), Trader::rocr($this->Close, 10)); + self::assertEquals(trader_rocr($this->Close, 10), Trader::rocr($this->Close, 10)); } public function testInterfaceFunctions_rsi() { - $this->assertEquals(trader_rsi($this->Close, 14), Trader::rsi($this->Close, 14)); + self::assertEquals(trader_rsi($this->Close, 14), Trader::rsi($this->Close, 14)); } public function testInterfaceFunctions_sar() { - $this->assertEquals(trader_sar($this->Close, $this->Low, 0.02, 0.2), Trader::sar($this->Close, $this->Low, 0.02, 0.2)); + self::assertEquals(trader_sar($this->Close, $this->Low, 0.02, 0.2), Trader::sar($this->Close, $this->Low, 0.02, 0.2)); } public function testInterfaceFunctions_sarext() { - $this->assertEquals(trader_sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2), Trader::sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)); + self::assertEquals(trader_sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2), Trader::sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)); } public function testInterfaceFunctions_sin() { - $this->assertEquals(trader_sin($this->Close), Trader::sin($this->Close)); + self::assertEquals(trader_sin($this->Close), Trader::sin($this->Close)); } public function testInterfaceFunctions_sinh() { - $this->assertEquals(trader_sinh($this->Close), Trader::sinh($this->Close)); + self::assertEquals(trader_sinh($this->Close), Trader::sinh($this->Close)); } public function testInterfaceFunctions_sma() { - $this->assertEquals(trader_sma($this->Close, 30), Trader::sma($this->Close, 30)); + self::assertEquals(trader_sma($this->Close, 30), Trader::sma($this->Close, 30)); } public function testInterfaceFunctions_sqrt() { - $this->assertEquals(trader_sqrt($this->Close), Trader::sqrt($this->Close)); + self::assertEquals(trader_sqrt($this->Close), Trader::sqrt($this->Close)); } public function testInterfaceFunctions_stddev() { - $this->assertEquals(trader_stddev($this->Close, 5, 1.0), Trader::stddev($this->Close, 5, 1.0)); + self::assertEquals(trader_stddev($this->Close, 5, 1.0), Trader::stddev($this->Close, 5, 1.0)); } public function testInterfaceFunctions_stoch() { - $this->assertEquals(trader_stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA), Trader::stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA), Trader::stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_stochf() { - $this->assertEquals(trader_stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_stochrsi() { - $this->assertEquals(trader_stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA)); } public function testInterfaceFunctions_sub() { - $this->assertEquals(trader_sub($this->High, $this->Low), Trader::sub($this->High, $this->Low)); + self::assertEquals(trader_sub($this->High, $this->Low), Trader::sub($this->High, $this->Low)); } public function testInterfaceFunctions_sum() { - $this->assertEquals(trader_sum($this->High, 30), Trader::sum($this->High, 30)); + self::assertEquals(trader_sum($this->High, 30), Trader::sum($this->High, 30)); } public function testInterfaceFunctions_t3() { - $this->assertEquals(trader_t3($this->High, 5, 0.7), Trader::t3($this->High, 5, 0.7)); + self::assertEquals(trader_t3($this->High, 5, 0.7), Trader::t3($this->High, 5, 0.7)); } public function testInterfaceFunctions_tan() { - $this->assertEquals(trader_tan($this->Close), Trader::tan($this->Close)); + self::assertEquals(trader_tan($this->Close), Trader::tan($this->Close)); } public function testInterfaceFunctions_tanh() { - $this->assertEquals(trader_tanh($this->Close), Trader::tanh($this->Close)); + self::assertEquals(trader_tanh($this->Close), Trader::tanh($this->Close)); } public function testInterfaceFunctions_tema() { - $this->assertEquals(trader_tema($this->Close, 30), Trader::tema($this->Close, 30)); + self::assertEquals(trader_tema($this->Close, 30), Trader::tema($this->Close, 30)); } public function testInterfaceFunctions_trange() { - $this->assertEquals(trader_trange($this->High, $this->Low, $this->Close), Trader::trange($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_trange($this->High, $this->Low, $this->Close), Trader::trange($this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_trima() { - $this->assertEquals(trader_trima($this->Close, 30), Trader::trima($this->Close, 30)); + self::assertEquals(trader_trima($this->Close, 30), Trader::trima($this->Close, 30)); } public function testInterfaceFunctions_trix() { - $this->assertEquals(trader_trix($this->Close, 30), Trader::trix($this->Close, 30)); + self::assertEquals(trader_trix($this->Close, 30), Trader::trix($this->Close, 30)); } public function testInterfaceFunctions_tsf() { - $this->assertEquals(trader_tsf($this->Close, 14), Trader::tsf($this->Close, 14)); + self::assertEquals(trader_tsf($this->Close, 14), Trader::tsf($this->Close, 14)); } public function testInterfaceFunctions_typprice() { - $this->assertEquals(trader_typprice($this->High, $this->Low, $this->Close), Trader::typprice($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_typprice($this->High, $this->Low, $this->Close), Trader::typprice($this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_ultosc() { - $this->assertEquals(trader_ultosc($this->High, $this->Low, $this->Close, 7, 14, 28), Trader::ultosc($this->High, $this->Low, $this->Close, 7, 14, 28)); + self::assertEquals(trader_ultosc($this->High, $this->Low, $this->Close, 7, 14, 28), Trader::ultosc($this->High, $this->Low, $this->Close, 7, 14, 28)); } public function testInterfaceFunctions_var() { - $this->assertEquals(trader_var($this->Close, 5, 1.0), Trader::var($this->Close, 5, 1.0)); + self::assertEquals(trader_var($this->Close, 5, 1.0), Trader::var($this->Close, 5, 1.0)); } public function testInterfaceFunctions_wclprice() { - $this->assertEquals(trader_wclprice($this->High, $this->Low, $this->Close), Trader::wclprice($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_wclprice($this->High, $this->Low, $this->Close), Trader::wclprice($this->High, $this->Low, $this->Close)); } public function testInterfaceFunctions_willr() { - $this->assertEquals(trader_willr($this->High, $this->Low, $this->Close, 14), Trader::willr($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_willr($this->High, $this->Low, $this->Close, 14), Trader::willr($this->High, $this->Low, $this->Close, 14)); } public function testInterfaceFunctions_wma() { - $this->assertEquals(trader_wma($this->Close, 30), Trader::wma($this->Close, 30)); + self::assertEquals(trader_wma($this->Close, 30), Trader::wma($this->Close, 30)); } -// + // -// + // public function testFriendlyFunctions_acos() { - $this->assertEquals(trader_acos(array_map('cos', $this->Close)), Trader::mathArcCosine(array_map('cos', $this->Close))); + self::assertEquals(trader_acos(array_map('cos', $this->Close)), Trader::mathArcCosine(array_map('cos', $this->Close))); } public function testFriendlyFunctions_ad() { - $this->assertEquals(trader_ad($this->High, $this->Low, $this->Close, $this->Volume), Trader::chaikinAccumulationDistributionLine($this->High, $this->Low, $this->Close, $this->Volume)); + self::assertEquals(trader_ad($this->High, $this->Low, $this->Close, $this->Volume), Trader::chaikinAccumulationDistributionLine($this->High, $this->Low, $this->Close, $this->Volume)); } public function testFriendlyFunctions_add() { - $this->assertEquals(trader_add($this->High, $this->Low), Trader::mathAddition($this->High, $this->Low)); + self::assertEquals(trader_add($this->High, $this->Low), Trader::mathAddition($this->High, $this->Low)); } public function testFriendlyFunctions_adosc() { - $this->assertEquals(trader_adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10), Trader::chaikinAccumulationDistributionOscillator($this->High, $this->Low, $this->Close, $this->Volume, 3, 10)); + self::assertEquals(trader_adosc($this->High, $this->Low, $this->Close, $this->Volume, 3, 10), Trader::chaikinAccumulationDistributionOscillator($this->High, $this->Low, $this->Close, $this->Volume, 3, 10)); } public function testFriendlyFunctions_adx() { - $this->assertEquals(trader_adx($this->High, $this->Low, $this->Close, 14), Trader::averageDirectionalMovementIndex($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_adx($this->High, $this->Low, $this->Close, 14), Trader::averageDirectionalMovementIndex($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_adxr() { - $this->assertEquals(trader_adxr($this->High, $this->Low, $this->Close, 14), Trader::averageDirectionalMovementIndexRating($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_adxr($this->High, $this->Low, $this->Close, 14), Trader::averageDirectionalMovementIndexRating($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_apo() { - $this->assertEquals(trader_apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::absolutePriceOscillator($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_apo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::absolutePriceOscillator($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_aroon() { - $this->assertEquals(trader_aroon($this->High, $this->Low, 14), Trader::aroonIndicator($this->High, $this->Low, 14)); + self::assertEquals(trader_aroon($this->High, $this->Low, 14), Trader::aroonIndicator($this->High, $this->Low, 14)); } public function testFriendlyFunctions_arronosc() { - $this->assertEquals(trader_aroonosc($this->High, $this->Low, 14), Trader::arronOscillator($this->High, $this->Low, 14)); + self::assertEquals(trader_aroonosc($this->High, $this->Low, 14), Trader::arronOscillator($this->High, $this->Low, 14)); } public function testFriendlyFunctions_asin() { - $this->assertEquals(trader_asin(array_map('sin', $this->Close)), Trader::mathArcSine(array_map('sin', $this->Close))); + self::assertEquals(trader_asin(array_map('sin', $this->Close)), Trader::mathArcSine(array_map('sin', $this->Close))); } public function testFriendlyFunctions_atan() { - $this->assertEquals(trader_atan(array_map('tan', $this->Close)), Trader::mathArcTangent(array_map('tan', $this->Close))); + self::assertEquals(trader_atan(array_map('tan', $this->Close)), Trader::mathArcTangent(array_map('tan', $this->Close))); } public function testFriendlyFunctions_atr() { - $this->assertEquals(trader_atr($this->High, $this->Low, $this->Close, 14), Trader::averageTrueRange($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_atr($this->High, $this->Low, $this->Close, 14), Trader::averageTrueRange($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_avgprice() { - $this->assertEquals(trader_avgprice($this->Open, $this->High, $this->Low, $this->Close), Trader::averagePrice($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_avgprice($this->Open, $this->High, $this->Low, $this->Close), Trader::averagePrice($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_bbands() { - $this->assertEquals(trader_bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA), Trader::bollingerBands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_bbands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA), Trader::bollingerBands($this->Close, 5, 2.0, 2.0, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_beta() { - $this->assertEquals(trader_beta($this->Open, $this->Close, 5), Trader::betaVolatility($this->Open, $this->Close, 5)); + self::assertEquals(trader_beta($this->Open, $this->Close, 5), Trader::betaVolatility($this->Open, $this->Close, 5)); } public function testFriendlyFunctions_bop() { - $this->assertEquals(trader_bop($this->Open, $this->High, $this->Low, $this->Close), Trader::balanceOfPower($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_bop($this->Open, $this->High, $this->Low, $this->Close), Trader::balanceOfPower($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cci() { - $this->assertEquals(trader_cci($this->High, $this->Low, $this->Close, 14), Trader::commodityChannelIndex($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_cci($this->High, $this->Low, $this->Close, 14), Trader::commodityChannelIndex($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_cdl2crows() { - $this->assertEquals(trader_cdl2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTwoCrows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTwoCrows($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3blackcrows() { - $this->assertEquals(trader_cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeBlackCrows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3blackcrows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeBlackCrows($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3inside() { - $this->assertEquals(trader_cdl3inside($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeInsideUpDown($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3inside($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeInsideUpDown($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3linestrike() { - $this->assertEquals(trader_cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeLineStrike($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3linestrike($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeLineStrike($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3outside() { - $this->assertEquals(trader_cdl3outside($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeOutsideUpDown($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3outside($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeOutsideUpDown($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3starsinsouth() { - $this->assertEquals(trader_cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeStarsInTheSouth($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3starsinsouth($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeStarsInTheSouth($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdl3whitesoldiers() { - $this->assertEquals(trader_cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeWhiteSoldiers($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdl3whitesoldiers($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThreeWhiteSoldiers($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlabandonedbaby() { - $this->assertEquals(trader_cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close), Trader::candleAbandonedBaby($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlabandonedbaby($this->Open, $this->High, $this->Low, $this->Close), Trader::candleAbandonedBaby($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdladvanceblock() { - $this->assertEquals(trader_cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close), Trader::candleAdvanceBlock($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdladvanceblock($this->Open, $this->High, $this->Low, $this->Close), Trader::candleAdvanceBlock($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlbelthold() { - $this->assertEquals(trader_cdlbelthold($this->Open, $this->High, $this->Low, $this->Close), Trader::candleBeltHold($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlbelthold($this->Open, $this->High, $this->Low, $this->Close), Trader::candleBeltHold($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlbreakaway() { - $this->assertEquals(trader_cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close), Trader::candleBreakaway($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlbreakaway($this->Open, $this->High, $this->Low, $this->Close), Trader::candleBreakaway($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlclosingmarubozu() { - $this->assertEquals(trader_cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::candleClosingMarubozu($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlclosingmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::candleClosingMarubozu($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlconcealbabyswall() { - $this->assertEquals(trader_cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close), Trader::candleConcealingBabySwallow($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlconcealbabyswall($this->Open, $this->High, $this->Low, $this->Close), Trader::candleConcealingBabySwallow($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlcounterattack() { - $this->assertEquals(trader_cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close), Trader::candleCounterattack($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlcounterattack($this->Open, $this->High, $this->Low, $this->Close), Trader::candleCounterattack($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdldarkcloudcover() { - $this->assertEquals(trader_cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::candleDarkCloudCover($this->Open, $this->High, $this->Low, $this->Close, 0.5)); + self::assertEquals(trader_cdldarkcloudcover($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::candleDarkCloudCover($this->Open, $this->High, $this->Low, $this->Close, 0.5)); } public function testFriendlyFunctions_cdldoji() { - $this->assertEquals(trader_cdldoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdldojistar() { - $this->assertEquals(trader_cdldojistar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDojiStar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldojistar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDojiStar($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdldragonflydoji() { - $this->assertEquals(trader_cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDragonflyDoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdldragonflydoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleDragonflyDoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlengulfing() { - $this->assertEquals(trader_cdlengulfing($this->Open, $this->High, $this->Low, $this->Close), Trader::candleEngulfingPattern($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlengulfing($this->Open, $this->High, $this->Low, $this->Close), Trader::candleEngulfingPattern($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdleveningdojistar() { - $this->assertEquals(trader_cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleEveningDojiStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdleveningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleEveningDojiStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testFriendlyFunctions_cdleveningstar() { - $this->assertEquals(trader_cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleEveningStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdleveningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleEveningStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testFriendlyFunctions_cdlgapsidesidewhite() { - $this->assertEquals(trader_cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpDownGapsSideBySideWhiteLines($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlgapsidesidewhite($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpDownGapsSideBySideWhiteLines($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlgravestonedoji() { - $this->assertEquals(trader_cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleGravestoneDoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlgravestonedoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleGravestoneDoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhammer() { - $this->assertEquals(trader_cdlhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHammer($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHammer($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhangingman() { - $this->assertEquals(trader_cdlhangingman($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHangingMan($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhangingman($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHangingMan($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlharami() { - $this->assertEquals(trader_cdlharami($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHarami($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlharami($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHarami($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlharamicross() { - $this->assertEquals(trader_cdlharamicross($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHaramiCross($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlharamicross($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHaramiCross($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhighwave() { - $this->assertEquals(trader_cdlhighwave($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHighWave($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhighwave($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHighWave($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhikkake() { - $this->assertEquals(trader_cdlhikkake($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHikkake($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhikkake($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHikkake($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhikkakemod() { - $this->assertEquals(trader_cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close), Trader::candleModifiedHikkake($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhikkakemod($this->Open, $this->High, $this->Low, $this->Close), Trader::candleModifiedHikkake($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlhomingpigeon() { - $this->assertEquals(trader_cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHomingPigeon($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlhomingpigeon($this->Open, $this->High, $this->Low, $this->Close), Trader::candleHomingPigeon($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlidentical3crows() { - $this->assertEquals(trader_cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleIdenticalThreeCrows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlidentical3crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleIdenticalThreeCrows($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlinneck() { - $this->assertEquals(trader_cdlinneck($this->Open, $this->High, $this->Low, $this->Close), Trader::candleInNeck($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlinneck($this->Open, $this->High, $this->Low, $this->Close), Trader::candleInNeck($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlinvertedhammer() { - $this->assertEquals(trader_cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::candleInvertedHammer($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlinvertedhammer($this->Open, $this->High, $this->Low, $this->Close), Trader::candleInvertedHammer($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlkicking() { - $this->assertEquals(trader_cdlkicking($this->Open, $this->High, $this->Low, $this->Close), Trader::candleKicking($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlkicking($this->Open, $this->High, $this->Low, $this->Close), Trader::candleKicking($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlkickingbylength() { - $this->assertEquals(trader_cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close), Trader::candleKickingByLength($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlkickingbylength($this->Open, $this->High, $this->Low, $this->Close), Trader::candleKickingByLength($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlladderbottom() { - $this->assertEquals(trader_cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLadderBottom($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlladderbottom($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLadderBottom($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdllongleggeddoji() { - $this->assertEquals(trader_cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLongLeggedDoji($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdllongleggeddoji($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLongLeggedDoji($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdllongline() { - $this->assertEquals(trader_cdllongline($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLongLine($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdllongline($this->Open, $this->High, $this->Low, $this->Close), Trader::candleLongLine($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlmarubozu() { - $this->assertEquals(trader_cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::candleMarubozu($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlmarubozu($this->Open, $this->High, $this->Low, $this->Close), Trader::candleMarubozu($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlmatchinglow() { - $this->assertEquals(trader_cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close), Trader::candleMatchingLow($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlmatchinglow($this->Open, $this->High, $this->Low, $this->Close), Trader::candleMatchingLow($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlmathold() { - $this->assertEquals(trader_cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::candleMatHold($this->Open, $this->High, $this->Low, $this->Close, 0.5)); + self::assertEquals(trader_cdlmathold($this->Open, $this->High, $this->Low, $this->Close, 0.5), Trader::candleMatHold($this->Open, $this->High, $this->Low, $this->Close, 0.5)); } public function testFriendlyFunctions_cdlmorningdojistar() { - $this->assertEquals(trader_cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleMorningDojiStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdlmorningdojistar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleMorningDojiStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testFriendlyFunctions_cdlmorningstar() { - $this->assertEquals(trader_cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleMorningStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); + self::assertEquals(trader_cdlmorningstar($this->Open, $this->High, $this->Low, $this->Close, 0.3), Trader::candleMorningStar($this->Open, $this->High, $this->Low, $this->Close, 0.3)); } public function testFriendlyFunctions_cdlonneck() { - $this->assertEquals(trader_cdlonneck($this->Open, $this->High, $this->Low, $this->Close), Trader::candleOnNeck($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlonneck($this->Open, $this->High, $this->Low, $this->Close), Trader::candleOnNeck($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlpiercing() { - $this->assertEquals(trader_cdlpiercing($this->Open, $this->High, $this->Low, $this->Close), Trader::candlePiercing($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlpiercing($this->Open, $this->High, $this->Low, $this->Close), Trader::candlePiercing($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlrickshawman() { - $this->assertEquals(trader_cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close), Trader::candleRickshawMan($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlrickshawman($this->Open, $this->High, $this->Low, $this->Close), Trader::candleRickshawMan($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlrisefall3methods() { - $this->assertEquals(trader_cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::candleRisingFallingThreeMethods($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlrisefall3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::candleRisingFallingThreeMethods($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlseparatinglines() { - $this->assertEquals(trader_cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close), Trader::candleSeparatingLines($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlseparatinglines($this->Open, $this->High, $this->Low, $this->Close), Trader::candleSeparatingLines($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlshootingstar() { - $this->assertEquals(trader_cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleShootingStar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlshootingstar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleShootingStar($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlshortline() { - $this->assertEquals(trader_cdlshortline($this->Open, $this->High, $this->Low, $this->Close), Trader::candleShortLine($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlshortline($this->Open, $this->High, $this->Low, $this->Close), Trader::candleShortLine($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlspinningtop() { - $this->assertEquals(trader_cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close), Trader::candleSpinningTop($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlspinningtop($this->Open, $this->High, $this->Low, $this->Close), Trader::candleSpinningTop($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlstalledpattern() { - $this->assertEquals(trader_cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close), Trader::candleStalled($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlstalledpattern($this->Open, $this->High, $this->Low, $this->Close), Trader::candleStalled($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlsticksandwich() { - $this->assertEquals(trader_cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close), Trader::candleStickSandwich($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlsticksandwich($this->Open, $this->High, $this->Low, $this->Close), Trader::candleStickSandwich($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdltakuri() { - $this->assertEquals(trader_cdltakuri($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTakuri($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltakuri($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTakuri($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdltasukigap() { - $this->assertEquals(trader_cdltasukigap($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTasukiGap($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltasukigap($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTasukiGap($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlthrusting() { - $this->assertEquals(trader_cdlthrusting($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThrusting($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlthrusting($this->Open, $this->High, $this->Low, $this->Close), Trader::candleThrusting($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdltristar() { - $this->assertEquals(trader_cdltristar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTristar($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdltristar($this->Open, $this->High, $this->Low, $this->Close), Trader::candleTristar($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlunique3river() { - $this->assertEquals(trader_cdlunique3river($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUniqueThreeRiver($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlunique3river($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUniqueThreeRiver($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlupsidegap2crows() { - $this->assertEquals(trader_cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpsideGapTwoCrows($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlupsidegap2crows($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpsideGapTwoCrows($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_cdlxsidegap3methods() { - $this->assertEquals(trader_cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpsideDownsideGapThreeMethods($this->Open, $this->High, $this->Low, $this->Close)); + self::assertEquals(trader_cdlxsidegap3methods($this->Open, $this->High, $this->Low, $this->Close), Trader::candleUpsideDownsideGapThreeMethods($this->Open, $this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_ceil() { - $this->assertEquals(trader_ceil($this->Close), Trader::mathCeiling($this->Close)); + self::assertEquals(trader_ceil($this->Close), Trader::mathCeiling($this->Close)); } public function testFriendlyFunctions_cmo() { - $this->assertEquals(trader_cmo($this->Close, 14), Trader::chandeMomentumOscillator($this->Close, 14)); + self::assertEquals(trader_cmo($this->Close, 14), Trader::chandeMomentumOscillator($this->Close, 14)); } public function testFriendlyFunctions_correl() { - $this->assertEquals(trader_correl($this->Open, $this->Close, 30), Trader::pearsonCorrelationCoefficient($this->Open, $this->Close, 30)); + self::assertEquals(trader_correl($this->Open, $this->Close, 30), Trader::pearsonCorrelationCoefficient($this->Open, $this->Close, 30)); } public function testFriendlyFunctions_cos() { - $this->assertEquals(trader_cos($this->Close), Trader::mathCosine($this->Close)); + self::assertEquals(trader_cos($this->Close), Trader::mathCosine($this->Close)); } public function testFriendlyFunctions_cosh() { - $this->assertEquals(trader_cosh($this->Close), Trader::mathHyperbolicCosine($this->Close)); + self::assertEquals(trader_cosh($this->Close), Trader::mathHyperbolicCosine($this->Close)); } public function testFriendlyFunctions_dema() { - $this->assertEquals(trader_dema($this->Close, 30), Trader::doubleExponentialMovingAverage($this->Close, 30)); + self::assertEquals(trader_dema($this->Close, 30), Trader::doubleExponentialMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_div() { - $this->assertEquals(trader_div($this->Open, $this->Close), Trader::mathDivision($this->Open, $this->Close)); + self::assertEquals(trader_div($this->Open, $this->Close), Trader::mathDivision($this->Open, $this->Close)); } public function testFriendlyFunctions_dx() { - $this->assertEquals(trader_dx($this->High, $this->Low, $this->Close, 14), Trader::directionalMovementIndex($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_dx($this->High, $this->Low, $this->Close, 14), Trader::directionalMovementIndex($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_ema() { - $this->assertEquals(trader_ema($this->Close, 30), Trader::exponentialMovingAverage($this->Close, 30)); + self::assertEquals(trader_ema($this->Close, 30), Trader::exponentialMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_exp() { - $this->assertEquals(trader_exp($this->Close), Trader::mathExponent($this->Close)); + self::assertEquals(trader_exp($this->Close), Trader::mathExponent($this->Close)); } public function testFriendlyFunctions_floor() { - $this->assertEquals(trader_floor($this->Close), Trader::mathFloor($this->Close)); + self::assertEquals(trader_floor($this->Close), Trader::mathFloor($this->Close)); } public function testFriendlyFunctions_ht_dcperiod() { - $this->assertEquals(trader_ht_dcperiod($this->Close), Trader::hilbertTransformDominantCyclePeriod($this->Close)); + self::assertEquals(trader_ht_dcperiod($this->Close), Trader::hilbertTransformDominantCyclePeriod($this->Close)); } public function testFriendlyFunctions_ht_dcphase() { - $this->assertEquals(trader_ht_dcphase($this->Close), Trader::hilbertTransformDominantCyclePhase($this->Close)); + self::assertEquals(trader_ht_dcphase($this->Close), Trader::hilbertTransformDominantCyclePhase($this->Close)); } public function testFriendlyFunctions_ht_phasor() { - $inPhase1 = []; - $inPhase2 = []; - $this->assertEquals(trader_ht_phasor($this->Close, $inPhase1), Trader::hilbertTransformPhasorComponents($this->Close, $inPhase2)); + self::assertEquals(trader_ht_phasor($this->Close), Trader::hilbertTransformPhasorComponents($this->Close)); } public function testFriendlyFunctions_ht_sine() { - $sine1 = []; - $sine2 = []; - $this->assertEquals(trader_ht_sine($this->Close, $sine1), Trader::hilbertTransformSineWave($this->Close, $sine2)); + self::assertEquals(trader_ht_sine($this->Close), Trader::hilbertTransformSineWave($this->Close)); } public function testFriendlyFunctions_ht_trendline() { - $this->assertEquals(trader_ht_trendline($this->Close), Trader::hilbertTransformInstantaneousTrendLine($this->Close)); + self::assertEquals(trader_ht_trendline($this->Close), Trader::hilbertTransformInstantaneousTrendLine($this->Close)); } public function testFriendlyFunctions_ht_trendmode() { - $this->assertEquals(trader_ht_trendmode($this->Close), Trader::hilbertTransformTrendVsCycleMode($this->Close)); + self::assertEquals(trader_ht_trendmode($this->Close), Trader::hilbertTransformTrendVsCycleMode($this->Close)); } public function testFriendlyFunctions_kama() { - $this->assertEquals(trader_kama($this->Close, 30), Trader::kaufmanAdaptiveMovingAverage($this->Close, 30)); + self::assertEquals(trader_kama($this->Close, 30), Trader::kaufmanAdaptiveMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_linearreg_angle() { - $this->assertEquals(trader_linearreg_angle($this->Close, 14), Trader::linearRegressionAngle($this->Close, 14)); + self::assertEquals(trader_linearreg_angle($this->Close, 14), Trader::linearRegressionAngle($this->Close, 14)); } public function testFriendlyFunctions_linearreg_intercept() { - $this->assertEquals(trader_linearreg_intercept($this->Close, 14), Trader::linearRegressionIntercept($this->Close, 14)); + self::assertEquals(trader_linearreg_intercept($this->Close, 14), Trader::linearRegressionIntercept($this->Close, 14)); } public function testFriendlyFunctions_linearreg_slope() { - $this->assertEquals(trader_linearreg_slope($this->Close, 14), Trader::linearRegressionSlope($this->Close, 14)); + self::assertEquals(trader_linearreg_slope($this->Close, 14), Trader::linearRegressionSlope($this->Close, 14)); } public function testFriendlyFunctions_linearreg() { - $this->assertEquals(trader_linearreg($this->Close, 14), Trader::linearRegression($this->Close, 14)); + self::assertEquals(trader_linearreg($this->Close, 14), Trader::linearRegression($this->Close, 14)); } public function testFriendlyFunctions_ln() { - $this->assertEquals(trader_ln($this->Close), Trader::mathLogarithmNatural($this->Close)); + self::assertEquals(trader_ln($this->Close), Trader::mathLogarithmNatural($this->Close)); } public function testFriendlyFunctions_log10() { - $this->assertEquals(trader_log10($this->Close), Trader::mathLogarithmBase10($this->Close)); + self::assertEquals(trader_log10($this->Close), Trader::mathLogarithmBase10($this->Close)); } public function testFriendlyFunctions_ma() { - $this->assertEquals(trader_ma($this->Close, 30, TRADER_MA_TYPE_SMA), Trader::movingAverage($this->Close, 30, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_ma($this->Close, 30, TRADER_MA_TYPE_SMA), Trader::movingAverage($this->Close, 30, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_macd() { - $this->assertEquals(trader_macd($this->Close, 12, 26, 9), Trader::movingAverageConvergenceDivergence($this->Close, 12, 26, 9)); + self::assertEquals(trader_macd($this->Close, 12, 26, 9), Trader::movingAverageConvergenceDivergence($this->Close, 12, 26, 9)); } public function testFriendlyFunctions_macdext() { - $this->assertEquals(trader_macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9), Trader::movingAverageConvergenceDivergenceExtended($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9)); + self::assertEquals(trader_macdext($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9), Trader::movingAverageConvergenceDivergenceExtended($this->Close, 12, TRADER_MA_TYPE_SMA, 26, TRADER_MA_TYPE_SMA, 9)); } public function testFriendlyFunctions_macdfix() { - $this->assertEquals(trader_macdfix($this->Close, 9), Trader::movingAverageConvergenceDivergenceFixed($this->Close, 9)); + self::assertEquals(trader_macdfix($this->Close, 9), Trader::movingAverageConvergenceDivergenceFixed($this->Close, 9)); } public function testFriendlyFunctions_mama() { - $this->assertEquals(trader_mama($this->Close, 0.5, 0.05), Trader::mesaAdaptiveMovingAverage($this->Close, 0.5, 0.05)); + self::assertEquals(trader_mama($this->Close, 0.5, 0.05), Trader::mesaAdaptiveMovingAverage($this->Close, 0.5, 0.05)); } public function testFriendlyFunctions_mavp() { - $this->assertEquals(trader_mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA), Trader::movingAverageVariablePeriod($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_mavp($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA), Trader::movingAverageVariablePeriod($this->Close, $this->Open, 2, 30, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_max() { - $this->assertEquals(trader_max($this->Close, 30), Trader::mathMax($this->Close, 30)); + self::assertEquals(trader_max($this->Close, 30), Trader::mathMax($this->Close, 30)); } public function testFriendlyFunctions_maxindex() { - $this->assertEquals(trader_maxindex($this->Close, 30), Trader::mathMaxIndex($this->Close, 30)); + self::assertEquals(trader_maxindex($this->Close, 30), Trader::mathMaxIndex($this->Close, 30)); } public function testFriendlyFunctions_medprice() { - $this->assertEquals(trader_medprice($this->High, $this->Low), Trader::mathMedianPrice($this->High, $this->Low)); + self::assertEquals(trader_medprice($this->High, $this->Low), Trader::mathMedianPrice($this->High, $this->Low)); } public function testFriendlyFunctions_mfi() { - $this->assertEquals(trader_mfi($this->High, $this->Low, $this->Close, $this->Volume, 14), Trader::moneyFlowIndex($this->High, $this->Low, $this->Close, $this->Volume, 14)); + self::assertEquals(trader_mfi($this->High, $this->Low, $this->Close, $this->Volume, 14), Trader::moneyFlowIndex($this->High, $this->Low, $this->Close, $this->Volume, 14)); } public function testFriendlyFunctions_midpoint() { - $this->assertEquals(trader_midpoint($this->Close, 14), Trader::middlePoint($this->Close, 14)); + self::assertEquals(trader_midpoint($this->Close, 14), Trader::middlePoint($this->Close, 14)); } public function testFriendlyFunctions_midprice() { - $this->assertEquals(trader_midprice($this->High, $this->Low, 14), Trader::middlePointPrice($this->High, $this->Low, 14)); + self::assertEquals(trader_midprice($this->High, $this->Low, 14), Trader::middlePointPrice($this->High, $this->Low, 14)); } public function testFriendlyFunctions_min() { - $this->assertEquals(trader_min($this->High, 30), Trader::mathMin($this->High, 30)); + self::assertEquals(trader_min($this->High, 30), Trader::mathMin($this->High, 30)); } public function testFriendlyFunctions_minindex() { - $this->assertEquals(trader_minindex($this->High, 30), Trader::mathMinIndex($this->High, 30)); + self::assertEquals(trader_minindex($this->High, 30), Trader::mathMinIndex($this->High, 30)); } public function testFriendlyFunctions_minmax() { - $this->assertEquals(trader_minmax($this->High, 30), Trader::mathMinMax($this->High, 30)); + self::assertEquals(trader_minmax($this->High, 30), Trader::mathMinMax($this->High, 30)); } public function testFriendlyFunctions_minmaxindex() { - $this->assertEquals(trader_minmaxindex($this->High, 30), Trader::mathMinMaxIndex($this->High, 30)); + self::assertEquals(trader_minmaxindex($this->High, 30), Trader::mathMinMaxIndex($this->High, 30)); } public function testFriendlyFunctions_minus_di() { - $this->assertEquals(trader_minus_di($this->High, $this->Low, $this->Close, 14), Trader::minusDirectionalIndicator($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_minus_di($this->High, $this->Low, $this->Close, 14), Trader::minusDirectionalIndicator($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_minus_dmi() { - $this->assertEquals(trader_minus_dm($this->High, $this->Low, 14), Trader::minusDirectionalMovement($this->High, $this->Low, 14)); + self::assertEquals(trader_minus_dm($this->High, $this->Low, 14), Trader::minusDirectionalMovement($this->High, $this->Low, 14)); } public function testFriendlyFunctions_mom() { - $this->assertEquals(trader_mom($this->High, 10), Trader::momentum($this->High, 10)); + self::assertEquals(trader_mom($this->High, 10), Trader::momentum($this->High, 10)); } public function testFriendlyFunctions_mult() { - $this->assertEquals(trader_mult($this->Open, $this->Close), Trader::mathMultiply($this->Open, $this->Close)); + self::assertEquals(trader_mult($this->Open, $this->Close), Trader::mathMultiply($this->Open, $this->Close)); } public function testFriendlyFunctions_natr() { - $this->assertEquals(trader_natr($this->High, $this->Low, $this->Close, 14), Trader::normalizedAverageTrueRange($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_natr($this->High, $this->Low, $this->Close, 14), Trader::normalizedAverageTrueRange($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_obv() { - $this->assertEquals(trader_obv($this->Close, $this->Volume), Trader::onBalanceVolume($this->Close, $this->Volume)); + self::assertEquals(trader_obv($this->Close, $this->Volume), Trader::onBalanceVolume($this->Close, $this->Volume)); } public function testFriendlyFunctions_plus_di() { - $this->assertEquals(trader_plus_di($this->High, $this->Low, $this->Close, 14), Trader::plusDirectionalIndicator($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_plus_di($this->High, $this->Low, $this->Close, 14), Trader::plusDirectionalIndicator($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_plus_dm() { - $this->assertEquals(trader_plus_dm($this->High, $this->Low, 14), Trader::plusDirectionalMovement($this->High, $this->Low, 14)); + self::assertEquals(trader_plus_dm($this->High, $this->Low, 14), Trader::plusDirectionalMovement($this->High, $this->Low, 14)); } public function testFriendlyFunctions_ppo() { - $this->assertEquals(trader_ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::percentagePriceOscillator($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_ppo($this->Close, 12, 26, TRADER_MA_TYPE_SMA), Trader::percentagePriceOscillator($this->Close, 12, 26, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_roc() { - $this->assertEquals(trader_roc($this->Close, 10), Trader::rateOfChange($this->Close, 10)); + self::assertEquals(trader_roc($this->Close, 10), Trader::rateOfChange($this->Close, 10)); } public function testFriendlyFunctions_rocp() { - $this->assertEquals(trader_rocp($this->Close, 10), Trader::rateOfChangePercentage($this->Close, 10)); + self::assertEquals(trader_rocp($this->Close, 10), Trader::rateOfChangePercentage($this->Close, 10)); } public function testFriendlyFunctions_rocr100() { - $this->assertEquals(trader_rocr100($this->Close, 10), Trader::rateOfChangeRatio100($this->Close, 10)); + self::assertEquals(trader_rocr100($this->Close, 10), Trader::rateOfChangeRatio100($this->Close, 10)); } public function testFriendlyFunctions_rocr() { - $this->assertEquals(trader_rocr($this->Close, 10), Trader::rateOfChangeRatio($this->Close, 10)); + self::assertEquals(trader_rocr($this->Close, 10), Trader::rateOfChangeRatio($this->Close, 10)); } public function testFriendlyFunctions_rsi() { - $this->assertEquals(trader_rsi($this->Close, 14), Trader::relativeStrengthIndex($this->Close, 14)); + self::assertEquals(trader_rsi($this->Close, 14), Trader::relativeStrengthIndex($this->Close, 14)); } public function testFriendlyFunctions_sar() { - $this->assertEquals(trader_sar($this->Close, $this->Low, 0.02, 0.2), Trader::parabolicSAR($this->Close, $this->Low, 0.02, 0.2)); + self::assertEquals(trader_sar($this->Close, $this->Low, 0.02, 0.2), Trader::parabolicSAR($this->Close, $this->Low, 0.02, 0.2)); } public function testFriendlyFunctions_sarext() { - $this->assertEquals(trader_sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2), Trader::parabolicSARExtended($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)); + self::assertEquals(trader_sarext($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2), Trader::parabolicSARExtended($this->Close, $this->Low, 0.0, 0.0, 0.02, 0.02, 0.2, 0.02, 0.02, 0.2)); } public function testFriendlyFunctions_sin() { - $this->assertEquals(trader_sin($this->Close), Trader::mathSine($this->Close)); + self::assertEquals(trader_sin($this->Close), Trader::mathSine($this->Close)); } public function testFriendlyFunctions_sinh() { - $this->assertEquals(trader_sinh($this->Close), Trader::mathHyperbolicSine($this->Close)); + self::assertEquals(trader_sinh($this->Close), Trader::mathHyperbolicSine($this->Close)); } public function testFriendlyFunctions_sma() { - $this->assertEquals(trader_sma($this->Close, 30), Trader::simpleMovingAverage($this->Close, 30)); + self::assertEquals(trader_sma($this->Close, 30), Trader::simpleMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_sqrt() { - $this->assertEquals(trader_sqrt($this->Close), Trader::mathSquareRoot($this->Close)); + self::assertEquals(trader_sqrt($this->Close), Trader::mathSquareRoot($this->Close)); } public function testFriendlyFunctions_stddev() { - $this->assertEquals(trader_stddev($this->Close, 5, 1.0), Trader::standardDeviation($this->Close, 5, 1.0)); + self::assertEquals(trader_stddev($this->Close, 5, 1.0), Trader::standardDeviation($this->Close, 5, 1.0)); } public function testFriendlyFunctions_stoch() { - $this->assertEquals(trader_stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA), Trader::stochastic($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stoch($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA), Trader::stochastic($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA, 3, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_stochf() { - $this->assertEquals(trader_stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochasticFast($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stochf($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochasticFast($this->High, $this->Low, $this->Close, 5, 3, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_stochrsi() { - $this->assertEquals(trader_stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochasticRelativeStrengthIndex($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA)); + self::assertEquals(trader_stochrsi($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA), Trader::stochasticRelativeStrengthIndex($this->Close, 14, 5, 3, TRADER_MA_TYPE_SMA)); } public function testFriendlyFunctions_sub() { - $this->assertEquals(trader_sub($this->High, $this->Low), Trader::mathSubtraction($this->High, $this->Low)); + self::assertEquals(trader_sub($this->High, $this->Low), Trader::mathSubtraction($this->High, $this->Low)); } public function testFriendlyFunctions_sum() { - $this->assertEquals(trader_sum($this->High, 30), Trader::mathSummation($this->High, 30)); + self::assertEquals(trader_sum($this->High, 30), Trader::mathSummation($this->High, 30)); } public function testFriendlyFunctions_t3() { - $this->assertEquals(trader_t3($this->High, 5, 0.7), Trader::tripleExponentialMovingAverageT3($this->High, 5, 0.7)); + self::assertEquals(trader_t3($this->High, 5, 0.7), Trader::tripleExponentialMovingAverageT3($this->High, 5, 0.7)); } public function testFriendlyFunctions_tan() { - $this->assertEquals(trader_tan($this->Close), Trader::mathTangent($this->Close)); + self::assertEquals(trader_tan($this->Close), Trader::mathTangent($this->Close)); } public function testFriendlyFunctions_tanh() { - $this->assertEquals(trader_tanh($this->Close), Trader::mathHyperbolicTangent($this->Close)); + self::assertEquals(trader_tanh($this->Close), Trader::mathHyperbolicTangent($this->Close)); } public function testFriendlyFunctions_tema() { - $this->assertEquals(trader_tema($this->Close, 30), Trader::tripleExponentialMovingAverage($this->Close, 30)); + self::assertEquals(trader_tema($this->Close, 30), Trader::tripleExponentialMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_trange() { - $this->assertEquals(trader_trange($this->High, $this->Low, $this->Close), Trader::trueRange($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_trange($this->High, $this->Low, $this->Close), Trader::trueRange($this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_trima() { - $this->assertEquals(trader_trima($this->Close, 30), Trader::triangularMovingAverage($this->Close, 30)); + self::assertEquals(trader_trima($this->Close, 30), Trader::triangularMovingAverage($this->Close, 30)); } public function testFriendlyFunctions_trix() { - $this->assertEquals(trader_trix($this->Close, 30), Trader::tripleExponentialAverage($this->Close, 30)); + self::assertEquals(trader_trix($this->Close, 30), Trader::tripleExponentialAverage($this->Close, 30)); } public function testFriendlyFunctions_tsf() { - $this->assertEquals(trader_tsf($this->Close, 14), Trader::timeSeriesForecast($this->Close, 14)); + self::assertEquals(trader_tsf($this->Close, 14), Trader::timeSeriesForecast($this->Close, 14)); } public function testFriendlyFunctions_typprice() { - $this->assertEquals(trader_typprice($this->High, $this->Low, $this->Close), Trader::typicalPrice($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_typprice($this->High, $this->Low, $this->Close), Trader::typicalPrice($this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_ultosc() { - $this->assertEquals(trader_ultosc($this->High, $this->Low, $this->Close, 7, 14, 28), Trader::ultimateOscillator($this->High, $this->Low, $this->Close, 7, 14, 28)); + self::assertEquals(trader_ultosc($this->High, $this->Low, $this->Close, 7, 14, 28), Trader::ultimateOscillator($this->High, $this->Low, $this->Close, 7, 14, 28)); } public function testFriendlyFunctions_var() { - $this->assertEquals(trader_var($this->Close, 5, 1.0), Trader::variance($this->Close, 5, 1.0)); + self::assertEquals(trader_var($this->Close, 5, 1.0), Trader::variance($this->Close, 5, 1.0)); } public function testFriendlyFunctions_wclprice() { - $this->assertEquals(trader_wclprice($this->High, $this->Low, $this->Close), Trader::weightedClosePrice($this->High, $this->Low, $this->Close)); + self::assertEquals(trader_wclprice($this->High, $this->Low, $this->Close), Trader::weightedClosePrice($this->High, $this->Low, $this->Close)); } public function testFriendlyFunctions_willr() { - $this->assertEquals(trader_willr($this->High, $this->Low, $this->Close, 14), Trader::williamsR($this->High, $this->Low, $this->Close, 14)); + self::assertEquals(trader_willr($this->High, $this->Low, $this->Close, 14), Trader::williamsR($this->High, $this->Low, $this->Close, 14)); } public function testFriendlyFunctions_wma() { - $this->assertEquals(trader_wma($this->Close, 30), Trader::weightedMovingAverage($this->Close, 30)); + self::assertEquals(trader_wma($this->Close, 30), Trader::weightedMovingAverage($this->Close, 30)); } - -// + + // } diff --git a/composer.json b/composer.json index b4b6786..ad95cb9 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,27 @@ { "name": "lupecode/php-trader-interface", "description": "An interface to the PHP Trader extension.", - "version": "1.0.1", + "version": "1.0.5", "type": "library", - "license": "GNU GPLv3", - "authors":[ + "license": "GPL-3.0-or-later", + "authors": [ { - "name": "Joshua Saige", - "email": "joshuasaige@lupecode.com", - "homepage": "http://github.com/jbsaige", + "name": "Joshua Lopez", + "email": "joshua@lupecode.com", + "homepage": "http://github.com/LupeCode", "role": "Developer" } ], "require": { "php": ">=7.0.0", - "ext-trader": "*" + "ext-trader": ">=0.4.1" }, "require-dev": { - "phpunit/phpunit": "~5.4" + "phpunit/phpunit": "~6.3.0", + "codacy/coverage": "~1.4.0", + "phpmetrics/phpmetrics": "~2.3.2" }, "autoload": { "psr-4": {"LupeCode\\phpTraderInterface\\": "source/"} } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 98d296f..82fe9f9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,38 +4,82 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "633890059dff9b60f61c9e9accfe0ce3", - "content-hash": "a31b8d538a81d00704f9879d8a24e686", + "content-hash": "f7641e61f8461268a7d266bc0e55f69e", "packages": [], "packages-dev": [ + { + "name": "codacy/coverage", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/codacy/php-codacy-coverage.git", + "reference": "546ac2e000a004571c1000ecff4d68a98706db3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codacy/php-codacy-coverage/zipball/546ac2e000a004571c1000ecff4d68a98706db3a", + "reference": "546ac2e000a004571c1000ecff4d68a98706db3a", + "shasum": "" + }, + "require": { + "gitonomy/gitlib": ">=1.0", + "php": ">=5.3.3", + "symfony/console": "~2.5|~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.5" + }, + "bin": [ + "bin/codacycoverage" + ], + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakob Pupke", + "email": "jakob.pupke@gmail.com" + } + ], + "description": "Sends PHP test coverage information to Codacy.", + "homepage": "https://github.com/codacy/php-codacy-coverage", + "time": "2017-12-20T14:31:46+00:00" + }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -60,41 +104,100 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "gitonomy/gitlib", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/gitonomy/gitlib.git", + "reference": "1c2b0605115786613cb517798046c8ab57c17097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/1c2b0605115786613cb517798046c8ab57c17097", + "reference": "1c2b0605115786613cb517798046c8ab57c17097", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0", + "symfony/process": "^2.3|^3.0|^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.7", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Add some log" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Gitonomy\\Git\\": "src/Gitonomy/Git/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexandre Salomé", + "email": "alexandre.salome@gmail.com", + "homepage": "http://alexandre-salome.fr" + }, + { + "name": "Julien DIDIER", + "email": "genzo.wm@gmail.com", + "homepage": "http://www.jdidier.net" + } + ], + "description": "Library for accessing git", + "homepage": "http://gitonomy.com", + "time": "2018-01-10T11:34:47+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.5.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "a8773992b362b58498eed24bf85005f363c34771" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", - "reference": "a8773992b362b58498eed24bf85005f363c34771", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -102,20 +205,173 @@ "object", "object graph" ], - "time": "2015-11-20 12:04:31" + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.3", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "579f4ce846734a1cf55d6a531d00ca07a43e3cda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/579f4ce846734a1cf55d6a531d00ca07a43e3cda", + "reference": "579f4ce846734a1cf55d6a531d00ca07a43e3cda", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2017-12-26T14:43:21+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -156,33 +412,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.0", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -201,24 +463,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-06-10 09:48:41" + "time": "2017-11-27T17:38:31+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -248,36 +510,98 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-06-10 07:14:17" + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpmetrics/phpmetrics", + "version": "v2.3.2", + "source": { + "type": "git", + "url": "https://github.com/phpmetrics/PhpMetrics.git", + "reference": "e44f5224d08571ee6ba85c50379560b9ec217b91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/e44f5224d08571ee6ba85c50379560b9ec217b91", + "reference": "e44f5224d08571ee6ba85c50379560b9ec217b91", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "v3.*", + "php": ">=5.5" + }, + "replace": { + "halleck45/php-metrics": "*", + "halleck45/phpmetrics": "*" + }, + "require-dev": { + "phpunit/phpunit": ">=4.8.27,<=5.7.13" + }, + "bin": [ + "bin/phpmetrics" + ], + "type": "library", + "autoload": { + "psr-0": { + "Hal\\": "./src/" + }, + "files": [ + "./src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Lépine", + "email": "lepinejeanfrancois@yahoo.fr", + "homepage": "http://www.lepine.pro", + "role": "Copyright Holder" + } + ], + "description": "Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !", + "homepage": "http://www.phpmetrics.org", + "keywords": [ + "analysis", + "qa", + "quality", + "testing" + ], + "time": "2017-10-13T16:11:30+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.1", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "^2.0" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -310,44 +634,44 @@ "spy", "stub" ], - "time": "2016-06-07 08:13:47" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.0", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", - "sebastian/code-unit-reverse-lookup": "~1.0", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0|~2.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.4.0", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -362,7 +686,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -373,20 +697,20 @@ "testing", "xunit" ], - "time": "2016-06-03 05:03:56" + "time": "2017-12-06T09:29:45+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -420,7 +744,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -461,29 +785,34 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -505,33 +834,33 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -554,51 +883,57 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "5.4.7", + "version": "6.3.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6c8a756c17a1a92a066c99860eb57922e8b723da" + "reference": "c0ff817b36a827e64bf5f57bc72278150cf30a77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6c8a756c17a1a92a066c99860eb57922e8b723da", - "reference": "6c8a756c17a1a92a066c99860eb57922e8b723da", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c0ff817b36a827e64bf5f57bc72278150cf30a77", + "reference": "c0ff817b36a827e64bf5f57bc72278150cf30a77", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "^1.3 || ^2.0", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -606,7 +941,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.4.x-dev" + "dev-master": "6.3.x-dev" } }, "autoload": { @@ -632,33 +967,33 @@ "testing", "xunit" ], - "time": "2016-07-21 06:55:27" + "time": "2017-09-24T07:25:54+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.2.3", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "b13d0d9426ced06958bd32104653526a6c998a52" + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", - "reference": "b13d0d9426ced06958bd32104653526a6c998a52", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -666,7 +1001,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -691,27 +1026,27 @@ "mock", "xunit" ], - "time": "2016-06-12 07:37:26" + "time": "2017-08-03T14:08:16+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { @@ -736,34 +1071,34 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "11c07feade1d65453e06df3b3b90171d6d982087" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/11c07feade1d65453e06df3b3b90171d6d982087", + "reference": "11c07feade1d65453e06df3b3b90171d6d982087", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -794,38 +1129,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2018-01-12T06:34:42+00:00" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -852,32 +1187,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "1.3.7", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -902,34 +1237,34 @@ "environment", "hhvm" ], - "time": "2016-05-17 03:18:57" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -969,27 +1304,27 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -997,7 +1332,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1020,33 +1355,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "1.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1066,32 +1402,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28 13:25:10" + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1119,7 +1500,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1161,20 +1542,20 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { @@ -1204,34 +1585,53 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-02-04 12:56:52" + "time": "2016-10-03T07:35:21+00:00" }, { - "name": "symfony/yaml", - "version": "v3.1.2", + "name": "symfony/console", + "version": "v4.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" + "url": "https://github.com/symfony/console.git", + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", - "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", + "url": "https://api.github.com/repos/symfony/console/zipball/fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Component\\Console\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1251,34 +1651,183 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:41:56" + "time": "2018-01-03T07:38:00+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/process", + "version": "v4.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "2145b3e8137e463b1051b79440a59b38220944f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/2145b3e8137e463b1051b79440a59b38220944f0", + "reference": "2145b3e8137e463b1051b79440a59b38220944f0", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:38:00+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1302,7 +1851,7 @@ "check", "validate" ], - "time": "2015-08-24 13:29:44" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..32c9919 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,35 @@ + + + + + + + tests + + + + + + source + + + + + + + + + diff --git a/source/Trader.php b/source/Trader.php index 65e24c7..6704327 100644 --- a/source/Trader.php +++ b/source/Trader.php @@ -24,6 +24,7 @@ class Trader * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathArcCosine(array $real): array { @@ -48,6 +49,7 @@ public static function mathArcCosine(array $real): array * @param array $volume Volume traded, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function chaikinAccumulationDistributionLine(array $high, array $low, array $close, array $volume): array { @@ -61,6 +63,7 @@ public static function chaikinAccumulationDistributionLine(array $high, array $l * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathAddition(array $real0, array $real1): array { @@ -87,6 +90,7 @@ public static function mathAddition(array $real0, array $real1): array * @param int|null $slowPeriod Number of period for the slow MA. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function chaikinAccumulationDistributionOscillator(array $high, array $low, array $close, array $volume, int $fastPeriod = null, int $slowPeriod = null): array { @@ -113,6 +117,7 @@ public static function chaikinAccumulationDistributionOscillator(array $high, ar * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function averageDirectionalMovementIndex(array $high, array $low, array $close, int $timePeriod = null): array { @@ -134,6 +139,7 @@ public static function averageDirectionalMovementIndex(array $high, array $low, * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function averageDirectionalMovementIndexRating(array $high, array $low, array $close, int $timePeriod = null): array { @@ -158,6 +164,7 @@ public static function averageDirectionalMovementIndexRating(array $high, array * @param int|null $mAType Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function absolutePriceOscillator(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null): array { @@ -178,6 +185,7 @@ public static function absolutePriceOscillator(array $real, int $fastPeriod = nu * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function aroonIndicator(array $high, array $low, int $timePeriod = null): array { @@ -195,6 +203,7 @@ public static function aroonIndicator(array $high, array $low, int $timePeriod = * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function arronOscillator(array $high, array $low, int $timePeriod = null): array { @@ -209,6 +218,7 @@ public static function arronOscillator(array $high, array $low, int $timePeriod * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathArcSine(array $real): array { @@ -223,6 +233,7 @@ public static function mathArcSine(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathArcTangent(array $real): array { @@ -245,6 +256,7 @@ public static function mathArcTangent(array $real): array * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function averageTrueRange(array $high, array $low, array $close, int $timePeriod = null): array { @@ -263,6 +275,7 @@ public static function averageTrueRange(array $high, array $low, array $close, i * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function averagePrice(array $open, array $high, array $low, array $close): array { @@ -285,6 +298,7 @@ public static function averagePrice(array $open, array $high, array $low, array * @param int|null $mAType Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function bollingerBands(array $real, int $timePeriod = null, float $nbDevUp = null, float $nbDevDn = null, int $mAType = null): array { @@ -307,6 +321,7 @@ public static function bollingerBands(array $real, int $timePeriod = null, float * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function betaVolatility(array $real0, array $real1, int $timePeriod = null): array { @@ -322,6 +337,7 @@ public static function betaVolatility(array $real0, array $real1, int $timePerio * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function balanceOfPower(array $open, array $high, array $low, array $close): array { @@ -340,6 +356,7 @@ public static function balanceOfPower(array $open, array $high, array $low, arra * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function commodityChannelIndex(array $high, array $low, array $close, int $timePeriod = null): array { @@ -355,6 +372,7 @@ public static function commodityChannelIndex(array $high, array $low, array $clo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleTwoCrows(array $open, array $high, array $low, array $close): array { @@ -370,6 +388,7 @@ public static function candleTwoCrows(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeBlackCrows(array $open, array $high, array $low, array $close): array { @@ -385,6 +404,7 @@ public static function candleThreeBlackCrows(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeInsideUpDown(array $open, array $high, array $low, array $close): array { @@ -400,6 +420,7 @@ public static function candleThreeInsideUpDown(array $open, array $high, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeLineStrike(array $open, array $high, array $low, array $close): array { @@ -415,6 +436,7 @@ public static function candleThreeLineStrike(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeOutsideUpDown(array $open, array $high, array $low, array $close): array { @@ -430,6 +452,7 @@ public static function candleThreeOutsideUpDown(array $open, array $high, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeStarsInTheSouth(array $open, array $high, array $low, array $close): array { @@ -445,6 +468,7 @@ public static function candleThreeStarsInTheSouth(array $open, array $high, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThreeWhiteSoldiers(array $open, array $high, array $low, array $close): array { @@ -461,6 +485,7 @@ public static function candleThreeWhiteSoldiers(array $open, array $high, array * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleAbandonedBaby(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -476,6 +501,7 @@ public static function candleAbandonedBaby(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleAdvanceBlock(array $open, array $high, array $low, array $close): array { @@ -491,6 +517,7 @@ public static function candleAdvanceBlock(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleBeltHold(array $open, array $high, array $low, array $close): array { @@ -506,6 +533,7 @@ public static function candleBeltHold(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleBreakaway(array $open, array $high, array $low, array $close): array { @@ -521,6 +549,7 @@ public static function candleBreakaway(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleClosingMarubozu(array $open, array $high, array $low, array $close): array { @@ -536,6 +565,7 @@ public static function candleClosingMarubozu(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleConcealingBabySwallow(array $open, array $high, array $low, array $close): array { @@ -551,6 +581,7 @@ public static function candleConcealingBabySwallow(array $open, array $high, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleCounterattack(array $open, array $high, array $low, array $close): array { @@ -567,6 +598,7 @@ public static function candleCounterattack(array $open, array $high, array $low, * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleDarkCloudCover(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -582,6 +614,7 @@ public static function candleDarkCloudCover(array $open, array $high, array $low * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleDoji(array $open, array $high, array $low, array $close): array { @@ -597,6 +630,7 @@ public static function candleDoji(array $open, array $high, array $low, array $c * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleDojiStar(array $open, array $high, array $low, array $close): array { @@ -612,6 +646,7 @@ public static function candleDojiStar(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleDragonflyDoji(array $open, array $high, array $low, array $close): array { @@ -627,6 +662,7 @@ public static function candleDragonflyDoji(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleEngulfingPattern(array $open, array $high, array $low, array $close): array { @@ -643,6 +679,7 @@ public static function candleEngulfingPattern(array $open, array $high, array $l * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleEveningDojiStar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -659,6 +696,7 @@ public static function candleEveningDojiStar(array $open, array $high, array $lo * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleEveningStar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -674,6 +712,7 @@ public static function candleEveningStar(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleUpDownGapsSideBySideWhiteLines(array $open, array $high, array $low, array $close): array { @@ -689,6 +728,7 @@ public static function candleUpDownGapsSideBySideWhiteLines(array $open, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleGravestoneDoji(array $open, array $high, array $low, array $close): array { @@ -704,6 +744,7 @@ public static function candleGravestoneDoji(array $open, array $high, array $low * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHammer(array $open, array $high, array $low, array $close): array { @@ -719,6 +760,7 @@ public static function candleHammer(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHangingMan(array $open, array $high, array $low, array $close): array { @@ -734,6 +776,7 @@ public static function candleHangingMan(array $open, array $high, array $low, ar * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHarami(array $open, array $high, array $low, array $close): array { @@ -749,6 +792,7 @@ public static function candleHarami(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHaramiCross(array $open, array $high, array $low, array $close): array { @@ -764,6 +808,7 @@ public static function candleHaramiCross(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHighWave(array $open, array $high, array $low, array $close): array { @@ -779,6 +824,7 @@ public static function candleHighWave(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHikkake(array $open, array $high, array $low, array $close): array { @@ -794,6 +840,7 @@ public static function candleHikkake(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleModifiedHikkake(array $open, array $high, array $low, array $close): array { @@ -809,6 +856,7 @@ public static function candleModifiedHikkake(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleHomingPigeon(array $open, array $high, array $low, array $close): array { @@ -824,6 +872,7 @@ public static function candleHomingPigeon(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleIdenticalThreeCrows(array $open, array $high, array $low, array $close): array { @@ -839,6 +888,7 @@ public static function candleIdenticalThreeCrows(array $open, array $high, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleInNeck(array $open, array $high, array $low, array $close): array { @@ -854,6 +904,7 @@ public static function candleInNeck(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleInvertedHammer(array $open, array $high, array $low, array $close): array { @@ -869,6 +920,7 @@ public static function candleInvertedHammer(array $open, array $high, array $low * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleKicking(array $open, array $high, array $low, array $close): array { @@ -884,6 +936,7 @@ public static function candleKicking(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleKickingByLength(array $open, array $high, array $low, array $close): array { @@ -899,6 +952,7 @@ public static function candleKickingByLength(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleLadderBottom(array $open, array $high, array $low, array $close): array { @@ -914,6 +968,7 @@ public static function candleLadderBottom(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleLongLeggedDoji(array $open, array $high, array $low, array $close): array { @@ -929,6 +984,7 @@ public static function candleLongLeggedDoji(array $open, array $high, array $low * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleLongLine(array $open, array $high, array $low, array $close): array { @@ -944,6 +1000,7 @@ public static function candleLongLine(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleMarubozu(array $open, array $high, array $low, array $close): array { @@ -959,6 +1016,7 @@ public static function candleMarubozu(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleMatchingLow(array $open, array $high, array $low, array $close): array { @@ -975,6 +1033,7 @@ public static function candleMatchingLow(array $open, array $high, array $low, a * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleMatHold(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -991,6 +1050,7 @@ public static function candleMatHold(array $open, array $high, array $low, array * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleMorningDojiStar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -1007,6 +1067,7 @@ public static function candleMorningDojiStar(array $open, array $high, array $lo * @param float $penetration Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleMorningStar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -1022,6 +1083,7 @@ public static function candleMorningStar(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleOnNeck(array $open, array $high, array $low, array $close): array { @@ -1037,6 +1099,7 @@ public static function candleOnNeck(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candlePiercing(array $open, array $high, array $low, array $close): array { @@ -1052,6 +1115,7 @@ public static function candlePiercing(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleRickshawMan(array $open, array $high, array $low, array $close): array { @@ -1067,6 +1131,7 @@ public static function candleRickshawMan(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleRisingFallingThreeMethods(array $open, array $high, array $low, array $close): array { @@ -1082,6 +1147,7 @@ public static function candleRisingFallingThreeMethods(array $open, array $high, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleSeparatingLines(array $open, array $high, array $low, array $close): array { @@ -1097,6 +1163,7 @@ public static function candleSeparatingLines(array $open, array $high, array $lo * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleShootingStar(array $open, array $high, array $low, array $close): array { @@ -1112,6 +1179,7 @@ public static function candleShootingStar(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleShortLine(array $open, array $high, array $low, array $close): array { @@ -1127,6 +1195,7 @@ public static function candleShortLine(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleSpinningTop(array $open, array $high, array $low, array $close): array { @@ -1142,6 +1211,7 @@ public static function candleSpinningTop(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleStalled(array $open, array $high, array $low, array $close): array { @@ -1157,6 +1227,7 @@ public static function candleStalled(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleStickSandwich(array $open, array $high, array $low, array $close): array { @@ -1172,6 +1243,7 @@ public static function candleStickSandwich(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleTakuri(array $open, array $high, array $low, array $close): array { @@ -1187,6 +1259,7 @@ public static function candleTakuri(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleTasukiGap(array $open, array $high, array $low, array $close): array { @@ -1202,6 +1275,7 @@ public static function candleTasukiGap(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleThrusting(array $open, array $high, array $low, array $close): array { @@ -1217,6 +1291,7 @@ public static function candleThrusting(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleTristar(array $open, array $high, array $low, array $close): array { @@ -1232,6 +1307,7 @@ public static function candleTristar(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleUniqueThreeRiver(array $open, array $high, array $low, array $close): array { @@ -1247,6 +1323,7 @@ public static function candleUniqueThreeRiver(array $open, array $high, array $l * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleUpsideGapTwoCrows(array $open, array $high, array $low, array $close): array { @@ -1262,6 +1339,7 @@ public static function candleUpsideGapTwoCrows(array $open, array $high, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function candleUpsideDownsideGapThreeMethods(array $open, array $high, array $low, array $close): array { @@ -1276,6 +1354,7 @@ public static function candleUpsideDownsideGapThreeMethods(array $open, array $h * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathCeiling(array $real): array { @@ -1293,6 +1372,7 @@ public static function mathCeiling(array $real): array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function chandeMomentumOscillator(array $real, int $timePeriod): array { @@ -1309,6 +1389,7 @@ public static function chandeMomentumOscillator(array $real, int $timePeriod): a * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function pearsonCorrelationCoefficient(array $real0, array $real1, int $timePeriod = null): array { @@ -1323,6 +1404,7 @@ public static function pearsonCorrelationCoefficient(array $real0, array $real1, * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathCosine(array $real): array { @@ -1337,6 +1419,7 @@ public static function mathCosine(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathHyperbolicCosine(array $real): array { @@ -1353,6 +1436,7 @@ public static function mathHyperbolicCosine(array $real): array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function doubleExponentialMovingAverage(array $real, int $timePeriod): array { @@ -1368,6 +1452,7 @@ public static function doubleExponentialMovingAverage(array $real, int $timePeri * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathDivision(array $real0, array $real1): array { @@ -1386,6 +1471,7 @@ public static function mathDivision(array $real0, array $real1): array * @param int|null $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function directionalMovementIndex(array $high, array $low, array $close, int $timePeriod = null): array { @@ -1403,6 +1489,7 @@ public static function directionalMovementIndex(array $high, array $low, array $ * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function exponentialMovingAverage(array $real, int $timePeriod): array { @@ -1415,8 +1502,9 @@ public static function exponentialMovingAverage(array $real, int $timePeriod): a * Get error code of the last operation. * * @return int Returns the error code identified by one of the TRADER_ERR_* constants. + * @throws \Exception */ - public static function errorNumber(): integer + public static function errorNumber(): int { return static::errno(); } @@ -1429,6 +1517,7 @@ public static function errorNumber(): integer * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathExponent(array $real): array { @@ -1443,6 +1532,7 @@ public static function mathExponent(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathFloor(array $real): array { @@ -1455,8 +1545,9 @@ public static function mathFloor(array $real): array * Get compatibility mode which affects the way calculations are done by all the extension functions. * * @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants. + * @throws \Exception */ - public static function getCompatibilityMode(): integer + public static function getCompatibilityMode(): int { return static::get_compat(); } @@ -1469,8 +1560,9 @@ public static function getCompatibilityMode(): integer * @param int $functionId Function ID the factor to be read for. TRADER_FUNC_UNST_* series of constants should be used. * * @return int Returns the unstable period factor for the corresponding function. + * @throws \Exception */ - public static function getUnstablePeriod(integer $functionId): integer + public static function getUnstablePeriod(int $functionId): int { return static::get_unstable_period($functionId); } @@ -1481,6 +1573,7 @@ public static function getUnstablePeriod(integer $functionId): integer * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function hilbertTransformDominantCyclePeriod(array $real): array { @@ -1493,6 +1586,7 @@ public static function hilbertTransformDominantCyclePeriod(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function hilbertTransformDominantCyclePhase(array $real): array { @@ -1502,27 +1596,27 @@ public static function hilbertTransformDominantCyclePhase(array $real): array /** * Hilbert Transform - Phasor Components * - * @param array $real Array of real values. - * @param array $inPhase Empty array, will be filled with in phase data. + * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function hilbertTransformPhasorComponents(array $real, array &$inPhase): array + public static function hilbertTransformPhasorComponents(array $real): array { - return static::ht_phasor($real, $inPhase); + return static::ht_phasor($real); } /** * Hilbert Transform - SineWave * * @param array $real Array of real values. - * @param array $sine Empty array, will be filled with sine data. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function hilbertTransformSineWave(array $real, array &$sine): array + public static function hilbertTransformSineWave(array $real): array { - return static::ht_sine($real, $sine); + return static::ht_sine($real); } /** @@ -1531,6 +1625,7 @@ public static function hilbertTransformSineWave(array $real, array &$sine): arra * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function hilbertTransformInstantaneousTrendLine(array $real): array { @@ -1543,6 +1638,7 @@ public static function hilbertTransformInstantaneousTrendLine(array $real): arra * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function hilbertTransformTrendVsCycleMode(array $real): array { @@ -1561,6 +1657,7 @@ public static function hilbertTransformTrendVsCycleMode(array $real): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function kaufmanAdaptiveMovingAverage(array $real, int $timePeriod = null): array { @@ -1574,6 +1671,7 @@ public static function kaufmanAdaptiveMovingAverage(array $real, int $timePeriod * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearRegressionAngle(array $real, int $timePeriod = null): array { @@ -1587,6 +1685,7 @@ public static function linearRegressionAngle(array $real, int $timePeriod = null * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearRegressionIntercept(array $real, int $timePeriod = null): array { @@ -1600,6 +1699,7 @@ public static function linearRegressionIntercept(array $real, int $timePeriod = * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearRegressionSlope(array $real, int $timePeriod = null): array { @@ -1613,6 +1713,7 @@ public static function linearRegressionSlope(array $real, int $timePeriod = null * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearRegression(array $real, int $timePeriod = null): array { @@ -1627,6 +1728,7 @@ public static function linearRegression(array $real, int $timePeriod = null): ar * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathLogarithmNatural(array $real): array { @@ -1641,6 +1743,7 @@ public static function mathLogarithmNatural(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathLogarithmBase10(array $real): array { @@ -1655,6 +1758,7 @@ public static function mathLogarithmBase10(array $real): array * @param int $mAType Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function movingAverage(array $real, int $timePeriod = null, int $mAType = null): array { @@ -1670,6 +1774,7 @@ public static function movingAverage(array $real, int $timePeriod = null, int $m * @param int|null $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function movingAverageConvergenceDivergence(array $real, int $fastPeriod = null, int $slowPeriod = null, int $signalPeriod = null): array { @@ -1687,6 +1792,7 @@ public static function movingAverageConvergenceDivergence(array $real, int $fast * @param int|null $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function movingAverageConvergenceDivergenceExtended(array $real, int $fastPeriod = null, int $fastMAType = null, int $slowPeriod = null, int $slowMAType = null, int $signalPeriod = null): array { @@ -1700,6 +1806,7 @@ public static function movingAverageConvergenceDivergenceExtended(array $real, i * @param int|null $signalPeriod Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function movingAverageConvergenceDivergenceFixed(array $real, int $signalPeriod = null): array { @@ -1714,6 +1821,7 @@ public static function movingAverageConvergenceDivergenceFixed(array $real, int * @param float|null $slowLimit Lower limit use in the adaptive algorithm. Valid range from 0.01 to 0.99. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mesaAdaptiveMovingAverage(array $real, float $fastLimit = null, float $slowLimit = null): array { @@ -1730,6 +1838,7 @@ public static function mesaAdaptiveMovingAverage(array $real, float $fastLimit = * @param int|null $mAType Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function movingAverageVariablePeriod(array $real, array $periods, int $minPeriod = null, int $maxPeriod = null, int $mAType = null): array { @@ -1743,6 +1852,7 @@ public static function movingAverageVariablePeriod(array $real, array $periods, * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMax(array $real, int $timePeriod = null): array { @@ -1756,6 +1866,7 @@ public static function mathMax(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMaxIndex(array $real, int $timePeriod = null): array { @@ -1769,6 +1880,7 @@ public static function mathMaxIndex(array $real, int $timePeriod = null): array * @param array $low Low price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMedianPrice(array $high, array $low): array { @@ -1785,6 +1897,7 @@ public static function mathMedianPrice(array $high, array $low): array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function moneyFlowIndex(array $high, array $low, array $close, array $volume, int $timePeriod = null): array { @@ -1798,6 +1911,7 @@ public static function moneyFlowIndex(array $high, array $low, array $close, arr * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function middlePoint(array $real, int $timePeriod = null): array { @@ -1812,8 +1926,9 @@ public static function middlePoint(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function middlePointPrice(array $high, array $low, int $timePeriod = null) + public static function middlePointPrice(array $high, array $low, int $timePeriod = null): array { return static::midprice($high, $low, $timePeriod); } @@ -1825,6 +1940,7 @@ public static function middlePointPrice(array $high, array $low, int $timePeriod * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMin(array $real, int $timePeriod = null): array { @@ -1838,6 +1954,7 @@ public static function mathMin(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMinIndex(array $real, int $timePeriod = null): array { @@ -1851,6 +1968,7 @@ public static function mathMinIndex(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMinMax(array $real, int $timePeriod = null): array { @@ -1864,6 +1982,7 @@ public static function mathMinMax(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMinMaxIndex(array $real, int $timePeriod = null): array { @@ -1879,6 +1998,7 @@ public static function mathMinMaxIndex(array $real, int $timePeriod = null): arr * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minusDirectionalIndicator(array $high, array $low, array $close, int $timePeriod = null): array { @@ -1893,6 +2013,7 @@ public static function minusDirectionalIndicator(array $high, array $low, array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minusDirectionalMovement(array $high, array $low, int $timePeriod = null): array { @@ -1906,6 +2027,7 @@ public static function minusDirectionalMovement(array $high, array $low, int $ti * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function momentum(array $real, int $timePeriod = null): array { @@ -1920,6 +2042,7 @@ public static function momentum(array $real, int $timePeriod = null): array * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathMultiply(array $real0, array $real1): array { @@ -1935,6 +2058,7 @@ public static function mathMultiply(array $real0, array $real1): array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function normalizedAverageTrueRange(array $high, array $low, array $close, int $timePeriod = null): array { @@ -1948,6 +2072,7 @@ public static function normalizedAverageTrueRange(array $high, array $low, array * @param array $volume Volume traded, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function onBalanceVolume(array $real, array $volume): array { @@ -1963,6 +2088,7 @@ public static function onBalanceVolume(array $real, array $volume): array * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function plusDirectionalIndicator(array $high, array $low, array $close, int $timePeriod = null): array { @@ -1977,6 +2103,7 @@ public static function plusDirectionalIndicator(array $high, array $low, array $ * @param int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function plusDirectionalMovement(array $high, array $low, int $timePeriod = null): array { @@ -1992,6 +2119,7 @@ public static function plusDirectionalMovement(array $high, array $low, int $tim * @param int|null $mAType Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function percentagePriceOscillator(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null): array { @@ -2005,6 +2133,7 @@ public static function percentagePriceOscillator(array $real, int $fastPeriod = * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rateOfChange(array $real, int $timePeriod = null): array { @@ -2018,6 +2147,7 @@ public static function rateOfChange(array $real, int $timePeriod = null): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rateOfChangePercentage(array $real, int $timePeriod = null): array { @@ -2031,6 +2161,7 @@ public static function rateOfChangePercentage(array $real, int $timePeriod = nul * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rateOfChangeRatio100(array $real, int $timePeriod = null): array { @@ -2044,6 +2175,7 @@ public static function rateOfChangeRatio100(array $real, int $timePeriod = null) * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rateOfChangeRatio(array $real, int $timePeriod = null): array { @@ -2057,6 +2189,7 @@ public static function rateOfChangeRatio(array $real, int $timePeriod = null): a * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function relativeStrengthIndex(array $real, int $timePeriod = null): array { @@ -2072,6 +2205,7 @@ public static function relativeStrengthIndex(array $real, int $timePeriod = null * @param float|null $maximum Acceleration Factor Maximum value. Valid range from 0 to TRADER_REAL_MAX. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function parabolicSAR(array $high, array $low, float $acceleration = null, float $maximum = null): array { @@ -2093,6 +2227,7 @@ public static function parabolicSAR(array $high, array $low, float $acceleration * @param float|null $accelerationMaxShort Acceleration Factor maximum value for the Short direction. Valid range from 0 to TRADER_REAL_MAX. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function parabolicSARExtended(array $high, array $low, float $startValue = null, float $offsetOnReverse = null, float $accelerationInitLong = null, float $accelerationLong = null, float $accelerationMaxLong = null, float $accelerationInitShort = null, float $accelerationShort = null, float $accelerationMaxShort = null): array { @@ -2104,10 +2239,12 @@ public static function parabolicSARExtended(array $high, array $low, float $star * Set compatibility mode which will affect the way calculations are done by all the extension functions. * * @param int $compatId Compatibility Id. TRADER_COMPATIBILITY_* series of constants should be used. + * + * @throws \Exception */ - public static function setCompatibilityMode(integer $compatId) + public static function setCompatibilityMode(int $compatId) { - return static::set_compat($compatId); + static::set_compat($compatId); } /** @@ -2116,10 +2253,12 @@ public static function setCompatibilityMode(integer $compatId) * * @param int $functionId Function ID the factor should be set for. TRADER_FUNC_UNST_* constant series can be used to affect the corresponding function. * @param int $timePeriod Unstable period value. + * + * @throws \Exception */ - public static function setUnstablePeriod(integer $functionId, int $timePeriod) + public static function setUnstablePeriod(int $functionId, int $timePeriod) { - return static::set_unstable_period($functionId, $timePeriod); + static::set_unstable_period($functionId, $timePeriod); } /** @@ -2129,6 +2268,7 @@ public static function setUnstablePeriod(integer $functionId, int $timePeriod) * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathSine(array $real): array { @@ -2142,6 +2282,7 @@ public static function mathSine(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathHyperbolicSine(array $real): array { @@ -2155,6 +2296,7 @@ public static function mathHyperbolicSine(array $real): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function simpleMovingAverage(array $real, int $timePeriod = null): array { @@ -2168,6 +2310,7 @@ public static function simpleMovingAverage(array $real, int $timePeriod = null): * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathSquareRoot(array $real): array { @@ -2182,6 +2325,7 @@ public static function mathSquareRoot(array $real): array * @param float $nbDev * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function standardDeviation(array $real, int $timePeriod = null, float $nbDev = null): array { @@ -2201,6 +2345,7 @@ public static function standardDeviation(array $real, int $timePeriod = null, fl * @param int|null $slowD_MAType Type of Moving Average for Slow-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stochastic(array $high, array $low, array $close, int $fastK_Period = null, int $slowK_Period = null, int $slowK_MAType = null, int $slowD_Period = null, int $slowD_MAType = null): array { @@ -2218,6 +2363,7 @@ public static function stochastic(array $high, array $low, array $close, int $fa * @param int|null $fastD_MAType Type of Moving Average for Fast-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stochasticFast(array $high, array $low, array $close, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null): array { @@ -2234,6 +2380,7 @@ public static function stochasticFast(array $high, array $low, array $close, int * @param int|null $fastD_MAType Type of Moving Average for Fast-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stochasticRelativeStrengthIndex(array $real, int $timePeriod = null, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null): array { @@ -2248,6 +2395,7 @@ public static function stochasticRelativeStrengthIndex(array $real, int $timePer * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathSubtraction(array $real0, array $real1): array { @@ -2261,6 +2409,7 @@ public static function mathSubtraction(array $real0, array $real1): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathSummation(array $real, int $timePeriod = null): array { @@ -2275,6 +2424,7 @@ public static function mathSummation(array $real, int $timePeriod = null): array * @param float $vFactor Volume Factor. Valid range from 1 to 0. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tripleExponentialMovingAverageT3(array $real, int $timePeriod = null, float $vFactor = null): array { @@ -2288,6 +2438,7 @@ public static function tripleExponentialMovingAverageT3(array $real, int $timePe * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathTangent(array $real): array { @@ -2301,6 +2452,7 @@ public static function mathTangent(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mathHyperbolicTangent(array $real): array { @@ -2314,6 +2466,7 @@ public static function mathHyperbolicTangent(array $real): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tripleExponentialMovingAverage(array $real, int $timePeriod = null): array { @@ -2328,6 +2481,7 @@ public static function tripleExponentialMovingAverage(array $real, int $timePeri * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function trueRange(array $high, array $low, array $close): array { @@ -2341,6 +2495,7 @@ public static function trueRange(array $high, array $low, array $close): array * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function triangularMovingAverage(array $real, int $timePeriod = null): array { @@ -2354,6 +2509,7 @@ public static function triangularMovingAverage(array $real, int $timePeriod = nu * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tripleExponentialAverage(array $real, int $timePeriod = null): array { @@ -2367,6 +2523,7 @@ public static function tripleExponentialAverage(array $real, int $timePeriod = n * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function timeSeriesForecast(array $real, int $timePeriod = null): array { @@ -2381,6 +2538,7 @@ public static function timeSeriesForecast(array $real, int $timePeriod = null): * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function typicalPrice(array $high, array $low, array $close): array { @@ -2398,6 +2556,7 @@ public static function typicalPrice(array $high, array $low, array $close): arra * @param int|null $timePeriod3 Number of bars for 3rd period. Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ultimateOscillator(array $high, array $low, array $close, int $timePeriod1 = null, int $timePeriod2 = null, int $timePeriod3 = null): array { @@ -2412,6 +2571,7 @@ public static function ultimateOscillator(array $high, array $low, array $close, * @param float $nbDev * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function variance(array $real, int $timePeriod = null, float $nbDev = null): array { @@ -2426,6 +2586,7 @@ public static function variance(array $real, int $timePeriod = null, float $nbDe * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function weightedClosePrice(array $high, array $low, array $close): array { @@ -2435,12 +2596,13 @@ public static function weightedClosePrice(array $high, array $low, array $close) /** * Williams' %R * - * @param array $high High price, array of real values. - * @param array $low Low price, array of real values. - * @param array $close Closing price, array of real values. + * @param array $high High price, array of real values. + * @param array $low Low price, array of real values. + * @param array $close Closing price, array of real values. * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function williamsR(array $high, array $low, array $close, int $timePeriod = null): array { @@ -2454,11 +2616,11 @@ public static function williamsR(array $high, array $low, array $close, int $tim * @param null|int $timePeriod Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function weightedMovingAverage(array $real, int $timePeriod = null): array { return static::wma($real, $timePeriod); } - } diff --git a/source/TraderTrait.php b/source/TraderTrait.php index 9711acb..d64515f 100644 --- a/source/TraderTrait.php +++ b/source/TraderTrait.php @@ -69,67 +69,39 @@ trait TraderTrait public static $TRADER_ERR_INTERNAL_ERROR = 5000; public static $TRADER_ERR_UNKNOWN_ERROR = 65535; - private static function checkForError() - { - $ErrorCode = trader_errno(); - if ($ErrorCode === static::$TRADER_ERR_SUCCESS) { - return; - } - if ($ErrorCode === static::$TRADER_ERR_LIB_NOT_INITIALIZE) { - throw new \Exception("Library not initialized", static::$TRADER_ERR_LIB_NOT_INITIALIZE); - } - if ($ErrorCode === static::$TRADER_ERR_BAD_PARAM) { - throw new \Exception("Bad parameter", static::$TRADER_ERR_BAD_PARAM); - } - if ($ErrorCode === static::$TRADER_ERR_ALLOC_ERR) { - throw new \Exception("Allocation error", static::$TRADER_ERR_ALLOC_ERR); - } - if ($ErrorCode === static::$TRADER_ERR_GROUP_NOT_FOUND) { - throw new \Exception("Group not found", static::$TRADER_ERR_GROUP_NOT_FOUND); - } - if ($ErrorCode === static::$TRADER_ERR_FUNC_NOT_FOUND) { - throw new \Exception("Function not found", static::$TRADER_ERR_FUNC_NOT_FOUND); - } - if ($ErrorCode === static::$TRADER_ERR_INVALID_HANDLE) { - throw new \Exception("Invalid handle", static::$TRADER_ERR_INVALID_HANDLE); - } - if ($ErrorCode === static::$TRADER_ERR_INVALID_PARAM_HOLDER) { - throw new \Exception("Invalid parameter holder", static::$TRADER_ERR_INVALID_PARAM_HOLDER); - } - if ($ErrorCode === static::$TRADER_ERR_INVALID_PARAM_HOLDER_TYPE) { - throw new \Exception("Invalid parameter holder type", static::$TRADER_ERR_INVALID_PARAM_HOLDER_TYPE); - } - if ($ErrorCode === static::$TRADER_ERR_INVALID_PARAM_FUNCTION) { - throw new \Exception("Invalid parameter function", static::$TRADER_ERR_INVALID_PARAM_FUNCTION); - } - if ($ErrorCode === static::$TRADER_ERR_INPUT_NOT_ALL_INITIALIZE) { - throw new \Exception("Input not all initialized", static::$TRADER_ERR_INPUT_NOT_ALL_INITIALIZE); + protected static $errorArray = [ + 1 => "Library not initialized", + 2 => "Bad parameter", + 3 => "Allocation error", + 4 => "Group not found", + 5 => "Function not found", + 6 => "Invalid handle", + 7 => "Invalid parameter holder", + 8 => "Invalid parameter holder type", + 9 => "Invalid parameter function", + 10 => "Input not all initialized", + 11 => "Output not all initialized", + 12 => "Out of range on start index", + 13 => "Out of range on end index", + 14 => "Invalid list type", + 15 => "Bad object", + 16 => "Not supported", + 5000 => "Internal error", + 65535 => "Unknown error", + ]; + + /** + * @throws \Exception + */ + protected static function checkForError() + { + $errorNumber = trader_errno(); + switch ($errorNumber) { + case static::$TRADER_ERR_SUCCESS: + return; + default: + throw new \Exception(static::$errorArray[$errorNumber], $errorNumber); } - if ($ErrorCode === static::$TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE) { - throw new \Exception("Output not all initialized", static::$TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE); - } - if ($ErrorCode === static::$TRADER_ERR_OUT_OF_RANGE_START_INDEX) { - throw new \Exception("Out of range on start index", static::$TRADER_ERR_OUT_OF_RANGE_START_INDEX); - } - if ($ErrorCode === static::$TRADER_ERR_OUT_OF_RANGE_END_INDEX) { - throw new \Exception("Out of range on end index", static::$TRADER_ERR_OUT_OF_RANGE_END_INDEX); - } - if ($ErrorCode === static::$TRADER_ERR_INVALID_LIST_TYPE) { - throw new \Exception("Invalid list type", static::$TRADER_ERR_INVALID_LIST_TYPE); - } - if ($ErrorCode === static::$TRADER_ERR_BAD_OBJECT) { - throw new \Exception("Bad object", static::$TRADER_ERR_BAD_OBJECT); - } - if ($ErrorCode === static::$TRADER_ERR_NOT_SUPPORTED) { - throw new \Exception("Not supported", static::$TRADER_ERR_NOT_SUPPORTED); - } - if ($ErrorCode === static::$TRADER_ERR_INTERNAL_ERROR) { - throw new \Exception("Internal error", static::$TRADER_ERR_INTERNAL_ERROR); - } - if ($ErrorCode === static::$TRADER_ERR_UNKNOWN_ERROR) { - throw new \Exception("Unknown error", static::$TRADER_ERR_UNKNOWN_ERROR); - } - } /** @@ -138,6 +110,7 @@ private static function checkForError() * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function acos(array $real): array { @@ -156,6 +129,7 @@ public static function acos(array $real): array * @param array $volume Volume traded, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ad(array $high, array $low, array $close, array $volume): array { @@ -172,6 +146,7 @@ public static function ad(array $high, array $low, array $close, array $volume): * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function add(array $real0, array $real1): array { @@ -192,6 +167,7 @@ public static function add(array $real0, array $real1): array * @param int $slowPeriod [OPTIONAL] [DEFAULT 10] Number of period for the slow MA. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function adosc(array $high, array $low, array $close, array $volume, int $fastPeriod = null, int $slowPeriod = null): array { @@ -212,6 +188,7 @@ public static function adosc(array $high, array $low, array $close, array $volum * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function adx(array $high, array $low, array $close, int $timePeriod = null): array { @@ -231,6 +208,7 @@ public static function adx(array $high, array $low, array $close, int $timePerio * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function adxr(array $high, array $low, array $close, int $timePeriod = null): array { @@ -250,6 +228,7 @@ public static function adxr(array $high, array $low, array $close, int $timePeri * @param int $mAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function apo(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null): array { @@ -270,6 +249,7 @@ public static function apo(array $real, int $fastPeriod = null, int $slowPeriod * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function aroon(array $high, array $low, int $timePeriod = null): array { @@ -288,6 +268,7 @@ public static function aroon(array $high, array $low, int $timePeriod = null): a * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function aroonosc(array $high, array $low, int $timePeriod = null): array { @@ -305,6 +286,7 @@ public static function aroonosc(array $high, array $low, int $timePeriod = null) * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function asin(array $real): array { @@ -321,6 +303,7 @@ public static function asin(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function atan(array $real): array { @@ -339,6 +322,7 @@ public static function atan(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function atr(array $high, array $low, array $close, int $timePeriod = null): array { @@ -358,6 +342,7 @@ public static function atr(array $high, array $low, array $close, int $timePerio * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function avgprice(array $open, array $high, array $low, array $close): array { @@ -377,6 +362,7 @@ public static function avgprice(array $open, array $high, array $low, array $clo * @param int $mAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function bbands(array $real, int $timePeriod = null, float $nbDevUp = null, float $nbDevDn = null, int $mAType = null): array { @@ -398,6 +384,7 @@ public static function bbands(array $real, int $timePeriod = null, float $nbDevU * @param int $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function beta(array $real0, array $real1, int $timePeriod = null): array { @@ -417,6 +404,7 @@ public static function beta(array $real0, array $real1, int $timePeriod = null): * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function bop(array $open, array $high, array $low, array $close): array { @@ -435,6 +423,7 @@ public static function bop(array $open, array $high, array $low, array $close): * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cci(array $high, array $low, array $close, int $timePeriod = null): array { @@ -454,6 +443,7 @@ public static function cci(array $high, array $low, array $close, int $timePerio * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl2crows(array $open, array $high, array $low, array $close): array { @@ -472,6 +462,7 @@ public static function cdl2crows(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3blackcrows(array $open, array $high, array $low, array $close): array { @@ -490,6 +481,7 @@ public static function cdl3blackcrows(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3inside(array $open, array $high, array $low, array $close): array { @@ -508,6 +500,7 @@ public static function cdl3inside(array $open, array $high, array $low, array $c * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3linestrike(array $open, array $high, array $low, array $close): array { @@ -526,6 +519,7 @@ public static function cdl3linestrike(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3outside(array $open, array $high, array $low, array $close): array { @@ -544,6 +538,7 @@ public static function cdl3outside(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3starsinsouth(array $open, array $high, array $low, array $close): array { @@ -562,6 +557,7 @@ public static function cdl3starsinsouth(array $open, array $high, array $low, ar * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdl3whitesoldiers(array $open, array $high, array $low, array $close): array { @@ -581,6 +577,7 @@ public static function cdl3whitesoldiers(array $open, array $high, array $low, a * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlabandonedbaby(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -600,6 +597,7 @@ public static function cdlabandonedbaby(array $open, array $high, array $low, ar * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdladvanceblock(array $open, array $high, array $low, array $close): array { @@ -618,6 +616,7 @@ public static function cdladvanceblock(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlbelthold(array $open, array $high, array $low, array $close): array { @@ -636,6 +635,7 @@ public static function cdlbelthold(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlbreakaway(array $open, array $high, array $low, array $close): array { @@ -654,6 +654,7 @@ public static function cdlbreakaway(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlclosingmarubozu(array $open, array $high, array $low, array $close): array { @@ -672,6 +673,7 @@ public static function cdlclosingmarubozu(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlconcealbabyswall(array $open, array $high, array $low, array $close): array { @@ -690,6 +692,7 @@ public static function cdlconcealbabyswall(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlcounterattack(array $open, array $high, array $low, array $close): array { @@ -709,6 +712,7 @@ public static function cdlcounterattack(array $open, array $high, array $low, ar * @param float $penetration [OPTIONAL] [DEFAULT 0.5] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdldarkcloudcover(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -728,6 +732,7 @@ public static function cdldarkcloudcover(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdldoji(array $open, array $high, array $low, array $close): array { @@ -746,6 +751,7 @@ public static function cdldoji(array $open, array $high, array $low, array $clos * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdldojistar(array $open, array $high, array $low, array $close): array { @@ -764,6 +770,7 @@ public static function cdldojistar(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdldragonflydoji(array $open, array $high, array $low, array $close): array { @@ -782,6 +789,7 @@ public static function cdldragonflydoji(array $open, array $high, array $low, ar * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlengulfing(array $open, array $high, array $low, array $close): array { @@ -801,6 +809,7 @@ public static function cdlengulfing(array $open, array $high, array $low, array * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdleveningdojistar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -821,6 +830,7 @@ public static function cdleveningdojistar(array $open, array $high, array $low, * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdleveningstar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -840,6 +850,7 @@ public static function cdleveningstar(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlgapsidesidewhite(array $open, array $high, array $low, array $close): array { @@ -858,6 +869,7 @@ public static function cdlgapsidesidewhite(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlgravestonedoji(array $open, array $high, array $low, array $close): array { @@ -876,6 +888,7 @@ public static function cdlgravestonedoji(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhammer(array $open, array $high, array $low, array $close): array { @@ -894,6 +907,7 @@ public static function cdlhammer(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhangingman(array $open, array $high, array $low, array $close): array { @@ -912,6 +926,7 @@ public static function cdlhangingman(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlharami(array $open, array $high, array $low, array $close): array { @@ -930,6 +945,7 @@ public static function cdlharami(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlharamicross(array $open, array $high, array $low, array $close): array { @@ -948,6 +964,7 @@ public static function cdlharamicross(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhighwave(array $open, array $high, array $low, array $close): array { @@ -966,6 +983,7 @@ public static function cdlhighwave(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhikkake(array $open, array $high, array $low, array $close): array { @@ -984,6 +1002,7 @@ public static function cdlhikkake(array $open, array $high, array $low, array $c * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhikkakemod(array $open, array $high, array $low, array $close): array { @@ -1002,6 +1021,7 @@ public static function cdlhikkakemod(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlhomingpigeon(array $open, array $high, array $low, array $close): array { @@ -1020,6 +1040,7 @@ public static function cdlhomingpigeon(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlidentical3crows(array $open, array $high, array $low, array $close): array { @@ -1038,6 +1059,7 @@ public static function cdlidentical3crows(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlinneck(array $open, array $high, array $low, array $close): array { @@ -1056,6 +1078,7 @@ public static function cdlinneck(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlinvertedhammer(array $open, array $high, array $low, array $close): array { @@ -1074,6 +1097,7 @@ public static function cdlinvertedhammer(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlkicking(array $open, array $high, array $low, array $close): array { @@ -1092,6 +1116,7 @@ public static function cdlkicking(array $open, array $high, array $low, array $c * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlkickingbylength(array $open, array $high, array $low, array $close): array { @@ -1110,6 +1135,7 @@ public static function cdlkickingbylength(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlladderbottom(array $open, array $high, array $low, array $close): array { @@ -1128,6 +1154,7 @@ public static function cdlladderbottom(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdllongleggeddoji(array $open, array $high, array $low, array $close): array { @@ -1146,6 +1173,7 @@ public static function cdllongleggeddoji(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdllongline(array $open, array $high, array $low, array $close): array { @@ -1164,6 +1192,7 @@ public static function cdllongline(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlmarubozu(array $open, array $high, array $low, array $close): array { @@ -1182,6 +1211,7 @@ public static function cdlmarubozu(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlmatchinglow(array $open, array $high, array $low, array $close): array { @@ -1201,6 +1231,7 @@ public static function cdlmatchinglow(array $open, array $high, array $low, arra * @param float $penetration [OPTIONAL] [DEFAULT 0.5] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlmathold(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -1221,6 +1252,7 @@ public static function cdlmathold(array $open, array $high, array $low, array $c * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlmorningdojistar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -1241,6 +1273,7 @@ public static function cdlmorningdojistar(array $open, array $high, array $low, * @param float $penetration [OPTIONAL] [DEFAULT 0.3] Percentage of penetration of a candle within another candle. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlmorningstar(array $open, array $high, array $low, array $close, float $penetration = null): array { @@ -1260,6 +1293,7 @@ public static function cdlmorningstar(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlonneck(array $open, array $high, array $low, array $close): array { @@ -1278,6 +1312,7 @@ public static function cdlonneck(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlpiercing(array $open, array $high, array $low, array $close): array { @@ -1296,6 +1331,7 @@ public static function cdlpiercing(array $open, array $high, array $low, array $ * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlrickshawman(array $open, array $high, array $low, array $close): array { @@ -1314,6 +1350,7 @@ public static function cdlrickshawman(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlrisefall3methods(array $open, array $high, array $low, array $close): array { @@ -1332,6 +1369,7 @@ public static function cdlrisefall3methods(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlseparatinglines(array $open, array $high, array $low, array $close): array { @@ -1350,6 +1388,7 @@ public static function cdlseparatinglines(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlshootingstar(array $open, array $high, array $low, array $close): array { @@ -1368,6 +1407,7 @@ public static function cdlshootingstar(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlshortline(array $open, array $high, array $low, array $close): array { @@ -1386,6 +1426,7 @@ public static function cdlshortline(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlspinningtop(array $open, array $high, array $low, array $close): array { @@ -1404,6 +1445,7 @@ public static function cdlspinningtop(array $open, array $high, array $low, arra * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlstalledpattern(array $open, array $high, array $low, array $close): array { @@ -1422,6 +1464,7 @@ public static function cdlstalledpattern(array $open, array $high, array $low, a * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlsticksandwich(array $open, array $high, array $low, array $close): array { @@ -1440,6 +1483,7 @@ public static function cdlsticksandwich(array $open, array $high, array $low, ar * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdltakuri(array $open, array $high, array $low, array $close): array { @@ -1458,6 +1502,7 @@ public static function cdltakuri(array $open, array $high, array $low, array $cl * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdltasukigap(array $open, array $high, array $low, array $close): array { @@ -1476,6 +1521,7 @@ public static function cdltasukigap(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlthrusting(array $open, array $high, array $low, array $close): array { @@ -1494,6 +1540,7 @@ public static function cdlthrusting(array $open, array $high, array $low, array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdltristar(array $open, array $high, array $low, array $close): array { @@ -1512,6 +1559,7 @@ public static function cdltristar(array $open, array $high, array $low, array $c * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlunique3river(array $open, array $high, array $low, array $close): array { @@ -1530,6 +1578,7 @@ public static function cdlunique3river(array $open, array $high, array $low, arr * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlupsidegap2crows(array $open, array $high, array $low, array $close): array { @@ -1548,6 +1597,7 @@ public static function cdlupsidegap2crows(array $open, array $high, array $low, * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cdlxsidegap3methods(array $open, array $high, array $low, array $close): array { @@ -1564,6 +1614,7 @@ public static function cdlxsidegap3methods(array $open, array $high, array $low, * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ceil(array $real): array { @@ -1580,6 +1631,7 @@ public static function ceil(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cmo(array $real, int $timePeriod = null): array { @@ -1598,6 +1650,7 @@ public static function cmo(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function correl(array $real0, array $real1, int $timePeriod = null): array { @@ -1615,6 +1668,7 @@ public static function correl(array $real0, array $real1, int $timePeriod = null * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cos(array $real): array { @@ -1631,6 +1685,7 @@ public static function cos(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function cosh(array $real): array { @@ -1647,6 +1702,7 @@ public static function cosh(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 3.] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function dema(array $real, int $timePeriod = null): array { @@ -1665,6 +1721,7 @@ public static function dema(array $real, int $timePeriod = null): array * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function div(array $real0, array $real1): array { @@ -1683,6 +1740,7 @@ public static function div(array $real0, array $real1): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function dx(array $high, array $low, array $close, int $timePeriod = null): array { @@ -1700,6 +1758,7 @@ public static function dx(array $high, array $low, array $close, int $timePeriod * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ema(array $real, int $timePeriod = null): array { @@ -1715,8 +1774,9 @@ public static function ema(array $real, int $timePeriod = null): array * Get error code of the last operation. * * @return int Returns the error code identified by one of the TRADER_ERR_* constants. + * @throws \Exception */ - public static function errno(): integer + public static function errno(): int { $return = trader_errno(); static::checkForError(); @@ -1731,6 +1791,7 @@ public static function errno(): integer * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function exp(array $real): array { @@ -1747,6 +1808,7 @@ public static function exp(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function floor(array $real): array { @@ -1761,8 +1823,9 @@ public static function floor(array $real): array * Get compatibility mode which affects the way calculations are done by all the extension functions. * * @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants. + * @throws \Exception */ - public static function get_compat(): integer + public static function get_compat(): int { $return = trader_get_compat(); static::checkForError(); @@ -1777,8 +1840,9 @@ public static function get_compat(): integer * @param int $functionId Function ID the factor to be read for. TRADER_FUNC_UNST_* series of constants should be used. * * @return int Returns the unstable period factor for the corresponding function. + * @throws \Exception */ - public static function get_unstable_period(integer $functionId): integer + public static function get_unstable_period(int $functionId): int { $return = trader_get_unstable_period($functionId); static::checkForError(); @@ -1792,6 +1856,7 @@ public static function get_unstable_period(integer $functionId): integer * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ht_dcperiod(array $real): array { @@ -1807,6 +1872,7 @@ public static function ht_dcperiod(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ht_dcphase(array $real): array { @@ -1820,13 +1886,13 @@ public static function ht_dcphase(array $real): array * Hilbert Transform - Phasor Components * * @param array $real Array of real values. - * @param array $inPhase Empty array, will be filled with in phase data. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function ht_phasor(array $real, array &$inPhase): array + public static function ht_phasor(array $real): array { - $return = trader_ht_phasor($real, $inPhase); + $return = trader_ht_phasor($real); static::checkForError(); return $return; @@ -1836,13 +1902,13 @@ public static function ht_phasor(array $real, array &$inPhase): array * Hilbert Transform - SineWave * * @param array $real Array of real values. - * @param array $sine Empty array, will be filled with sine data. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function ht_sine(array $real, array &$sine): array + public static function ht_sine(array $real): array { - $return = trader_ht_sine($real, $sine); + $return = trader_ht_sine($real); static::checkForError(); return $return; @@ -1854,6 +1920,7 @@ public static function ht_sine(array $real, array &$sine): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ht_trendline(array $real): array { @@ -1869,6 +1936,7 @@ public static function ht_trendline(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ht_trendmode(array $real): array { @@ -1885,6 +1953,7 @@ public static function ht_trendmode(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function kama(array $real, int $timePeriod = null): array { @@ -1902,6 +1971,7 @@ public static function kama(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearreg_angle(array $real, int $timePeriod = null): array { @@ -1919,6 +1989,7 @@ public static function linearreg_angle(array $real, int $timePeriod = null): arr * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearreg_intercept(array $real, int $timePeriod = null): array { @@ -1936,6 +2007,7 @@ public static function linearreg_intercept(array $real, int $timePeriod = null): * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearreg_slope(array $real, int $timePeriod = null): array { @@ -1953,6 +2025,7 @@ public static function linearreg_slope(array $real, int $timePeriod = null): arr * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function linearreg(array $real, int $timePeriod = null): array { @@ -1970,6 +2043,7 @@ public static function linearreg(array $real, int $timePeriod = null): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ln(array $real): array { @@ -1986,6 +2060,7 @@ public static function ln(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function log10(array $real): array { @@ -2003,6 +2078,7 @@ public static function log10(array $real): array * @param int $mAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ma(array $real, int $timePeriod = null, int $mAType = null): array { @@ -2023,6 +2099,7 @@ public static function ma(array $real, int $timePeriod = null, int $mAType = nul * @param int $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function macd(array $real, int $fastPeriod = null, int $slowPeriod = null, int $signalPeriod = null): array { @@ -2046,6 +2123,7 @@ public static function macd(array $real, int $fastPeriod = null, int $slowPeriod * @param int $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function macdext(array $real, int $fastPeriod = null, int $fastMAType = null, int $slowPeriod = null, int $slowMAType = null, int $signalPeriod = null): array { @@ -2067,6 +2145,7 @@ public static function macdext(array $real, int $fastPeriod = null, int $fastMAT * @param int $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function macdfix(array $real, int $signalPeriod = null): array { @@ -2085,6 +2164,7 @@ public static function macdfix(array $real, int $signalPeriod = null): array * @param float $slowLimit [OPTIONAL] [DEFAULT 0.05] Lower limit use in the adaptive algorithm. Valid range from 0.01 to 0.99. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mama(array $real, float $fastLimit = null, float $slowLimit = null): array { @@ -2106,6 +2186,7 @@ public static function mama(array $real, float $fastLimit = null, float $slowLim * @param int $mAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mavp(array $real, array $periods, int $minPeriod = null, int $maxPeriod = null, int $mAType = null): array { @@ -2125,6 +2206,7 @@ public static function mavp(array $real, array $periods, int $minPeriod = null, * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function max(array $real, int $timePeriod = null): array { @@ -2142,6 +2224,7 @@ public static function max(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function maxindex(array $real, int $timePeriod = null): array { @@ -2159,6 +2242,7 @@ public static function maxindex(array $real, int $timePeriod = null): array * @param array $low Low price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function medprice(array $high, array $low): array { @@ -2178,6 +2262,7 @@ public static function medprice(array $high, array $low): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mfi(array $high, array $low, array $close, array $volume, int $timePeriod = null): array { @@ -2195,6 +2280,7 @@ public static function mfi(array $high, array $low, array $close, array $volume, * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function midpoint(array $real, int $timePeriod = null): array { @@ -2213,8 +2299,9 @@ public static function midpoint(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ - public static function midprice(array $high, array $low, int $timePeriod = null) + public static function midprice(array $high, array $low, int $timePeriod = null): array { $timePeriod = $timePeriod ?? 14; $return = trader_midprice($high, $low, $timePeriod); @@ -2230,6 +2317,7 @@ public static function midprice(array $high, array $low, int $timePeriod = null) * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function min(array $real, int $timePeriod = null): array { @@ -2247,6 +2335,7 @@ public static function min(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minindex(array $real, int $timePeriod = null): array { @@ -2264,6 +2353,7 @@ public static function minindex(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minmax(array $real, int $timePeriod = null): array { @@ -2281,6 +2371,7 @@ public static function minmax(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minmaxindex(array $real, int $timePeriod = null): array { @@ -2300,6 +2391,7 @@ public static function minmaxindex(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minus_di(array $high, array $low, array $close, int $timePeriod = null): array { @@ -2318,6 +2410,7 @@ public static function minus_di(array $high, array $low, array $close, int $time * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function minus_dm(array $high, array $low, int $timePeriod = null): array { @@ -2335,6 +2428,7 @@ public static function minus_dm(array $high, array $low, int $timePeriod = null) * @param int $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mom(array $real, int $timePeriod = null): array { @@ -2353,6 +2447,7 @@ public static function mom(array $real, int $timePeriod = null): array * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function mult(array $real0, array $real1): array { @@ -2371,6 +2466,7 @@ public static function mult(array $real0, array $real1): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function natr(array $high, array $low, array $close, int $timePeriod = null): array { @@ -2388,6 +2484,7 @@ public static function natr(array $high, array $low, array $close, int $timePeri * @param array $volume Volume traded, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function obv(array $real, array $volume): array { @@ -2406,6 +2503,7 @@ public static function obv(array $real, array $volume): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function plus_di(array $high, array $low, array $close, int $timePeriod = null): array { @@ -2424,6 +2522,7 @@ public static function plus_di(array $high, array $low, array $close, int $timeP * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function plus_dm(array $high, array $low, int $timePeriod = null): array { @@ -2443,6 +2542,7 @@ public static function plus_dm(array $high, array $low, int $timePeriod = null): * @param int $mAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ppo(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null): array { @@ -2462,6 +2562,7 @@ public static function ppo(array $real, int $fastPeriod = null, int $slowPeriod * @param int $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function roc(array $real, int $timePeriod = null): array { @@ -2479,6 +2580,7 @@ public static function roc(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rocp(array $real, int $timePeriod = null): array { @@ -2496,6 +2598,7 @@ public static function rocp(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rocr100(array $real, int $timePeriod = null): array { @@ -2513,6 +2616,7 @@ public static function rocr100(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rocr(array $real, int $timePeriod = null): array { @@ -2530,6 +2634,7 @@ public static function rocr(array $real, int $timePeriod = null): array * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function rsi(array $real, int $timePeriod = null): array { @@ -2549,6 +2654,7 @@ public static function rsi(array $real, int $timePeriod = null): array * @param float $maximum [OPTIONAL] [DEFAULT 0.2] Acceleration Factor Maximum value. Valid range from 0 to TRADER_REAL_MAX. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sar(array $high, array $low, float $acceleration = null, float $maximum = null): array { @@ -2575,6 +2681,7 @@ public static function sar(array $high, array $low, float $acceleration = null, * @param float $accelerationMaxShort [OPTIONAL] [DEFAULT 0.2] Acceleration Factor maximum value for the Short direction. Valid range from 0 to TRADER_REAL_MAX. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sarext(array $high, array $low, float $startValue = null, float $offsetOnReverse = null, float $accelerationInitLong = null, float $accelerationLong = null, float $accelerationMaxLong = null, float $accelerationInitShort = null, float $accelerationShort = null, float $accelerationMaxShort = null): array { @@ -2597,13 +2704,13 @@ public static function sarext(array $high, array $low, float $startValue = null, * Set compatibility mode which will affect the way calculations are done by all the extension functions. * * @param int $compatId Compatibility Id. TRADER_COMPATIBILITY_* series of constants should be used. + * + * @throws \Exception */ - public static function set_compat(integer $compatId) + public static function set_compat(int $compatId) { - $return = trader_set_compat($compatId); + trader_set_compat($compatId); static::checkForError(); - - return $return; } /** @@ -2612,13 +2719,13 @@ public static function set_compat(integer $compatId) * * @param int $functionId Function ID the factor should be set for. TRADER_FUNC_UNST_* constant series can be used to affect the corresponding function. * @param int $timePeriod Unstable period value. + * + * @throws \Exception */ - public static function set_unstable_period(integer $functionId, int $timePeriod) + public static function set_unstable_period(int $functionId, int $timePeriod) { - $return = trader_set_unstable_period($functionId, $timePeriod); + trader_set_unstable_period($functionId, $timePeriod); static::checkForError(); - - return $return; } /** @@ -2628,6 +2735,7 @@ public static function set_unstable_period(integer $functionId, int $timePeriod) * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sin(array $real): array { @@ -2644,6 +2752,7 @@ public static function sin(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sinh(array $real): array { @@ -2660,6 +2769,7 @@ public static function sinh(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sma(array $real, int $timePeriod = null): array { @@ -2677,6 +2787,7 @@ public static function sma(array $real, int $timePeriod = null): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sqrt(array $real): array { @@ -2694,6 +2805,7 @@ public static function sqrt(array $real): array * @param float $nbDev [OPTIONAL] [DEFAULT 1.0] Number of deviations * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stddev(array $real, int $timePeriod = null, float $nbDev = null): array { @@ -2718,6 +2830,7 @@ public static function stddev(array $real, int $timePeriod = null, float $nbDev * @param int $slowD_MAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average for Slow-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stoch(array $high, array $low, array $close, int $fastK_Period = null, int $slowK_Period = null, int $slowK_MAType = null, int $slowD_Period = null, int $slowD_MAType = null): array { @@ -2743,6 +2856,7 @@ public static function stoch(array $high, array $low, array $close, int $fastK_P * @param int $fastD_MAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average for Fast-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stochf(array $high, array $low, array $close, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null): array { @@ -2765,6 +2879,7 @@ public static function stochf(array $high, array $low, array $close, int $fastK_ * @param int $fastD_MAType [OPTIONAL] [DEFAULT TRADER_MA_TYPE_SMA] Type of Moving Average for Fast-D. TRADER_MA_TYPE_* series of constants should be used. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function stochrsi(array $real, int $timePeriod = null, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null): array { @@ -2786,6 +2901,7 @@ public static function stochrsi(array $real, int $timePeriod = null, int $fastK_ * @param array $real1 Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sub(array $real0, array $real1): array { @@ -2802,6 +2918,7 @@ public static function sub(array $real0, array $real1): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function sum(array $real, int $timePeriod = null): array { @@ -2820,6 +2937,7 @@ public static function sum(array $real, int $timePeriod = null): array * @param float $vFactor [OPTIONAL] [DEFAULT 0.7] Volume Factor. Valid range from 1 to 0. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function t3(array $real, int $timePeriod = null, float $vFactor = null): array { @@ -2838,6 +2956,7 @@ public static function t3(array $real, int $timePeriod = null, float $vFactor = * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tan(array $real): array { @@ -2854,6 +2973,7 @@ public static function tan(array $real): array * @param array $real Array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tanh(array $real): array { @@ -2870,6 +2990,7 @@ public static function tanh(array $real): array * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tema(array $real, int $timePeriod = null): array { @@ -2888,6 +3009,7 @@ public static function tema(array $real, int $timePeriod = null): array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function trange(array $high, array $low, array $close): array { @@ -2900,10 +3022,11 @@ public static function trange(array $high, array $low, array $close): array /** * Triangular Moving Average * - * @param array $real Array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. + * @param array $real Array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function trima(array $real, int $timePeriod = null): array { @@ -2917,10 +3040,11 @@ public static function trima(array $real, int $timePeriod = null): array /** * 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA * - * @param array $real Array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. + * @param array $real Array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function trix(array $real, int $timePeriod = null): array { @@ -2934,10 +3058,11 @@ public static function trix(array $real, int $timePeriod = null): array /** * Time Series Forecast * - * @param array $real Array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. + * @param array $real Array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function tsf(array $real, int $timePeriod = null): array { @@ -2956,6 +3081,7 @@ public static function tsf(array $real, int $timePeriod = null): array * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function typprice(array $high, array $low, array $close): array { @@ -2968,14 +3094,15 @@ public static function typprice(array $high, array $low, array $close): array /** * Ultimate Oscillator * - * @param array $high High price, array of real values. - * @param array $low Low price, array of real values. - * @param array $close Closing price, array of real values. - * @param int $timePeriod1 [OPTIONAL] [DEFAULT 7] Number of bars for 1st period. Valid range from 1 to 100000. - * @param int $timePeriod2 [OPTIONAL] [DEFAULT 14] Number of bars for 2nd period. Valid range from 1 to 100000. - * @param int $timePeriod3 [OPTIONAL] [DEFAULT 28] Number of bars for 3rd period. Valid range from 1 to 100000. + * @param array $high High price, array of real values. + * @param array $low Low price, array of real values. + * @param array $close Closing price, array of real values. + * @param int $timePeriod1 [OPTIONAL] [DEFAULT 7] Number of bars for 1st period. Valid range from 1 to 100000. + * @param int $timePeriod2 [OPTIONAL] [DEFAULT 14] Number of bars for 2nd period. Valid range from 1 to 100000. + * @param int $timePeriod3 [OPTIONAL] [DEFAULT 28] Number of bars for 3rd period. Valid range from 1 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function ultosc(array $high, array $low, array $close, int $timePeriod1 = null, int $timePeriod2 = null, int $timePeriod3 = null): array { @@ -2991,11 +3118,12 @@ public static function ultosc(array $high, array $low, array $close, int $timePe /** * Variance * - * @param array $real Array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000. - * @param float $nbDev [OPTIONAL] [DEFAULT 1.0] Number of deviations + * @param array $real Array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000. + * @param float $nbDev [OPTIONAL] [DEFAULT 1.0] Number of deviations * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function var(array $real, int $timePeriod = null, float $nbDev = null): array { @@ -3015,6 +3143,7 @@ public static function var(array $real, int $timePeriod = null, float $nbDev = n * @param array $close Closing price, array of real values. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function wclprice(array $high, array $low, array $close): array { @@ -3027,12 +3156,13 @@ public static function wclprice(array $high, array $low, array $close): array /** * Williams' %R * - * @param array $high High price, array of real values. - * @param array $low Low price, array of real values. - * @param array $close Closing price, array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. + * @param array $high High price, array of real values. + * @param array $low Low price, array of real values. + * @param array $close Closing price, array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function willr(array $high, array $low, array $close, int $timePeriod = null): array { @@ -3046,10 +3176,11 @@ public static function willr(array $high, array $low, array $close, int $timePer /** * Weighted Moving Average * - * @param array $real Array of real values. - * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. + * @param array $real Array of real values. + * @param int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000. * * @return array Returns an array with calculated data or false on failure. + * @throws \Exception */ public static function wma(array $real, int $timePeriod = null): array { @@ -3060,4 +3191,4 @@ public static function wma(array $real, int $timePeriod = null): array return $return; } -} \ No newline at end of file +}