Table of Contents

Fetch Historical Data

This page explains how to download historical data with fetch.js.

Basic commands

node ./bin/fetch.js --server Premium --symbol EURUSD --period M30
node ./bin/fetch.js --server Premium --symbols EURUSD GBPUSD --periods M15 M30 H1

Server and supported periods

Allowed server values:

Allowed period values:

Time zone and data length

Set time zone

Use time_zone (or –time-zone) to set hour offset relative to UTC. Fetcher applies this value as a timestamp shift before saving the downloaded dataset.

node ./bin/fetch.js --symbol EURUSD --period H1 --time-zone -4

Limit bars

Use max_data_bars (or –max-data-bars) to cut downloaded history.

node ./bin/fetch.js --symbol EURUSD --period M15 --max-data-bars 100000

Set to 0 to keep all available bars.

Smart refresh for automation

Use if_missing_or_older_than to avoid frequent downloads. This rule applies to historical data files only.

node ./bin/fetch.js --symbols EURUSD GBPUSD --period M15 --if-missing-or-older-than 60

Meaning:

Silent mode

Use silent mode for background scripts:

node ./bin/fetch.js --symbol EURUSD --period M30 --silent true

Errors are still printed.

Example INI profile

server = Premium
symbol = EURUSD GBPUSD
period = M15 M30
time_zone = 0
max_data_bars = 0
if_missing_or_older_than = 60
silent = false

Checklist