Giter VIP home page Giter VIP logo

tradingview-web-socket's Introduction

2022-08-03

-English | 简体中文 | 繁體中文

The main branch demo uses the version of tvadingview v20.033 (internal id 9df149da @ 2021-11-17T10:20:51.511Z), the charting_library file, please visit the official website of tradingview to get it, if you need to use or browse Old version, please switch branch to view. I will add comments to the datafeed when I am asked more questions. The official default datafeed is to obtain historical data through http, and then obtain real-time data through the polling http interface. If you do not need to use WebSocket to push data, it is recommended to directly refer to the official demo. After the application chart is successful, you can visit the official warehouse.

Flowchart

          graph LR
          start[React Render] --> input[Initialize the chart and WebSocket]
          input --> conditionA{Chart callback datafeed<Please read the datafeed file for the callback process>}
          conditionA -- WebSocket mode --> conditionC{Subscribe to historical and real-time data}
          conditionA -- WebSocket+Http mode --> conditionB{Request historical data and subscribe to real-time data}
          conditionC -- WebSocket mode --> printA[Process real-time data]
          conditionC -- WebSocket mode --> printC[Return the format data that meets the chart requirements to the chart#Please refer to the type definition of the getBar function]
          conditionB -- WebSocket+Http mode --> printB[Process real-time data]
          conditionB -- WebSocket+Http mode --> printC[Return the format data that meets the chart requirements to the chart#Please refer to the type definition of the getBar function]
          printA --> stop[Chart rendering data]
          printC --> stop
          printB --> stop

Example

react demo

Task list

  • add react demo
  • add vue demo:

Screenshot

tradingview-web-socket's People

Contributors

472647301 avatar dependabot[bot] avatar sanyu1225 avatar zhb333 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tradingview-web-socket's Issues

tradingview出不来

WX20210107-131133@2x

哥们,好像是tradingview报错。这个怎么解决 library.min.js?0d00:2 Uncaught (in promise) TypeError: t._innerWindow(...).widgetReady is not a function at eval (library.min.js?0d00:2)

websocket连接失败

为什么连接WebSocket connection to 'wss://api.huobi.pro/ws' failed: 失败? 我看网站的例子也是websocket连接失败 , 本地代码也是一样的

版本问题

请问tradingview-api这个npm包用的是哪个版本的charting_library.min.js呢?

股票价格

感谢分享!我希望利用 JS API连接股票价格数据,请问可以帮忙吗?谢谢!

关于引入 charting_library.min.js 的问题

项目中没用到 TS, 我就抽离出来测试看看,然后报错了,如下:

image

在 vue 例子中找了好久没找到,所以想请问下大佬,vue 例子中在哪里引入 charting_library.min.js 的?

image

这是官方例子中的引入:
image

Update Request on the Tradingview Charting Libary

Hey, could you please update the Tradingview Charting Libary? Because the current version of it present in the project seem pretty old.

嘿,你能不能更新一下Tradingview图表库的内容?因为项目中目前的版本似乎很旧。

老大错误

  1. yarn install

yarn install v0.25.2
(node:12116) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@vue/[email protected]" has unmet peer dependency "vue-template-compiler@^2.0.0".
warning "[email protected]" has unmet peer dependency "sass@^1.3.0".
warning "[email protected]" has unmet peer dependency "fibers@>= 3.1.0".
[4/4] Building fresh packages...
[-/4] ⡀ waiting...
[-/4] ⡀ waiting...
[-/4] ⡀ waiting...

  1. yarn serve

yarn serve v0.25.2
(node:6888) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)
$ vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
98% after emitting CopyPlugin

ERROR Failed to compile with 1 error 上午10:42:40

error in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss&scoped=true

Syntax Error: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1

react demo not work

运行 react ts demo失败了,怎么回事?

Screen Shot 2022-04-10 at 12 49 20 pm

好像./public/charting_library/charting_library.js没加载成功,文件存在

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.