Questions tagged [pandas-ta]

questions related to pandas technical analysis (pandas-ta) library.

Pandas Technical Analysis (Pandas TA) is an easy to use library that leverages the Pandas package with more than 130 Indicators and Utility functions and more than 60 TA Lib Candlestick Patterns. Many commonly used indicators are included, such as:

  • Candle Pattern(cdl_pattern)
  • Simple Moving Average (sma)
  • Moving Average Convergence Divergence (macd)
  • Hull Exponential Moving Average (hma)
  • Bollinger Bands (bbands)
  • On-Balance Volume (obv)
  • Aroon & Aroon Oscillator (aroon)
  • Squeeze (squeeze) and many more.

More info here

38 questions
0
votes
0 answers

Talib and pandas_ta accepts no more than 114130 lines of data

I encountered unusual behavior of libraries for technical analysis. Talib and pandas_ta accepts no more than 114130 lines of data. pandas_ta.stdev(closes[:114133], 3) Open time 2021-02-04 16:33:00+00:00 NaN 2021-02-04 16:34:00+00:00 …
0
votes
1 answer

apply a function to each level of grouping factor and create new column in existing data frame

I have a data frame (df) that looks like this timestamp datetime date time open \ 0 1667520000000 2022-11-04 00:00:00+00:00 2022-11-04 00:00:00 0.2186 1 1667606400000 2022-11-05…
0
votes
0 answers

supertrend function not returning data as per Parameter passed

I am using inbuilt supertrend function to get supertrend value. My requirement is I want supertrend data with length=1, multiplier=3 . When I change length & multiplier to any value then still I am getting (7,3) supertrend data. import pandas_ta as…
0
votes
1 answer

How can I change logic from (False to True) based on the 1st column and (True to False) based on the 2nd column

The idea is to switch between the set of True and False conditioned by 2 columns. For example Column A Column B Column…
Omegaruins
  • 19
  • 3
0
votes
1 answer

Google Colab, loop through google drive folder, read each CSV file in folder into a datframe, then append dataframe

I am using Google Colab I have a folder of CSV files in a google drive directory '/content/drive/MyDrive/Colab Notebooks/Stocks CSVs/Stocks/' I want to loop through this folder, read each CSV to a data frame, append this data frame with technical…
0
votes
1 answer

Dataframe skips 5 rows when index reaches x999 to x000

When generating the big table of 1s timeframe (generally greater than 10000 rows) I found data shifted due to 5 missing rows (5m skipped) at 999-1000, 1999-2000, 2999-3000 and so on. This also occurs with 1m timeframe (guess this may occur with 1h…
Omegaruins
  • 19
  • 3
0
votes
0 answers

ValueError: cannot reindex on an axis with duplicate labels when adding EMAs via group_by

Sorry for the noob question. I have a bunch of minute data like so: timestamp open high low close volume trade_count vwap symbol volume_10_day 0 2021-06-28 11:15:00+00:00 1.8899 1.89 1.8899 1.8900 …
a7dc
  • 3,323
  • 7
  • 32
  • 50
0
votes
0 answers

Not matching tradingview

I am using TradingView as reference for EMA. As of 9th December, EMA 100 for ABB (Indian Exchange) is 2962.25. But when I use pandas ta I get 2965.44. Similarly, 200 ema should be 2720.93 but I get 2685.57 import yfinance as yf import pandas_ta as…
chintan s
  • 6,170
  • 16
  • 53
  • 86
0
votes
0 answers

Loop through a list of indicators to add to a data frame

Using pandas-ta library on python 3.10. I'm trying to write a function that gets a data frame and a list of indicator names as strings, then for each name in the list, add it as an indicator to the data frame. For example, trying to do something…
Zuki
  • 1
  • 3
0
votes
1 answer

OBV Calculation

obv = cum(change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume) obv2 = cum(sign(change(src)) * volume ) obv and obv2 return different results ta.obv(df['close'], df['volume']) returns the same result as obv2 I will also need the return…
Askeroglu
  • 1
  • 1
0
votes
0 answers

TypeError: 'NoneType' object is not subscriptable using pandas_ta and yfinance

I am trying to calculate the macd of a stock using the panada_ta library. The function I created to do so (will post below) works perfectly fine when I run it on it's own, but I am trying to call it within a calc_technicals() functions that calls…
0
votes
2 answers

How do I replicate SuperTrend indicator from Binance website?

I'm trying to implement (in Python) SuperTrend indicator that you can see on Binance website if you click on TradingView tab and add it here So far I've tried multiple various ways of calculating it as well as TA-Lib and pandas-ta. None of those are…
MonZon
  • 31
  • 9
0
votes
2 answers

How do i add my ta indicator to my mplfinance candlstick chart?

I do apologize for this question but I am seriously struggling. Below is my code so far. Im 2 months into python and here Ive been sitting for a whole day trying to figure this out. Please can someone take a look and maybe provide a comment on…
0
votes
1 answer

How Do I Plot Indicator Lines Using mplfinance and pandas ta?

I have the following code: import MetaTrader5 as mt5 import pandas as pd import time import pandas_ta as ta import mplfinance as mpf pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1500) if not mt5.initialize(): …
Fingers
  • 373
  • 3
  • 18
0
votes
1 answer

How to find current upper Bollinger band in pandas-ta

I have a CSV file having columns Instrument, Date, Time, Open, High, Low, Close I want the rows having Current close greater than current upper Bollinger band(20,2) I found the function bbands in pandas-ta but I don't know how to compare it with…
Jay Patel
  • 1,098
  • 7
  • 22