Code Monkey home page Code Monkey logo

pandas_talib's Introduction

Latest Version Supported Python versions Wheel format License Development Status Downloads monthly Requirements Status Code Health Codacy Badge Build Status

** Work in progress **

pandas_talib

A Python Pandas implementation of technical indicators

Original version from:

Contributors

See also:

If you are looking for a more complete set of technical indicators you might have a look at this TA-Lib Python wrapper: https://github.com/mrjbq7/ta-lib

Development

You can help to develop this library.

Issues

You can submit issues using https://github.com/femtotrader/pandas_talib/issues

Clone

You can clone repository to try to fix issues yourself using:

$ git clone https://github.com/femtotrader/pandas_talib.git

Run unit tests

Follow instructions from TA-Lib and install it:

https://github.com/mrjbq7/ta-lib

Run all unit tests

$ nosetests -s -v

Run a given test

$ nosetests tests.test_pandas_talib:test_indicator_MA -s -v

Run samples

Run samples/main.py (from project root directory)

$ python samples/main.py

Install development version

$ python setup.py install

or

$ sudo pip install git+https://github.com/femtotrader/pandas_talib.git

Known Issues

  • The method ROC is currently not accurate yet.

Collaborating

  • Fork repository
  • Create a branch which fix a given issue
  • Submit pull requests

https://help.github.com/categories/collaborating/

pandas_talib's People

Contributors

femtotrader avatar llazzaro avatar yaohongkok 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  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

pandas_talib's Issues

while loops

There is some while loops.
Move to for loops (with enumerate) or ideally (if possible) remove loops using Numpy / Pandas

ROC (Pandas implementation) doesn't return same value than TA-Lib Python wrapper

$ nosetests -s -v tests.test_pandas_talib:test_indicator_ROC

raises

Arrays are not almost equal to 7 decimals

x and y nan location mismatch:
 x: array([            nan,             nan,  -1.6632517e-02,  -1.7376779e-03,
        -8.6422326e-04,  -6.5179861e-03,  -1.9357306e-02,  -1.4724111e-03,
         2.5237212e-02,   4.0374865e-02,   1.4385414e-02,  -2.9944823e-02,...
 y: array([            nan,             nan,             nan,  -2.3665359e+00,
         4.5841804e-01,  -1.3623165e+00,  -1.3147031e+00,  -1.4223587e+00,
         1.8396280e+00,   4.5821285e+00,   3.4569644e+00,  -1.0468660e+00,...

could not run "pip install pandas_talib"

When I tried to install pandas_tali using the command "pip install pandas_talib" I get the following error:

" Could not find a version that satisfies the requirement pandas_talib (from versions: )
No matching distribution found for pandas_talib"

Could anyone help?

Different results from panda_talib.MACD and talib.MACD

Hi everyone,,

I am confused by the results. It seems there are multiple versions of MACD calculation to me. If not, why are they different? Please helps

print(p_df.head())
                 c
timestamp         
2017-04-19  2852.0
2017-04-20  2889.0
2017-04-21  2928.0
2017-04-24  2928.0
2017-04-25  2949.0
p_arr = np.array(p)
from pandas_talib import pandas_talib as pdta
macd1 = pdta.MACD(p_df, 12, 26, price='c')
print(macd1.tail(10))
                 c  MACD_12_26  MACDsign_12_26  MACDdiff_12_26
timestamp                                                     
2017-10-17  3738.0  -27.479893      -44.220449       16.740556
2017-10-18  3688.0  -27.154199      -40.807199       13.653000
2017-10-19  3604.0  -33.289945      -39.303748        6.013803
2017-10-20  3776.0  -23.997889      -36.242576       12.244687
2017-10-23  3699.0  -22.586382      -33.511337       10.924955
2017-10-24  3740.0  -17.952636      -30.399597       12.446961
2017-10-25  3705.0  -16.909496      -27.701577       10.792081
2017-10-26  3649.0  -20.366536      -26.234569        5.868032
2017-10-27  3577.0  -28.586273      -26.704910       -1.881363
2017-10-30  3571.0  -35.179075      -28.399743       -6.779332
import talib
macd2 = np.vstack(talib.MACD(p_arr, 12, 26, 9))
macd2 = pd.DataFrame(macd2.T, index=p_df.index, columns=['macd','macdsignal','macdhist'])
macd2 = p_df.join(macd2)
print(macd2.tail(10))
                 c       macd  macdsignal   macdhist
timestamp                                           
2017-10-17  3738.0 -27.384079  -44.076077  16.691997
2017-10-18  3688.0 -27.065785  -40.674018  13.608233
2017-10-19  3604.0 -33.208822  -39.180979   5.972157
2017-10-20  3776.0 -23.922497  -36.129283  12.206786
2017-10-23  3699.0 -22.516715  -33.406769  10.890054
2017-10-24  3740.0 -17.888063  -30.303028  12.414965
2017-10-25  3705.0 -16.849797  -27.612382  10.762585
2017-10-26  3649.0 -20.311556  -26.152217   5.840661
2017-10-27  3577.0 -28.535880  -26.628949  -1.906930
2017-10-30  3571.0 -35.132875  -28.329735  -6.803141

tim 20171222140328
โ€ฆ]()

Simplify setup.py

I was excited to see pandas_talib, as it's obviously needed, until I went to install it.

I will not, under any condition, install 107 packages (weighing 132 Mbytes compressed) and a language I don't have or like, to convert a 2940 byte README file into rst: 45bytes compressed installation for each byte converted! No matter what the problem is, pandoc is not the solution.

Please either convert the readme file to RST by hand, or if you really want to make the setup.py file overly-engineered, with additional setup dependencies that are unnecessary, try creole with:
https://github.com/jedie/python-creole/wiki/Use-In-Setup
It's purely Pythonic, has no Haskell, and is 106 packages weighing 132 Mbytes lighter!!!

:-)

When trying to import Talib i get the following error: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

When i try to import I get the following error:


ValueError Traceback (most recent call last)
in
----> 1 import talib as ta

~\anaconda3\lib\site-packages\talib_init_.py in
50 return wrapper
51
---> 52 from ._ta_lib import (
53 _ta_initialize, _ta_shutdown, MA_Type, ta_version,
54 _ta_set_unstable_period as set_unstable_period,

talib_ta_lib.pyx in init talib._ta_lib()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

I am running Python 3.8.5 and Numpy version 1.19.5

pip install pandas_talib not working

Here is the log:

$pip install pandas_talib 
Collecting pandas-talib
  Could not find a version that satisfies the requirement pandas-talib (from versions: )
No matching distribution found for pandas-talib

How to use pandas_talib?

I am new to your library and how should I use it. I didn't find any documentation regarding that

is this the correct

import pandas_talib 

mom=MOM(df_aapl,3)
rsi= RSI(df_aapl,3)
ma=MA(df_aapl,3)

except momentum indicator all other indicators dosent work and giving error

i tried to use vp and i dont now whats the error

this is the code im using

from get_data import get_klines
import numpy
import pandas_ta as ta
ticker ='BTCUSDT'
interval = '15m'
depth = "20 hours ago UTC+3"

df =get_klines (ticker ,interval,depth)
print(df)

data = df.ta.vp(df['Close'],df['Volume'],width=10)

print(data)

the error

File "c:/Users/DELL/Desktop/begging/test.py", line 14, in
data = df.ta.vp(df['Close'],df['Volume'],width=10)
TypeError: vp() got multiple values for argument 'width'

anyhelp

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.