TradingVue.js
TradingVue.js is a hackable charting lib for traders. You can draw literally ANYTHING on top of candlestick charts.
Why
If you create trading software - this lib is probably for you. If you like to make custom indicators and think out of the box - this lib is most likely for you. And if you miss usability of TradingView.com in other open-source libraries and can't stand it - you are definetly in the right place!
Features
- Scrolling & zooming as we all like
- Simple API for making new overlays
- No need for fancy math
- One overlay === one .vue component
- Fully reactive
- Fully responsive
- Customizable colors and fonts
Install
NPM
npm i trading-vue-js
In browser
<script src="trading-vue.min.js"></script>
How to use
Minimal working example:
Core philosophy
The core philosophy is Data -> Screen Mapping (DSM). The library provides you with functions that map your data (it could be anything) to screen coordinates. The lib does all the dirty work behind the scenes: scrolling, scaling, reactivity, etc.
layout.t2screen(t) // time -> x
layout.$2screen($) // price -> y
layout.t_magnet(t) // time -> nearest candle x
layout.screen2$(y) // y -> price
layout.screen2t(x) // x -> time
Using these functions and the standard js canvas API, you can do magic.
Data structure
PRO TIP: chart is mandatory if you want to see something other than a white screen
The process of adding a new indicator is simple: first you define your own data format (should be timestamped though) and display settings. For example, EMA data might look like this:
Example of a simple overlay class
And then you make a new overlay class to display that data on the grid:
That's why the title doesn't lie: you can draw ANYTHING.
Grin
Code | click your ?
Roadmap
DocsTests- Solve known issues (marked as 'TODO: IMPORTANT')
- Performance improvements
- Data-manipulation helpers
- Add more built-in overlays
- Add toolbar (drawing tools)
- Custom loayout / layout persistence
- Fix and improve mobile version
- Version 1.0.0 here
Progress in details: https://github.com/C451/trading-vue-js/projects/1
Changelog
See CHANGELOG.md
Development & Building
Install devDependencies
npm install
Run development enviroment (hot)
npm run dev
Server is running on http://localhost:8080
Build the bundle
npm run build
Visual testing
npm run test
Server is running on http://localhost:8080