Leo4815162342 / dukascopy-node

✨ Download historical price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨
https://dukascopy-node.app
MIT License
365 stars 68 forks source link

Downloading other timeframes (h2,h3) caused error #137

Open bromoapp opened 1 year ago

bromoapp commented 1 year ago

Hi, I want to download 2h and 3h candle price data. but I got an error that the timeframe I requested was not matched to any of the allowed values.

When I go to the dukascopy website, I can export candle price to any timeframe I want. How to resolve this?

Thanks

Leo4815162342 commented 1 year ago

@bromoapp currently dukascopy-node does not support h2 and h3 resolutions (timeframes), it only suports h1. We might add those in the future.

bromoapp commented 1 year ago

Hi, I am a programmer basically... but not a nodejs programmer... I notice that there is a class called timeframe.ts under config folder.. my question is: can I add H2, and H3 into it and build it and make my requirement fulfill?

Leo4815162342 commented 1 year ago

@bromoapp there is a bit more to it, you'd need to do the actual aggregation as well: https://github.com/Leo4815162342/dukascopy-node/blob/master/src/aggregator/index.ts

You can kick off the PR by adding these timeframes to that class/enum and I'll help you finalise the rest