GithubHelp home page GithubHelp logo

Comments (14)

C451 avatar C451 commented on May 19, 2024 1

Nice! Hopefully, DataCube will make this process easier. Currently WIP.

from trading-vue-js.

C451 avatar C451 commented on May 19, 2024 1

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.

tiagosiebler avatar tiagosiebler commented on May 19, 2024

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.

C451 avatar C451 commented on May 19, 2024

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.

va-prans avatar va-prans commented on May 19, 2024

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.

hoangvanlong5342 avatar hoangvanlong5342 commented on May 19, 2024

Hi @C451
When you close this issue?
Thanks

from trading-vue-js.

hoangvanlong5342 avatar hoangvanlong5342 commented on May 19, 2024

DataCube

How to use DataCube?

from trading-vue-js.

hoangvanlong5342 avatar hoangvanlong5342 commented on May 19, 2024

Hi @C451
when do you update document for new api?

from trading-vue-js.

C451 avatar C451 commented on May 19, 2024

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.

learntolearn99 avatar learntolearn99 commented on May 19, 2024

Hi @C451
I like this feature.
How to use this library on NuxtJS?

from trading-vue-js.

zmohamed200133 avatar zmohamed200133 commented on May 19, 2024

Really good. I'm waiting for this function
When will you finish?
Thanks

from trading-vue-js.

C451 avatar C451 commented on May 19, 2024

@learntolearn99 I think you can do it easily

from trading-vue-js.

C451 avatar C451 commented on May 19, 2024

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.

C451 avatar C451 commented on May 19, 2024

DataCube handles the basic operations, close.

from trading-vue-js.

Related Issues (20)

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.