Skip to main content

The package fetch data from tradingview_ws.

Project description

Information

This package to fetch data from tradingview websocket

Installation

Create an isolated Python virtual environment

pip3 install virtualenv virtualenv ./virtualenv --python=$(which python3)

Activate the virtualenv

IMPORTANT: it needs to be activated every time before you run

. virtualenv/bin/activate

Install Python requirements

pip install -r requirements.txt

Install

pip install -e .

run test

python -m test

Using:

  • define a callback function get receive result
def callbackFunc(s):
    print(s)
  • call websocket to get quote price or ohlcv to write a trading bot, data will be delayed 10m if don't use account premium
pair = "ES"

market = "futures" # 'stock' | 'futures' | 'forex' | 'cfd' | 'crypto' | 'index' | 'economic'
username = None
password = None
trading = td.TradingViewWs(pair, market, username, password)
# get quote price
trading.realtime_quote(callbackFunc)

# get ohlcv
interval = 5
total_candle = 240 # total candle to calculate indicator ex: EMA, WMA
trading.realtime_bar_chart(interval, total_candle, callbackFunc)

Alt text

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradingview_ws-0.0.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

tradingview_ws-0.0.3-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tradingview_ws-0.0.3.tar.gz.

File metadata

  • Download URL: tradingview_ws-0.0.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for tradingview_ws-0.0.3.tar.gz
Algorithm Hash digest
SHA256 73ec95a628b00f498382aee8a170995e00ba1f73d290ecf899f253a35d53bf37
MD5 211e763218b526c9d845a57c65068ae6
BLAKE2b-256 baaa700776df88270e6ac3c7d0ffcd67ca2e61ab5b0da91ec62b5d6392d3f6fd

See more details on using hashes here.

File details

Details for the file tradingview_ws-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tradingview_ws-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ff3ca3ff5ad6952a80afc804014d2d198556c54639a8e34b2e3ea5edc2ed70f9
MD5 8e3821e4352fb92c0a98188bef84f36e
BLAKE2b-256 809278ae0c32f0f2c9844e481f0599bf83230a9a4c5c8dcdb8f5bbb4975cc29d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page