Monday, May 28. 2012Trader PHP extension, use itTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
I am soooo excited about this.
I am having a little trouble compiling it on my system. I sent you an email but I just found this as well. Thank you for making this! You can see my problem at: http://stackoverflow.com/questions/11634739/pecl-install-trader-failes-with-missing-file-osx-lion thanks!
Hi,
it's most likely a paths issue. If you consider the following line /bin/sh /private/tmp/pear/temp/pear-build-rootpwFTIe/trader-0.2.1/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/trader -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootpwFTIe/trader-0.2.1/include -I/private/tmp/pear/temp/pear-build-rootpwFTIe/trader-0.2.1/main -I/private/tmp/pear/temp/trader -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/temp/trader/ta-lib/include -I/private/tmp/pear/temp/trader/ta-lib/src/ta_common -I/private/tmp/pear/temp/trader/functions -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/trader/ta-lib/src/ta_common/ta_global.c -o ta-lib/src/ta_common/ta_global.lou everywhere is an absolute path and at the end is a relative one. Looks like it tries to compile under two different paths. I have unfortunately no mac mashines to test it. Will try to get some, but that could take some time. You could unpack the tarball and play with config.m4 - that's where it should be fixed ![]()
Could you please try the latest config.m4 from trunk http://svn.php.net/viewvc/pecl/trader/trunk/config.m4?revision=326807&view=markup ?
I had a quick question about returned data.
I fed the trader_ema with 86 entries and a period of 20, Do you know why it would only return 48 entries? thanks!
Hi Michael,
I've fixed this in trunk. It was a trivial bug in my implementation. Could you please try it? Cheers )
Thank you!!! Thank you especially for getting to this so quickly! I am in the middle of heavy development and I am using these functions a lot!
Hey Anatoliy,
Do you know if there are more functions that TA-lib offers that have not been implemented yet? Such as Negative Volume Index? I believe that they are part of the ta-lib, but I am not sure. If there are more in the ta-lib, do you know when or if you are going to implement them? I would love to help in any way I can, but my knowledge is limited when it comes to programming in C. thanks!
Michael,
all the TA-Lib functions should be implemented now. You can browse here http://www.ta-lib.org/function.html for the list, but also under http://lxr.php.net/xref/PECL/trader/ta-lib/src/ta_func/ where all the currently implemented functions are listed. I might be missing something of course, but actually shouldn't ![]() You're helping already very much just using the trader ext and giving the feedback which helps to fix bugs. If you had mood, you could also write tests and help to make the php docs more reasonable. Conserning the new implementations - as the ext is based on the TA-Lib, the additions should be implemented in it first, go back to the TA-Lib community. This were a meaningful way to add more indexes to the PHP ext then. Unfortunately I've not that much time to extend TA-Lib at the moment, but when it becomes a new release, of course I'll take it over into the trader ext. Cheers )
Do all of the functions have the ability to pass a moving average type or only a select few? Are the parameters you have specified in the docs with each function the only parameters available for that function?
For example: The Relative Strength Index function (trader_rsi) is sometimes calculated with an exponential moving average instead of Wilder's accumulative moving average. I would like to be able to pass in an moving average type just like I can with trader_ma. Also, do you know what integers correspond with which MA type? I tried to ask in the ta-lib forum but I did not get a response. thanks!
TA-Lib forum seems to be dead, recently i've tried to register there but my request still wasn't approved. Will try on sourceforge next time )
A quick grep gave me the list of the functions supporting MA trader_apo trader_bbands trader_ma trader_macdext trader_mavp trader_ppo trader_stoch trader_stochf trader_stochrsi I'm not sure, but trader_stochrsi is the one you might be looking for. And yes, each function in the trader ext implements all the available args it ta-lib. Except - as I've wrote in this article, array index args are not present in php signatures. All the effective args should be there. For types the TRADER_MA_TYPE_* constants are usable. Just look here http://de.php.net/manual/en/trader.constants.php . That's what i've also meant on improving the documentation ![]()
Great to know, thank you again.
Those constants will be extremely useful.
Hi, I am having trouble installing this. The PHP Trader PECL seems to be broken, using PHP5.3.
sudo pecl install trader-beta gives /tmp/pear/temp/trader/trader.c:1225:2: error: 'PHP_FE_END' undeclared here (not in a function) make: *** [trader.lo] Error 1 It's the same issue that's been reported here: https://bugs.php.net/bug.php?id=63511 Any help would be really appreciated as I'm stuck. Thanks!
Having problems on my Raspberry Pi (ARMv6) with PHP5.4.4 + PEAR 1.9.4 and trader0.3.0 during the ./configure phase:
checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/home/gene/setups/trader-0.3.0': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details
Hi,
can it compile other extensions? Looks more like it fails to determine the platform or like that. I've no raspberry pi unfortunately. Are there some comparable emulators yet? Thanks
Thank you for your hard work on this code.
Unfortunately I'm also getting a problem with this module: [notice] child pid 45585 exit signal Segmentation fault (11) Other modules work ok. I have tried with PHP 5.3, 5.4.24 & 5.4.26
Hi Anatol,
I got it working on 5.4.26 in the end. I removed everything and started again and it worked. Thanks again for your hard work.
I couldnt find examples on how to use this extension - with examples
I installed trader - by the method given here.. https://thoughtsimproved.wordpress.com/2012/11/15/quick-tech-recipe-installing-the-technical-analysis-php-pecl-extension/ But to proceed further... what I am looking at is - get for a data series (ohlcv) data - corresponding all technical values.. (o, h, l, c, v, SMA 5, EMA 5, BBand-Upper, BBand-Lower, BBand-Mid, MACD, ADX, DMI+, DMI-, RSI, STOCH %K, STOCH %D, CCI, PSAR, ATR, Will %R, TRIX, StochRSI %K, StochRSI %D,.....) Can some one guide how to do it.. Thanks |
QuicksearchCategoriesArchives |