我已经尝试了很长一段时间来安装 ta-lib,这样我就可以根据这个github 示例使用一些指标函数进行交易。到目前为止,我已经确定我需要:
跑
gem install talib_ruby
C:\Users\king\Desktop\_REPOS\misc\stock_analysis\forex\oanda\ruby>gem install talib_ruby Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing talib_ruby: ERROR: Failed to build gem native extension. C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20160810-7176-j5lye2.rb extconf.rb checking for TA_Initialize() in -lta_lib... no creating Makefile make "DESTDIR=" clean make "DESTDIR=" generating talib-x64-mingw32.def compiling talib.c talib.c:2:32: fatal error: ta-lib/ta_abstract.h: No such file or directory compilation terminated. make: *** [talib.o] Error 1 make failed, exit code 2 ....
从这里下载 msvc 中的 ta-lib 头文件
安装时告诉 talib_ruby gem ta-lib 文件的位置。基于此 SO 帖子,正确的命令应类似于:
sudo env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib --with-talib-lib=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib
. 该命令指定了我下载的 ta-lib 中缺少的 lib 文件夹的路径。有谁知道如何解决这一问题?