To fetch technical analysis data, instantiate a TA_Handler with the required market parameters and call .get_analysis().summary.
Parameters:
symbol: The ticker symbol (e.g., "TSLA").screener: The market screener (e.g., "america").exchange: The exchange name (e.g., "NASDAQ").interval: An Interval enum value (e.g., Interval.INTERVAL_1_DAY).proxies (optional): A dictionary to enable proxy support, e.g., {'http': 'http://example.com:8080'}.
Output Format:
The .summary attribute returns a dictionary containing the recommendation and counts for BUY, NEUTRAL, and SELL signals.
Example: {"RECOMMENDATION": "BUY", "BUY": 8, "NEUTRAL": 6, "SELL": 3}.
Tip: If you are unsure of the correct symbol, screener, or exchange values, use https://tvdb.analyzer.rest/ to look them up.
from tradingview_ta import TA_Handler, Interval, Exchange
tesla = TA_Handler(
symbol="TSLA",
screener="america",
exchange="NASDAQ",
interval=Interval.INTERVAL_1_DAY,
# proxies={'http': 'http://example.com:8080'} # Uncomment to enable proxy (replace the URL).
)
print(tesla.get_analysis().summary)
# Example output: {"RECOMMENDATION": "BUY", "BUY": 8, "NEUTRAL": 6, "SELL": 3}