Configuration
How dukascopy-node options map between Node.js and the CLI, the supported timeframes, date formats and defaults.
dukascopy-node has one set of options with two spellings: camelCase properties for the Node.js API and flags for the CLI. This page maps them side by side. For details, see the CLI reference and the Node.js reference.
All options
Section titled “All options”Different defaults
The CLI and Node.js differ in two defaults: the CLI writes json and leaves volumes out unless
you pass -v, while Node.js returns array with volumes.
Timeframes
Section titled “Timeframes”| Timeframe | Output |
|---|---|
| tick | Every price change |
| s1 | 1-second candles |
| m1 | 1-minute candles |
| m5 | 5-minute candles |
| m15 | 15-minute candles |
| m30 | 30-minute candles |
| h1 | 1-hour candles |
| h4 | 4-hour candles |
| d1 | Daily candles |
| mn1 | Monthly candles |
Ticks have no open, high, low or close; see tick data.
Dates
Section titled “Dates”dates.from and dates.to (-from and -to in the CLI) accept:
| Input | Example |
|---|---|
| Date string | '2024-03-01' |
| Date-time with offset | '2024-03-01T09:30:00Z', '2024-03-01T09:30:00+02:00' |
Date object |
new Date('2024-03-01') |
| Unix timestamp (ms) | 1709251200000 |
now (CLI -to only) |
-to now |
The range includes from and excludes to. A from earlier than the instrument’s first available data is moved forward to it, and a to in the future is clamped to the current time. Every instrument page lists its earliest available data.