Closed groschovskiy closed 7 months ago
I second this. I tried to download the data for forextester.com. Could not load it in dues to the date format.
@acutedeveloper can you share the example of the price format you'd like to be added?
@groschovskiy @acutedeveloper
I've released an experimental support for formatting dates (version1.37.0-beta.0
):
npm install dukascopy-node@1.37.0-beta.0
It now accepts --date-format
option in which you can specify the date-time format. It uses dayjs formatting under the hood, you can view all available formats here: https://day.js.org/docs/en/display/format#list-of-all-available-formats
npx dukascopy-node -i eurusd -from 2024-02-26 -to 2024-02-27 -t m1 --date-format "YYYY-MM-DD HH:mm:ss" -f csv
which outputs the following content:
timestamp,open,high,low,close
2024-02-26 00:00:00,1.08188,1.08202,1.08186,1.08196
2024-02-26 00:01:00,1.08196,1.08198,1.08191,1.08191
2024-02-26 00:02:00,1.08191,1.08194,1.08185,1.08186
2024-02-26 00:03:00,1.08187,1.08191,1.08186,1.08186
Additionally you can pass iso
as a value to --date-format
option which will convert timestamo into a ISO based date string:
npx dukascopy-node -i eurusd -from 2024-02-26 -to 2024-02-27 -t m1 --date-format iso -f csv
output:
timestamp,open,high,low,close
2024-02-26T00:00:00.000Z,1.08188,1.08202,1.08186,1.08196
2024-02-26T00:01:00.000Z,1.08196,1.08198,1.08191,1.08191
2024-02-26T00:02:00.000Z,1.08191,1.08194,1.08185,1.08186
2024-02-26T00:03:00.000Z,1.08187,1.08191,1.08186,1.08186
stable support for custom date formatting is now available in 1.37.0
. Docs: https://www.dukascopy-node.app/custom-date-format-and-timezone-conversion
Some backtesting framework not support timestamp and would be awesome to add ability to save dtformat=('%Y-%m-%d %H:%M:%S') for common backtesting software