Giter VIP home page Giter VIP logo

ta-lib's Introduction

TA-Lib - Technical Analysis Library

This is now the official home for C/C++ TA-Lib (instead of SourceForge).

More info https://ta-lib.org

ta-lib's People

Contributors

cpp4ever avatar frederisk avatar mario4tier avatar mckelvin avatar trufanov-nok avatar vbmithr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ta-lib's Issues

Trust issues !!!

With recent incident with XZ utils in Linux, how do we trust the contributing authors? Not questioning the authenticity of the original author. But not sure about the other contributors.

Investigate Sourceforge Tickets

Error in installing TA-Lib by "Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects" error

By installing TA_lib by pip instruction as following command:
pip install TA-Lib
the following result and error are produced, how to fix the problem?

Collecting TA-Lib
  Using cached TA-Lib-0.4.26.tar.gz (272 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\users\mahdizadeh\appdata\local\programs\python\python311\lib\site-packages (from TA-Lib) (1.24.1)
Building wheels for collected packages: TA-Lib
  Building wheel for TA-Lib (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for TA-Lib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      <string>:77: UserWarning: Cannot find ta-lib library, installation may fail.
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\talib
      copying talib\abstract.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\deprecated.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\stream.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_abstract.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_data.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_func.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_pandas.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_polars.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_stream.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\__init__.py -> build\lib.win-amd64-cpython-311\talib
      running build_ext
      building 'talib._ta_lib' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\talib
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ic:\ta-lib\c\include -IC:\Users\Mahdizadeh\AppData\Local\Temp\pip-build-env-tlw2ytdz\normal\Lib\site-packages\numpy\core\include -IC:\Users\Mahdizadeh\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mahdizadeh\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tctalib/_ta_lib.c /Fobuild\temp.win-amd64-cpython-311\Release\talib/_ta_lib.obj
      _ta_lib.c
      talib/_ta_lib.c(745): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for TA-Lib
Failed to build TA-Lib
ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects
PS C:\Users\Mahdizadeh> pip install wheel
Requirement already satisfied: wheel in c:\users\mahdizadeh\appdata\local\programs\python\python311\lib\site-packages (0.40.0)
PS C:\Users\Mahdizadeh> pip install TA-Lib==0.4.4   
ERROR: Could not find a version that satisfies the requirement TA-Lib==0.4.4 (from versions: 0.4.9, 0.4.14, 0.4.15, 0.4.16, 0.4.17, 0.4.18, 0.4.19, 0.4.20, 0.4.21, 0.4.22, 0.4.23, 0.4.24, 0.4.25, 0.4.26)
ERROR: No matching distribution found for TA-Lib==0.4.4
PS C:\Users\Mahdizadeh> pip install TA-Lib==0.4.14
Collecting TA-Lib==0.4.14
  Downloading TA-Lib-0.4.14.tar.gz (715 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 715.5/715.5 kB 922.0 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\mahdizadeh\appdata\local\programs\python\python311\lib\site-packages (from TA-Lib==0.4.14) (1.24.1)
Building wheels for collected packages: TA-Lib
  Building wheel for TA-Lib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      C:\Users\Mahdizadeh\AppData\Local\Temp\pip-install-6xg4mhz3\ta-lib_2586b55e37fc4899ba48dc8348592a75\setup.py:82: UserWarning: Cannot find ta-lib library, installation may fail.
        warnings.warn('Cannot find ta-lib library, installation may fail.')
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\talib
      copying talib\abstract.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\deprecated.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\stream.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_abstract.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_data.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_func.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\test_stream.py -> build\lib.win-amd64-cpython-311\talib
      copying talib\__init__.py -> build\lib.win-amd64-cpython-311\talib
      running build_ext
      skipping 'talib\_ta_lib.c' Cython extension (up-to-date)
      building 'talib._ta_lib' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\talib
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Mahdizadeh\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\include -Ic:\ta-lib\c\include -IC:\Users\Mahdizadeh\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mahdizadeh\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tctalib\_ta_lib.c /Fobuild\temp.win-amd64-cpython-311\Release\talib\_ta_lib.obj
      _ta_lib.c
      talib\_ta_lib.c(181): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for TA-Lib
  Running setup.py clean for TA-Lib
Failed to build TA-Lib
ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects

Outdate CMakeLists

Could anyone update the CMakeLists? This file is outdate,and can't build anymore. Such as it doesn't have cmake_minimum_required() and project()

Broken for directory paths with spaces

Build errors like this:

libtool: link: (cd .libs/libta_lib.lax/libta_abstract.a && ar x "/Users/trentbrooks/Downloads/ta-lib 3/src/ta_abstract/.libs/libta_abstract.a")
../libtool: line 1717: cd: .libs/libta_lib.lax/libta_abstract.a: No such file or directory
make[2]: *** [libta_lib.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

If make run in a path that includes spaces.

TA-Lib/ta-lib-python#190

Maybe it's worth starting to fix more of these build problems and forking from SF... dunno.

About rust lib

About rust lib:
I had seen Contact mario4tier on github if interested.
i wonder the progression about it.

tks a lot

SAREXT is broken?

at line 372 of ta_SAREXT.c:

/* This function is the same as TA_SAR, except that the caller has

  • greater control on the SAR dynamic and initial state.
  • In additon, the TA_SAREXT returns negative values when the position
  • is short. This allow to distinguish when the SAR do actually reverse.
    */

So, the first part implies that I can use SAREXT and with some parameters I would get the same results as TA_SAR

But, in the second part it say that no, it will not be the case

Shouldn't the function be fixed?

test_imi failed

ta_regtest V0.6.0-dev (Dec 26 2023 08:25:05) - Regression Tests of TA-Lib code

Testing utility functions
Testing Abstract interface
Testing the TA functions
MATH,VECTOR,DCPERIOD/PHASE,TRENDLINE/MODE: Testing...done.
All Moving Averages: Testing...done.
AROON,CORREL,BETA: Testing...done.
CCI,WILLR,ULTOSC,NATR: Testing...done.
BOP,AVGPRICE: Testing...done.
RSI,CMO: Testing...done.
IMI: Testing...
Fail: Value out of tolerance range (0.429738,0.00458716)
Fail: doRangeTestFixSize diff data for idx=0 (4.418833e+01,7.748777e+01)
Fail: doRangeTestFixSize (232,232,232,1,1)
Fail: doRangeTestFixSize refOutBeg,refOutNbElement (4,248)
Fail: Diff 75.358 %
Fail: Using unstable period 208
Failed: For output #1 of 1
D:\WorkCopy\ta-lib\src\tools\ta_regtest\ta_test_func\test_imi.c Failed Test #0 (Code=161)

doc error: MFI function should not has an *unstable* period

TA-Lib/ta-lib-python#435

https://github.com/mrjbq7/ta-lib/blob/master/docs/func_groups/momentum_indicators.md

MFI - Money Flow Index

NOTE: The MFI function has an unstable period.

real = MFI(high, low, close, volume, timeperiod=14)

however, if we check the DESCRIPTION of TA_SetUnstablePeriod(https://ta-lib.org/d_api/ta_setunstableperiod.html).

and then how the MFI is calculated:

https://www.investopedia.com/terms/m/mfi.asp

How to Calculate the Money Flow Index

There are several steps for calculating the Money Flow Index. If doing it by hand, using a spreadsheet is recommended.

Calculate the Typical Price for each of the last 14 periods.
For each period, mark whether the typical price was higher or lower than the prior period. This will tell you whether Raw Money Flow is positive or negative.
Calculate Raw Money Flow by multiplying the Typical Price by Volume for that period. Use negative or positive numbers depending on whether the period was up or down (see step above).
Calculate the Money Flow Ratio by adding up all the positive money flows over the last 14 periods and dividing it by the negative money flows for the last 14 periods.
Calculate the Money Flow Index (MFI) using the ratio found in step four.
Continue doing the calculations as each new period ends, using only the last 14 periods of data.

It's more like SMA, having look back period of 1 (compare 1st typical price is up/down with the prev typical price), rather than EMA (which will "remember" all the price effect on the current ema value all the way back to the very start).

I think this is a doc error: The MFI function has no unstable period.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.