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
350 stars 66 forks source link

unable to download #180

Closed WeskerC closed 3 months ago

WeskerC commented 3 months ago

Hi, Leo

I am using the CLI version of command.

when running the following command:

npx dukascopy-node -i eurusd -from 2019-06-01 -to 2019-07-01 -t m1

it will prompt " request to https://datafeed.dukascopy.com/datafeed/EURUSD/2019/05/10/BID_candles_min_1.bi5 failed, reason: connect ETIMEDOUT "

I don't know how to deal with it.

ps: I am able to visit the link mentioned above but it will only give me a 0kb bi5 file. TT

Leo4815162342 commented 3 months ago

Hi @WeskerC

this could be rate-limiting enforced by dukascopy datafeed servers, which we do not have control over. However, you can try enabling the retry mechanism with some generous retry pause:

npx dukascopy-node -i eurusd -from 2019-06-01 -to 2019-07-01 -t m1 --retries 15 --retry-pause 3000 

docs on errors and retry mechanism: https://www.dukascopy-node.app/errors-and-empty-data


additionally, you can also enable caching to speed up consequent downloads for same/overlapping periods:

npx dukascopy-node -i eurusd -from 2019-06-01 -to 2019-07-01 -t m1 --retries 15 --retry-pause 3000 --cache

docs on using cache: https://www.dukascopy-node.app/using-cache

WeskerC commented 3 months ago

@Leo4815162342 Thank you Leo for your instant reply and your time! I checked the internet and realized that the website is blocked by my local ISP. If I use a proxied browser to access the .bi5 link it will download accordingly. I tried to set HTTP proxy server and HTTP proxy server in cmd (I am using Windows 11) but still cannot download the file using npx running in cmd. Is there anything I missed? I am new to nodejs, I only know that I can use it in cmd. Thank you for your time again!

WeskerC commented 3 months ago

@Leo4815162342 Hi Leo, I tried to use Proxifier to route the cmd and it works. Still, if I can set proxy in the npx itself would be better~ I would consider this issue solved and thank you for your time and support, wish you all the best