Config (Node.js)
Config object:
Property | Type | Default | Description |
---|---|---|---|
instrument | String | An id of the trading instrument. Supported values: view list | |
dates | Object | An object with a date range | |
dates.from |
| Date representing the start of the time range. Can be of Date type, string (e.g. 2021-03-04 or 2021-03-04T00:00:00.000Z ), or timestamp integer (e.g. 1614816000000 ) | |
dates.to |
| Date representing the end of the time range Can be of Date type, string (e.g. 2021-03-04 or 2021-03-04T00:00:00.000Z ), or timestamp integer (e.g. 1614816000000 ) | |
timeframe | String | d1 | Granularity of aggregation of OHLC (open, high, low, close) data. Supported values:
|
priceType | String | bid | Type of price (offer side). Supported values: bid , ask |
format | String | array | Format of the generated output. Supported values: array , json , csv . View output examples |
utcOffset | Number | 0 | UTC offset in minutes. |
volumes | Boolean | true | A flag indicating whether the output should contain volume data |
volumeUnits | String | millions | Volume units. Supported values: millions ,thousands ,units . |
ignoreFlats | Boolean | true | A flag indicating whether the output should contain timeframe entries with 0 (flat) volume. Those mainly come from non-trading days, such as weekends or bank holidays. |
batchSize | Number | 10 | Number of requests sent to data storage per batch. We don't want to send bunch of requests at the same time, we want to split them in groups (batches) and fetch them one by one with pause in between (see pauseBetweenBatchesMs ). Main purpose - not to fall under rate limiting restrictions. |
pauseBetweenBatchesMs | Number | 1000 | Pause between downloading batches (in milliseconds). |
useCache | Boolean | false | A flag indicating whether a file-system cache is going to be used to store response artifacts for subsequent lookups. When set to true , it significantly speeds up calls when requesting overlapping or similar data |
cacheFolderPath | String | ./.dukascopy-cache | Folder path where all cache artifacts (binary data) will be stored |
retryCount | Number | 0 | Number of retries for a failed artifact download. If 0 no retries will happen even for failed requests. |
retryOnEmpty | Boolean | false | A flag indicating whether requests with successful but empty (0 Bytes) responses should be retried. If retryCount is 0 this parameter will be ignored |
failAfterRetryCount | Boolean | true | A flag indicating whether the process should fail after all retries have been exhausted. If retryCount is 0 this parameter will be ignored. |
pauseBetweenRetriesMs | Number | 500 | Pause between retries. If retryCount is 0 this parameter will be ignored |
Full config object example:
{
instrument: 'btcusd',
dates: {
from: '2018-01-01', // or 2018-01-01T00:00:00.000Z
to: '2019-01-01', // or 2019-01-01T00:00:00.000Z
},
timeframe: 'd1',
priceType: 'ask',
format: 'json',
utcOffset: 0,
volumes: true,
volumeUnits: 'millions',
ignoreFlats: true,
batchSize: 10,
pauseBetweenBatchesMs: 1000,
useCache: true,
cacheFolderPath: '.dukascopy-cache',
retryCount: 5,
pauseBetweenRetriesMs: 250
}