Skip to main content

python-tradingview-ta License: MIT Open Source Love

A python module to scrape tradingview's technical analysis.

Features

Scrape analysis from TradingView, ex: from XLMBTC, to a list. Works by using selenium webdriver to scrape elements from tradingview's technical analysis widget.

Requirements

Installation

Using pip:
pip install tradingview_ta

Quickstart Example

from tradingview_ta import ta_handler

xlmbtc = ta_handler()
xlmbtc.pair = "xlmbtc"
xlmbtc.interval = "1m"
#xlmbtc.driver = "chrome"
#xlmbtc.headless = True

xlmbtc.start_driver()
analysis = xlmbtc.get_analysis()

print(analysis)
#Example output: ["Buy", 3, 10, 17]

Usage

Import module

from tradingview_ta import ta_handler

Create an instance

ta_instance = ta_handler()

Does not need to be ta_instance. Name it whatever you want!

Set pair/ticker/symbol

ta_instance.pair = "PAIR NAME"

Pair/Ticker/Symbol example: "btcusdt", "googl", "aapl", etc.
You may use the exchanger's name too, for example: "binance:btcusdt" or "nasdaq:aapl"

Set interval (default: 1 minute)

ta_instance.interval = "INTERVAL"

Available interval:

  • "1m" for 1 minute.
  • "5m" for 5 minutes.
  • "15m" for 15 minutes.
  • "1h" for 1 hour.
  • "4h" for 4 hours.
  • etc.

Set webdriver (default: chrome)

ta_instance.driver = "WEBDRIVER NAME"

Available webdriver: Chrome, Firefox, Safari, Edge. See selenium's documentation for webdriver installation.

Set headless (default: True)

ta_instance.headless = True/False

Headless means no GUI, so no browser tab will be opened.

Start webdriver

ta_instance.start_driver()

Start the previously setted up webdriver.

Get analysis

analysis = ta_instance.get_analysis()

The get_analysis() function will return a list, containing the following value.

  • The first index (string) shows the recommendation from TradingView, the value can contain "Buy", "Strong Buy", "Neutral", "Sell", or "Strong Sell".
  • The second index (int) shows the number/count of Sell analysis
  • The third index (int) shows the number/count of Neutral analysis
  • The fourth index (int) shows the number/count of Buy analysis

Contributing

You can fork this repository or submit a pull request. Any pull request (documentation, bug fix, features, etc) are welcomed.

License

Please see the LICENSE file.

Release files for tradingview-ta 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradingview-ta 2.1.0
File Size Uploaded
tradingview_ta-2.1.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tradingview-ta 2.1.0
File Interpreter ABI Platform
tradingview_ta-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / tradingview_ta-2.1.0.tar.gz

Download URL tradingview_ta-2.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3e8deec209cc208013cee288f179969761accf03adf7822f956594ad4068ac3e
BLAKE2b-256 checksum
How to use checksums
f7c6a85de9966b8a1e5e1572c145ee6262f6db7005b4611a6454bc51a8669bcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / tradingview_ta-2.1.0-py3-none-any.whl

Download URL tradingview_ta-2.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f505fbb6d3e3dfe5c5ab70c6b6d84d5bcd211c1ab881bb99e179568f5a1fbda3
BLAKE2b-256 checksum
How to use checksums
c8314ad3e4443977bf6f79248ad45414b36c3a7b39b5080d7c372db5143cf8cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

3.3.0

2 release files

3.2.10

2 release files

3.2.9

2 release files

3.2.8

2 release files

3.2.7

2 release files

3.2.6

2 release files

3.2.5

2 release files

3.2.4

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.0.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

This release

2.1.0 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page