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)
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)
time.sleep(2)
License
This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.