Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration to set Day Start Time #166

Open
dekaidekai opened this issue Feb 20, 2024 · 3 comments
Open

Configuration to set Day Start Time #166

dekaidekai opened this issue Feb 20, 2024 · 3 comments

Comments

@dekaidekai
Copy link

dekaidekai commented Feb 20, 2024

Would anyone know if this tool has the ability to configure the Day start time when downloading data?

as shown on their download tool on their website in the image below:
screenshot

I am looking to download dukas data in EET day start time format, instead of UTC, which I believe this tool does by default.

Setting the day start time will change how the candles open and close are formed, and what times they are split in.

for example:

UTC Day start time candles: 0:00, 4:00, 8:00, 12:00 ,etc.
EET Day start time candles: 2:00, 6:00, 10:00, 14:00, etc.

Thank you for the awesome tool!

@dekaidekai dekaidekai changed the title Configuration to set Day Time Start Configuration to set Day Start Time Feb 20, 2024
@Leo4815162342
Copy link
Owner

@dekaidekai
I've released an experimental support for formatting dates (--date-format) and option to convert them to a custom timezone (--time-zone), which is what essentially EET setting is doing.

Install new versoon:

npm install [email protected] 

Example:

npx dukascopy-node -i eurusd -from 2024-02-26 -to 2024-02-27 -t m1 --date-format "YYYY-MM-DD HH:mm:ss" --time-zone Europe/Kiev -f csv

which outputs:

timestamp,open,high,low,close
2024-02-26 02:00:00,1.08188,1.08202,1.08186,1.08196
2024-02-26 02:01:00,1.08196,1.08198,1.08191,1.08191
2024-02-26 02:02:00,1.08191,1.08194,1.08185,1.08186
2024-02-26 02:03:00,1.08187,1.08191,1.08186,1.08186

more info on --date-format: #156 (comment)

@dekaidekai
Copy link
Author

dekaidekai commented Feb 28, 2024

@Leo4815162342 Thank you so much for looking into this! 🙇

The setting --time-zone which you have added I believe will change the candle time representation into a different timezone. However Day Start Time in dukas is not just changing the timezone representation of candle, but instead a setting to change from what time candles start forming in the day, specifically in the 4H candle in which I'm looking for, from 0:00UTC or from 2:00UTC. Essentially it is forming the 4H candles now as all the action from 2:00UTC-6:00UTC instead of from 0:00UTC-4:00UTC, and so on. You can read up more on what it means here under the section Day Start Time.

For example, if I run the command:

npx dukascopy-node -i eurusd -from 2024-02-26 -to 2024-02-27 --time-zone UTC -t h4 -v true -fl true -f csv -r 1 --date-format "YYYY-MM-DD HH:mm:ss"

it outputs:

timestamp,open,high,low,close,volume
...
2024-02-26 16:00:00,1.08509,1.08555,1.08397,1.08462,27007.27
2024-02-26 20:00:00,1.08462,1.08525,1.08461,1.08503,19380.15

When you check the same candle data on the dukas online chart with Day start time setting set to GMT (UTC 0), and timezone set to UTC, as below in the image:

Screenshot 2024-02-28 at 5 15 30 PM

We can see that the OHLC of these candles are the same as outputted by dukascopy-node. (for example the 2024-02-26 20:00:00 OHLC are the same)

However, if I change the Day start time setting to EET (UTC + 2) in the chart (which is the version I want), with the candles still in timezone UTC, then we see the candles do not match anymore.
(below is the OHLC when I hover over 2024-02-26 22:00:00 candle)
Screenshot 2024-02-28 at 5 28 32 PM

Downloading the data instead in timezone Europe/Kiev with dukascopy-node as well does not give the matching candles I am looking for. As shown below, we see the OHLC of 2024-02-26 22:00:00 does also not match the chart with Day start time setting to EET (UTC + 2). It only changes the timezone and not the OHLC values.

npx dukascopy-node -i eurusd -from 2024-02-26 -to 2024-02-27 --time-zone Europe/Kiev -t h4 -v true -fl true -f csv -r 1 --date-format "YYYY-MM-DD HH:mm:ss"
timestamp,open,high,low,close,volume
...
2024-02-26 18:00:00,1.08509,1.08555,1.08397,1.08462,27007.27
2024-02-26 22:00:00,1.08462,1.08525,1.08461,1.08503,19380.15

Please let me know if you have any questions, thanks again!

@Leo4815162342
Copy link
Owner

@dekaidekai sorry for a delayed response and thanks for the detailed explanation.

Let me think how to properly integrate the required change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants