Comments (5)
Hi @emptyopen ,
The function add_all_ta_features
waits for strings instead of pd.Series for OHLCV parameters. Please, try doing this:
ta.add_all_ta_features(df, close='close', open='open', high='high', low='low', volume='volume', fillna=True)
I will add some documentation for these wrapper functions.
Best,
Dario
from ta.
Hi @sanjaykumar-e ,
A lot of new features were included in the library. Can you reproduce this error again?
Thank you.
from ta.
Hi I'm getting this error as well.
KeyError: "None of [Float64Index([76.36, 75.88, 76.25, 74.82, 75.51, 76.33, 75.89, 75.11, 75.97,\n 76.56, 76.68, 76.15, 76.12, 77.35, 77.85, 76.91, 75.94, 76.38,\n 76.65, 76.85, 77.55, 77.5, 77.45, 78.31, 78.5, 79.49],\n dtype='float64')] are in the [columns]"
In response to ta.add_all_ta_features
.
from ta.
Hi @emptyopen
Can you share more information? The code and the dataset would be great.
Best,
Dario
from ta.
Hi, here's the code:
cursor = self.db['A'].find().sort([('date', pymongo.ASCENDING)])
df = pd.DataFrame(list(cursor))
print(df[['date', 'close', 'open', 'high', 'low', 'volume']])
ta.add_all_ta_features(df, close=df['close'], open=df['open'], high=df['high'], low=df['low'], volume=df['volume'], fillna=True)
print(df)
results in:
date close open high low volume
0 2019-10-15 75.75 75.80 76.36 75.68 854689
1 2019-10-16 75.27 75.30 75.88 74.96 2401590
2 2019-10-17 74.92 75.69 76.25 74.90 1657180
3 2019-10-18 74.57 74.00 74.82 73.77 2121895
4 2019-10-21 75.48 74.88 75.51 74.69 1739523
5 2019-10-22 74.69 75.68 76.33 74.64 1327981
6 2019-10-23 74.98 75.02 75.89 74.68 1828337
7 2019-10-24 75.00 75.03 75.11 74.46 1582478
8 2019-10-25 75.39 74.70 75.97 74.13 835050
9 2019-10-28 76.15 75.69 76.56 75.69 1143869
10 2019-10-29 76.17 75.05 76.68 74.94 1113263
11 2019-10-30 76.12 76.04 76.15 75.24 914844
12 2019-10-31 75.75 76.00 76.12 75.10 970472
13 2019-11-01 76.97 76.51 77.35 76.32 1106314
14 2019-11-04 76.74 77.68 77.85 76.73 1010174
15 2019-11-05 75.55 76.82 76.91 75.47 2362670
16 2019-11-06 75.79 75.70 75.94 74.94 1355737
17 2019-11-07 75.91 76.34 76.38 75.68 860939
18 2019-11-08 76.64 75.90 76.65 75.65 1231456
19 2019-11-11 76.85 76.25 76.85 76.13 1149169
20 2019-11-12 77.05 77.00 77.55 76.72 1008787
21 2019-11-13 77.16 76.82 77.50 76.56 1104429
22 2019-11-14 76.76 77.21 77.45 76.48 1113519
23 2019-11-15 78.26 76.93 78.31 76.61 1700368
24 2019-11-18 77.94 78.14 78.50 77.50 1641215
25 2019-11-19 79.29 78.17 79.49 77.84 1704766
Traceback (most recent call last):
File "C:/Users/Takkeezi/PycharmProjects/capitVita/application.py", line 13, in <module>
calculator.calculate_indicators()
File "C:\Users\Takkeezi\PycharmProjects\capitVita\DataCalculator\DataCalculator.py", line 48, in calculate_indicators
ta.add_all_ta_features(df, close=df['close'], open=df['open'], high=df['high'], low=df['low'], volume=df['volume'], fillna=True)
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\ta\wrapper.py", line 290, in add_all_ta_features
df = add_volume_ta(df=df, high=high, low=low, close=close, volume=volume, fillna=fillna, colprefix=colprefix)
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\ta\wrapper.py", line 39, in add_volume_ta
high=df[high], low=df[low], close=df[close], volume=df[volume], fillna=fillna).acc_dist_index()
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\pandas\core\frame.py", line 2986, in __getitem__
indexer = self.loc._convert_to_indexer(key, axis=1, raise_missing=True)
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 1285, in _convert_to_indexer
return self._get_listlike_indexer(obj, axis, **kwargs)[1]
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 1092, in _get_listlike_indexer
keyarr, indexer, o._get_axis_number(axis), raise_missing=raise_missing
File "C:\Users\Takkeezi\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 1177, in _validate_read_indexer
key=key, axis=self.obj._get_axis_name(axis)
KeyError: "None of [Float64Index([76.36, 75.88, 76.25, 74.82, 75.51, 76.33, 75.89, 75.11, 75.97,\n 76.56, 76.68, 76.15, 76.12, 77.35, 77.85, 76.91, 75.94, 76.38,\n 76.65, 76.85, 77.55, 77.5, 77.45, 78.31, 78.5, 79.49],\n dtype='float64')] are in the [columns]"
from ta.
Related Issues (20)
- Default window
- MACD errors HOT 1
- volume_price_trend is completly wrong HOT 2
- requesting two indicators HOT 1
- Confusion about Force Index HOT 1
- Add parameter "exclude_ta_features" from add_all_ta_features.
- Why does Bollinger Bands use ddof=0 instead of the default ddof=1? HOT 1
- FutureWarning (with pandas 1.5.1) HOT 1
- ADXIndicator.adx_pos / adx_neg head assertion failed
- AroonIndicator from trend.py based on inadequate input HOT 2
- Bollinger Band data series - something is off HOT 1
- Feature Request: Support incremental computation
- calculate daily return will use future infomation HOT 3
- ADX indicator on stockcharts is wrong (and therefore, it's implementation here too, I guess) HOT 1
- RSIIndicator: Value Error HOT 1
- add_all_ta_features not installing due to bug on OnBalanceVolumeIndicator
- Issue with ADXIndicator interacting with numpy HOT 1
- FutureWarning HOT 1
- not compatible with python 3.12? HOT 1
- Can't install ta with Anaconda on windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ta.