Code Monkey home page Code Monkey logo

Comments (3)

dekaidekai avatar dekaidekai commented on July 30, 2024 1

@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!

from dukascopy-node.

Leo4815162342 avatar Leo4815162342 commented on July 30, 2024

@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)

from dukascopy-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.