{"id":28568418,"url":"https://github.com/dearvn/tradingview_ws","last_synced_at":"2025-06-10T16:12:00.273Z","repository":{"id":62625734,"uuid":"511957925","full_name":"dearvn/tradingview_ws","owner":"dearvn","description":"Get data realtime from websocket tradingview","archived":false,"fork":false,"pushed_at":"2022-11-04T11:49:35.000Z","size":40,"stargazers_count":48,"open_issues_count":5,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-09T06:17:37.299Z","etag":null,"topics":["python3","stock","tradingview","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dearvn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-08T16:24:31.000Z","updated_at":"2025-05-26T17:16:52.000Z","dependencies_parsed_at":"2023-01-21T00:45:28.837Z","dependency_job_id":null,"html_url":"https://github.com/dearvn/tradingview_ws","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearvn%2Ftradingview_ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearvn%2Ftradingview_ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearvn%2Ftradingview_ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearvn%2Ftradingview_ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dearvn","download_url":"https://codeload.github.com/dearvn/tradingview_ws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearvn%2Ftradingview_ws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259106733,"owners_count":22805941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python3","stock","tradingview","websocket"],"created_at":"2025-06-10T16:11:59.718Z","updated_at":"2025-06-10T16:12:00.265Z","avatar_url":"https://github.com/dearvn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Information\nThis package to fetch data from tradingview websocket\n## Installation\n\n# Create an isolated Python virtual environment\npip3 install virtualenv\nvirtualenv ./virtualenv --python=$(which python3)\n\n# Activate the virtualenv\n# IMPORTANT: it needs to be activated every time before you run\n. virtualenv/bin/activate\n\n# Install Python requirements\npip install -r requirements.txt\n\n# Install\npip install -e .\n\n# run test\npython -m test\n\n# Using:\n\n* define a callback function get receive result\n\n```\ndef callbackFunc(s):\n    print(s)\n```\n\n* call websocket to get quote price or ohlcv to write a trading bot, data will be delayed 10m if don't use account premium\n\n```\npair = \"ES\"\n\nmarket = \"futures\" # 'stock' | 'futures' | 'forex' | 'cfd' | 'crypto' | 'index' | 'economic'\nusername = None\npassword = None\ntrading = td.TradingViewWs(pair, market, username, password)\n# get quote price\ntrading.realtime_quote(callbackFunc)\n\n# get ohlcv\ninterval = 5\ntotal_candle = 240 # total candle to calculate indicator ex: EMA, WMA\ntrading.realtime_bar_chart(interval, total_candle, callbackFunc)\n```\n\n![Alt text](https://github.com/dearvn/tradingview_ws/raw/main/console.png?raw=true \"result\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearvn%2Ftradingview_ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdearvn%2Ftradingview_ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearvn%2Ftradingview_ws/lists"}