Registry / http-networking / tradingview-ta

tradingview-ta

JSON →
library3.3.0pypypi✓ verified 85d ago

Unofficial TradingView technical analysis API wrapper for Python. Provides buy/sell signals, indicator values, and symbol search. Current version 3.3.0, supports Python >=3.6. Release cadence irregular, focused on adding indicators and fixing TradingView algorithm changes.

pip install tradingview-ta
INSTALL
IMPORT
SIG · TRADINGVIEW-TA
T
tradingview-ta
http-networkingpythonv3.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TA_Handler
from tradingview_ta import TA_Handler
from tradingview_ta.ta_handler import TA_Handler
Common mistake: importing from a submodule instead of the top-level package.
Interval
from tradingview_ta import Interval
Use Interval.INTERVAL_1HOUR etc.
Exchange
from tradingview_ta import Exchange
Use Exchange.BINANCE or Exchange.NYSE.

Fetch technical analysis summary and indicators for a symbol.

from tradingview_ta import TA_Handler, Interval, Exchange # Example: Get analysis for BTCUSDT on Binance handler = TA_Handler( symbol="BTCUSDT", screener="crypto", exchange="BINANCE", interval=Interval.INTERVAL_1HOUR, ) analysis = handler.get_analysis() print(analysis.summary) print("RSI:", analysis.indicators["RSI"])
Debug
Known issues
breakingStarting from v3.0.0, the interval parameter must be an Interval enum, not a string like '1h'.
fix
Use Interval.INTERVAL_1HOUR instead of '1h'.
affects: >=3.0.0
breakingFrom v3.2.0, get_analysis() returns a dict-like object instead of a custom class with attributes directly.
fix
Access data via analysis.summary, analysis.indicators, analysis.time, analysis.ticker instead of analysis['summary'].
affects: >=3.2.0
gotchaTradingView frequently changes its technical analysis algorithms, leading to inaccurate signals. The library updates indicators but may lag.
fix
Always verify signals with real chart; consider running in testing mode with a small amount.
affects: all
gotchaThe library is unofficial and rate-limits are not enforced by the library, but TradingView may block excessive requests.
fix
Implement your own rate limiting (e.g., 1 request per second). Use proxies if needed.
affects: all
Errors
Common errors & fixes
AttributeError: 'NoneType' object has no attribute 'summary'
get_analysis() returned None. This can happen if the symbol is invalid or network issue.
fix
Check symbol/exchange/screener validity. Add error handling: analysis = handler.get_analysis(); if analysis: print(analysis.summary)
tradingview_ta.ta_handler.ExchangeNotFound
Specified exchange name is not recognized (e.g., 'BINANCEUS' instead of 'BINANCE').
fix
Use valid exchange names from Exchange enum, e.g., Exchange.BINANCE, Exchange.NYSE.
ModuleNotFoundError: No module named 'tradingview_ta'
Package not installed or installed under a different name.
fix
Run 'pip install tradingview-ta' (note the underscore in import vs hyphen in package name).
Upgrade
Version history
3.3.0latest on PyPI · released Oct 5, 2022
Audit
Dependencies
requestsrequiredHTTP requests to TradingView
typing-extensionsoptionalType hints for older Python versions
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
tradingview-ta — pip install tradingview-ta · libregistry