A simple python implementation for connecting to the TradingView websocket backend, and extracting ticker historical series.
from TView_api import TViewAPI
tickers = ["TVC:CA10Y", 'TVC:RU10Y']
trading_view_api = TViewAPI()
data = trading_view_api.get_series(tickers)
display(data)
date | open | high | low | close | symbol | country | type | |
---|---|---|---|---|---|---|---|---|
0 | 1985-12-31 22:00:00 | 9.803 | 10.378 | 9.803 | 10.268 | TVC:CA10Y | CA | bond |
1 | 1986-02-02 22:00:00 | 10.288 | 10.288 | 9.753 | 9.753 | TVC:CA10Y | CA | bond |
2 | 1986-03-02 22:00:00 | 9.680 | 9.680 | 9.096 | 9.096 | TVC:CA10Y | CA | bond |
3 | 1986-03-31 22:00:00 | 9.016 | 9.189 | 8.849 | 9.001 | TVC:CA10Y | CA | bond |
4 | 1986-04-30 21:00:00 | 9.040 | 9.226 | 8.787 | 9.226 | TVC:CA10Y | CA | bond |
... | ... | ... | ... | ... | ... | ... | ... | ... |
606 | 2023-07-02 21:00:00 | 11.190 | 11.560 | 11.150 | 11.500 | TVC:RU10Y | RU | bond |
607 | 2023-07-31 21:00:00 | 11.500 | 12.090 | 11.440 | 12.030 | TVC:RU10Y | RU | bond |
608 | 2023-08-31 21:00:00 | 12.040 | 12.930 | 11.980 | 12.900 | TVC:RU10Y | RU | bond |
609 | 2023-10-01 21:00:00 | 12.910 | 13.360 | 12.000 | 12.700 | TVC:RU10Y | RU | bond |
610 | 2023-10-31 21:00:00 | 12.700 | 12.730 | 12.470 | 12.520 | TVC:RU10Y | RU | bond |
611 rows × 8 columns