Skip to content

Support m1 to get lateset data #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jafarijason opened this issue Apr 18, 2025 · 2 comments
Closed

Support m1 to get lateset data #211

jafarijason opened this issue Apr 18, 2025 · 2 comments

Comments

@jafarijason
Copy link

Currently once we do

const data = await getHistoricalRates({
      instrument: 'btcusd',
      dates: {
        from: new Date('2019-01-13'),
        to: new Date()
      },
      timeframe: 'm1',
      format: 'json'
    });

it return data until 1 hour ago of last data, is there any whay we can do more real time data if duckascopy supporting?

@Leo4815162342
Copy link
Owner

Leo4815162342 commented Apr 20, 2025

@jafarijason there is an experimental support for current rates:

const { getCurrentRates } = require("dukascopy-node");

async function main() {
  const data = await getCurrentRates({
    instrument: "btcusd",
    timeframe: "m1",
    format: "json",
    limit: 10, // will give you last X items starting from current minute
  });
  console.log(data);
}

main();

source code: https://github.com/Leo4815162342/dukascopy-node/blob/master/src/getCurrentRates.ts

@jafarijason
Copy link
Author

@Leo4815162342 That works well, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants