Downloading tick data

Downloading tick data

dukascopy-node allows you to download tick data on top of all other offered timeframes.

Since tick timeframe represents a raw price change, the output will NOT contain OHLC data (open, high, low, close prices).

via CLI:

npx dukascopy-node -i btcusd -from 2019-01-13 -to 2019-01-14 -t tick -f csv
dukascopy-node via cli

via Node.js:

const { getHistoricalRates } = require("dukascopy-node");
 
(async () => {
  try {
    const data = await getHistoricalRates({
      instrument: "eurusd",
      dates: {
        from: new Date("2021-03-30"),
        to: new Date("2021-03-31"),
      },
      timeframe: "tick",
    });
 
    console.log(data);
  } catch (error) {
    console.log("error", error);
  }
})();

Output shape:

[
  {
    "timestamp": 1585526400104,
    "askPrice": 1.11369,
    "bidPrice": 1.11361,
    "askVolume": 0.75,
    "bidVolume": 0.75
  }
]

Full example output: with-tick-data.output.json (opens in a new tab)

โ—Keep in mindโ—

When downloading tick data for long time ranges, expect the size of the output files to be very big (gigabytes of data).

On top of that expect slow loading times and big output, and consider adjusting batchSize and pauseBetweenBatchesMs parameters. More info: With custom batching (opens in a new tab)