Skip to content

Conversation

@jb-lopez
Copy link

I noticed that there are three new functions that hadn't been ported in yet, ACCBANDS, AVGDEV, and IMI. so I updated the dependency to 0.5.2 and ran gen_code then verified that it built and passed its tests.

I haven't yet verified that those functions produce any meaningful output, but it is on my todo list

This commit copies in the 0.5.2 version of ta-lib over the existing 0.4.0 version. Nothing else was done in this commit.
Also ran
```shell
phpize8.3
./configure
make
make test
```
The output of the tests are
```
=====================================================================
PHP         : /usr/bin/php8.3
PHP_SAPI    : cli
PHP_VERSION : 8.3.0RC5
ZEND_VERSION: 4.3.0RC5
PHP_OS      : Linux - Linux MEG 6.1.0-13-amd64 php#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64
INI actual  : /raid/Projects/GitHub/php/pecl-math-trader/tmp-php.ini
More .INIs  :
CWD         : /raid/Projects/GitHub/php/pecl-math-trader
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2023-11-25 07:37:06
=====================================================================
PASS trader_acos() basic test [tests/trader_acos_01.phpt]
PASS trader_ad() basic test [tests/trader_ad_01.phpt]
PASS trader_ad() fail test [tests/trader_ad_02.phpt]
PASS trader_add() basic test [tests/trader_add_01.phpt]
PASS trader_adosc() basic test [tests/trader_adosc_01.phpt]
PASS trader_cci() basic test [tests/trader_adosc_bug62728.phpt]
PASS trader_adx() basic test [tests/trader_adx_01.phpt]
PASS trader_adxr() basic test [tests/trader_adxr_01.phpt]
PASS trader_apo() basic test [tests/trader_apo_01.phpt]
PASS trader_aroon() basic test [tests/trader_aroon_01.phpt]
PASS trader_aroonosc() basic test [tests/trader_aroonosc_01.phpt]
PASS trader_asin() basic test [tests/trader_asin_01.phpt]
PASS trader_atan() basic test [tests/trader_atan_01.phpt]
PASS trader_atr() basic test [tests/trader_atr_01.phpt]
PASS trader_avgprice() basic test [tests/trader_avgprice_01.phpt]
SKIP trader_bbands() basic test [tests/trader_bbands_01.phpt] reason: PHP 7 only
PASS trader_bbands() basic test [tests/trader_bbands_02.phpt]
PASS trader_beta() basic test [tests/trader_beta_01.phpt]
PASS trader_bop() basic test [tests/trader_bop_01.phpt]
PASS trader_cci() basic test [tests/trader_cci_01.phpt]
PASS trader_ht_phasor() basic test [tests/trader_ht_phasor_01.phpt]
PASS trader_ht_sine() basic test [tests/trader_ht_sine_01.phpt]
PASS trader.real_round_mode basic test [tests/trader_ini_01.phpt]
PASS trader.real_round_mode ini setting [tests/trader_ini_02.phpt]
PASS trader_macd() basic test [tests/trader_macd.phpt]
PASS trader_obv() Bug #62712 trader_obv does not return results [tests/trader_obv_bug62712.phpt]
PASS trader_sma() Bug #62720 large numbers breaks trader_sma [tests/trader_sma_bug62720.phpt]
PASS trader_t3() basic test [tests/trader_t3_01.phpt]
PASS trader_t3() to high time period [tests/trader_t3_bug62698.phpt]
=====================================================================
TIME END 2023-11-25 07:37:06

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :     0
Exts tested     :    16
---------------------------------------------------------------------

Number of tests :    29                28
Tests skipped   :     1 (  3.4%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :     0 (  0.0%) (  0.0%)
Tests passed    :    28 ( 96.6%) (100.0%)
---------------------------------------------------------------------
Time taken      :     0 seconds
=====================================================================
```
I had missed adding the references in a few places.
Now everything compiles and it works in PHP.
@jb-lopez
Copy link
Author

I've done testing with the build I've produced with these changes, and validated its output against the native PHP version added in LupeCode/phpTraderNative#20

@jb-lopez jb-lopez marked this pull request as ready for review November 28, 2023 01:13
@jb-lopez jb-lopez mentioned this pull request Feb 7, 2025
The only changes here are inside comments. One is to whitespace, and the other is to spelling. There is no meaningful change from the previous version of the PR. This PR is compatible with TA-Lib 0.6.4.

I've verified this by going through the changes in the TA-Lib (in the previous commit) as well as compiling this and running the same tests as I previously ran. Those tests being validating that a pure PHP version of the new TA-Lib functions generate the same results when included in PECL Trader.
@jb-lopez
Copy link
Author

jb-lopez commented Feb 7, 2025

Updated the base TA-Lib to v0.6.4 and tested against my pure PHP Trader implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant