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)
- Keeps websocket connection alive
- Can watch multiple tickers on the same time
- Doesn't cooldown / ratelimit
- Easy to use
- Stable ASF (it's still running after writing all this stuff so it's good enough for me)
Make sure Python is added to your PATH on Windows, more info here if you didn't let it set the PATH at install.
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!
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)
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)