Comments (14)
Nice! Hopefully, DataCube will make this process easier. Currently WIP.
from trading-vue-js.
Hello @hoangvanlong5342 idk when exactly, but when it's done, it will be a bloody powerful tool.
See the progress: https://github.com/C451/trading-vue-js/blob/master/src/helpers/datacube.js
API is undocumented for now.
from trading-vue-js.
An extended sample that uses ccxt as a candle source would be a nifty real-life async demonstration of this:
https://github.com/ccxt/ccxt#javascript-for-use-with-the-script-tag
Each range-stretch could trigger a REST API request to fill that missing gap.
from trading-vue-js.
Yep, I get the idea. I'm not sure about including a third party API, but a simple callback will certainly do the job.
from trading-vue-js.
If someone is still looking for a solution i got it working by adding an @mouseup event on a div that wraps the vue component like so.
<div @mouseup="onChartMouseRelease" class="chartDiv">
<trading-vue
:data="chartContainer"
:width="this.width"
:height="this.height"
ref="tradingVue">
</trading-vue>
</div>
the event fires off this method
onChartMouseRelease(event) {
console.log("mouse released.");
this.rangeCheck();
},
which then checks if more data needs to be fetched
rangeCheck: function() {
var range = this.$refs.tradingVue.getRange();
if (range[0] < this.chartContainer.chart.data[0][0]) {
console.log("get more data..");
this.fetchMoreData();
}
}
and finally get the data somehow and unshift it to the chart data array
fetchMoreData: function() {
var startTs = this.chartContainer.chart.data[0][0];
var tf = this.getCurrentTfInt();
axios
.get(
BASE_URL +
"/Home/GetPreviousMarketData?timeStamp=" +
startTs +
"&timeFrame=" +
tf +
"&count=100"
)
.then(res => {
console.log(JSON.stringify(res.data.data));
this.chartContainer.chart.data.unshift(...res.data.data);
})
.catch(err => console.log(err));
}
from trading-vue-js.
Hi @C451
When you close this issue?
Thanks
from trading-vue-js.
DataCube
How to use DataCube?
from trading-vue-js.
Hi @C451
when do you update document for new api?
from trading-vue-js.
Timing is the hardest part. Now the data helper is unstable/experimental, the API may change. When you see at least half of the checkmarks filled, you can expect some docs: https://github.com/C451/trading-vue-js/projects/1
from trading-vue-js.
Hi @C451
I like this feature.
How to use this library on NuxtJS?
from trading-vue-js.
Really good. I'm waiting for this function
When will you finish?
Thanks
from trading-vue-js.
@learntolearn99 I think you can do it easily
from trading-vue-js.
https://github.com/C451/trading-vue-js/blob/master/test/tests/DataHelper.vue
An example of connection to an exchange. (Unstable, there may be errors)
from trading-vue-js.
DataCube handles the basic operations, close.
from trading-vue-js.
Related Issues (20)
- z-index not working HOT 1
- Order lines & order arrows
- Looks like linked tvjs.io domain is lost
- refreshing new data ,wanna get a new chart i failed
- Vue 3 support? HOT 3
- Convert it to JS Library (React) HOT 2
- Use of the library HOT 1
- library tool
- Help to implement "snap to candle ohlc" feature HOT 2
- Plot bars on yAxis HOT 3
- Proposal to build a library for svelte (trading-svelte) HOT 1
- Chart won't show candles with 1m interval data HOT 2
- Help! HOT 1
- Related maintenance
- Please enable github's security features
- tvjs-xp and realtime broker data error
- Issue with update_tick in dc_core.js
- How to make new tool in my project.
- does it support live data
- Transaction records on the bar.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trading-vue-js.