Skip to content

Reverse engineered connection to the TradingView ticker in Python

License

Notifications You must be signed in to change notification settings

socks5th/Tradingview-ticker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visitors

Tradingview-ticker

Reverse engineered connection to the TradingView ticker in Python. Makes a websocket connection to the Tradeview website and receives price & volume updates realtime. Developed & tested in Python 3.9.5 (So didn't test others)

Make sure the main thread keeps running!! If required just do while True: pass. The program will quit if you don't do so!!

Table of contents

Features

  • Keeps websocket connection alive
  • Can watch multiple tickers on the same time
  • Doesn't cooldown / ratelimit
  • Sqlite3 intergration to save ticker(s) data
  • Easy to use
  • Stable ASF (it's still running after writing all this stuff so it's good enough for me)

Prerequisites

Make sure Python is added to your PATH on Windows, more info here if you didn't let it set the PATH at install.

Installing

Please install the requirements:

# Linux/macOS
python3 -m pip install -r requirements.txt

# Windows
py -3 -m pip install -r requirements.txt

And then you're ready to run!

Quick Example

import time
from ticker import ticker

tick = ticker("BINANCE:BTCUSDT")
tick.start()

while (True): # Print out prices & volumes every 2 seconds
    print(tick.states) # Example: {'BINANCE:BTCUSDT': {'volume': 2089.98057, 'price': 67715.07, 'change': 189.24, 'changePercentage': 0.28}}
    time.sleep(2)

Multiple Symbols

import time
from ticker import ticker

tick = ticker(["BINANCE:BTCUSDT","NASDAQ:AAPL"])
tick.start()

while (True): # Print out prices & volumes every 2 seconds
    print(tick.states) # Example: {'BINANCE:BTCUSDT': {'volume': 2089.98057, 'price': 67715.07, 'change': 189.24, 'changePercentage': 0.28}, 'NASDAQ:AAPL': {'volume': 59039175, 'price': 151, 'change': 1, 'changePercentage': 0.67}}
    time.sleep(2)

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.

About

Reverse engineered connection to the TradingView ticker in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%