Skip to content
dukascopy-node

Downloading tick data

Download every price change, with bid and ask prices and volumes, for forex, stocks, crypto and more. Plus tips for large tick downloads.

On top of candles, dukascopy-node can download ticks: every single price change, with the best ask and bid price at that moment and the volume available at each. Ticks are not aggregated, so there is no open, high, low or close.

For a step-by-step example with currency pairs, see download free forex tick data for backtesting.

Terminal window
npx dukascopy-node -i eurusd -from 2020-03-30 -to 2020-03-31 -t tick -f csv
import { getHistoricalRates } from 'dukascopy-node';
const ticks = await getHistoricalRates({
instrument: 'eurusd',
dates: { from: '2020-03-30', to: '2020-03-31' },
timeframe: 'tick',
format: 'json'
});
Output
[
{
"timestamp": 1585526400104,
"askPrice": 1.11369,
"bidPrice": 1.11361,
"askVolume": 0.75,
"bidVolume": 0.75
},
{
"timestamp": 1585526400256,
"askPrice": 1.11371,
"bidPrice": 1.11361,
"askVolume": 0.94,
"bidVolume": 1.5
}
]

Full example: with-tick-data.output.json. Timestamps have millisecond precision. priceType does not apply to ticks, since both prices are always included.

The s1 timeframe builds one-second candles from the same tick data. Use it when you need fine-grained OHLC data without handling raw ticks:

Terminal window
npx dukascopy-node -i btcusd -from 2024-03-01T12:00Z -to 2024-03-01T13:00Z -t s1 -f csv

Tick data is big. Each hour of ticks is a separate request, so a month is around 720 requests and can produce hundreds of megabytes of output. A few things help:

  • Start small. Try an hour or a day first to check the output. Date ranges can include a time, for example -from 2024-03-01T12:00Z -to 2024-03-01T13:00Z (the Z keeps it in UTC).
  • Use the CLI for big ranges. It streams each batch to disk as it arrives, while getHistoricalRates returns the whole result in memory.
  • Slow down. Lower batchSize and raise pauseBetweenBatchesMs to reduce the load on Dukascopy and avoid rate limits. See batching and rate limits.
  • Cache. With the cache enabled, the CLI saves every completed batch, so an interrupted download resumes quickly on the next run.
  • Retry. Add retryCount so a single failed hour does not stop the whole download.
Terminal window
npx dukascopy-node -i eurusd -from 2024-01-01 -to 2024-02-01 -t tick -f csv \
--batch-size 5 --batch-pause 2000 --retries 3 --cache

When does tick data start?

Every instrument page lists the earliest available ticks. For EUR/USD they start on May 4, 2003.