DheerajAgarwal / rgdax

Wrapper for Coinbase pro (erstwhile GDAX) Cryptocurrency exchange
Other
34 stars 16 forks source link

public_candles() error in timing inputs #13

Closed erickwy closed 3 years ago

erickwy commented 3 years ago

I am trying to collect some historical bitcoin daily data via Coinbase API using 'rgdax' package's "public_candles" command. Thus, I tried the following:

public_candles(product_id = "BTC-USD", start = 2018-01-01, end = 2018-02-01,granularity = 86400)

However, I keep on getting errors as such:

Error in parse_response(path = req.url, query = list(start = start, end = end, : start must be before end

I tried many different permutations of dates but even though the start date is definitely before the end date, I keep getting this same error unfortunately.

May I kindly ask for this help ASAP please?

DheerajAgarwal commented 3 years ago

I am not on a computer right now but on the face of it your date looks to be in the right format. Can you try putting in quotes and let me know. I will look at the code and test it out as soon as I can.

On Mon, 1 Feb 2021 at 8:07 pm, erickwy notifications@github.com wrote:

I am trying to collect some historical bitcoin daily data via Coinbase API using 'rgdax' package's "public_candles" command. Thus, I tried the following:

public_candles(product_id = "BTC-USD", start = 2018-01-01, end = 2018-02-01,granularity = 86400)

However, I keep on getting errors as such:

Error in parse_response(path = req.url, query = list(start = start, end = end, : start must be before end

I tried many different permutations of dates but even though the start date is definitely before the end date, I keep getting this same error unfortunately.

May I kindly ask for this help ASAP please?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DheerajAgarwal/rgdax/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDD4AONHZHUXPOG3CICFD3S4ZVNLANCNFSM4W4NGLBA .

-- Dheeraj Agarwal Sent from my iPhone

erickwy commented 3 years ago

Thanks for confirming. Yes I do also believe my dates are in correct format. What I really do not understand are the errors I am getting as below:

Error in parse_response(path = req.url, query = list(start = start, end = end, : start must be before end

This problem happens whichever dates I input unless I put them as blanks. Many thanks again.

DheerajAgarwal commented 3 years ago

This response message is coming directly from Coinbase . My code does not handle or check for this scenario. I will look into it tomorrow hopefully and get back to you asap.

On Mon, 1 Feb 2021 at 9:40 pm, erickwy notifications@github.com wrote:

Thanks for confirming. Yes I do also believe my dates are in correct format. What I really do not understand are the errors I am getting as below:

Error in parse_response(path = req.url, query = list(start = start, end = end, : start must be before end

Many thanks again.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-770757820, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDD4ALDOBORUYT2VPEBC7LS42AJ5ANCNFSM4W4NGLBA .

-- Dheeraj Agarwal Sent from my iPhone

erickwy commented 3 years ago

Thanks. Looking forward to hearing from you.

DheerajAgarwal commented 3 years ago

Based on the latest documentation on coinbase, there is no change in the API params. I was able to replicate the issue and the code works as well with a slight modification. Below is what I tried

public_candles(start = "2018-01-01" , end = "2018-02-01" , granularity = 86400)

The only difference is the date being in quotation. I will update the documentation to reflect the same and may be add an example.

Here is what my result looks like

 time    low   high   open  close    volume
32 2018-01-01 217.66 232.29 227.18 225.22  258044.0
31 2018-01-02 225.21 262.00 225.22 253.31  732904.0
30 2018-01-03 240.56 258.54 253.30 244.99  456949.1
29 2018-01-04 226.79 245.00 244.99 238.91  534974.9
28 2018-01-05 236.24 251.97 238.91 246.23  505568.3
27 2018-01-06 245.00 304.00 246.23 279.42  915363.2
26 2018-01-07 265.24 286.95 279.42 272.06  383044.0
25 2018-01-08 231.42 273.77 272.13 255.21  590692.6
24 2018-01-09 238.75 258.75 255.21 246.89  405246.7
23 2018-01-10 232.51 249.67 246.90 248.81  458501.9
22 2018-01-11 219.07 253.42 248.82 226.91  614793.4
21 2018-01-12 220.20 241.99 226.91 235.52  333942.0
20 2018-01-13 235.51 263.00 235.52 258.00  388832.4
19 2018-01-14 233.82 268.00 258.01 237.89  382712.6
18 2018-01-15 231.11 244.20 237.89 232.51  214971.7
17 2018-01-16 146.60 233.23 232.51 191.13 1433426.1
16 2018-01-17 135.00 216.00 191.13 189.00 1688826.1
15 2018-01-18 176.31 211.00 189.00 192.60  828745.1
14 2018-01-19 187.10 203.00 192.59 192.50  406267.1
13 2018-01-20 192.50 214.88 192.50 210.91  367598.1
12 2018-01-21 183.12 211.09 210.91 191.25  350699.1
11 2018-01-22 165.50 194.70 191.25 179.42  457260.8
10 2018-01-23 165.01 186.03 179.43 178.27  358927.1
9  2018-01-24 172.23 184.69 178.27 180.60  263765.9
8  2018-01-25 175.00 184.80 180.59 178.86  231200.6
7  2018-01-26 166.15 181.71 178.86 175.71  272640.8
6  2018-01-27 173.96 182.00 175.71 179.65  174090.4
5  2018-01-28 178.65 192.47 179.65 191.12  229183.0
4  2018-01-29 175.56 191.12 191.12 179.57  211220.3
3  2018-01-30 158.20 179.90 179.57 164.25  405258.9
2  2018-01-31 155.00 166.50 164.24 161.90  326536.7
1  2018-02-01 125.00 164.90 161.90 140.60  809943.9
erickwy commented 3 years ago

Thank you so much. It works well for me now.

erickwy commented 3 years ago

May I know whether the volume output is in USD or BTC please?

erickwy commented 3 years ago

Thank you.

May I know whether the volume output is in USD or BTC please?


From: Dheeraj Agarwal notifications@github.com Sent: 03 February 2021 09:55 To: DheerajAgarwal/rgdax rgdax@noreply.github.com Cc: erickwy erickwy@hotmail.com; Author author@noreply.github.com Subject: Re: [DheerajAgarwal/rgdax] public_candles() error in timing inputs (#13)

Based on the latest documentation on coinbase, there is no change in the API params. I was able to replicate the issue and the code works as well with a slight modification. Below is what I tried

public_candles(start = "2018-01-01" , end = "2018-02-01" , granularity = 86400)

The only difference is the date being in quotation. I will update the documentation to reflect the same and may be add an example.

Here is what my result looks like

time low high open close volume 32 2018-01-01 217.66 232.29 227.18 225.22 258044.0 31 2018-01-02 225.21 262.00 225.22 253.31 732904.0 30 2018-01-03 240.56 258.54 253.30 244.99 456949.1 29 2018-01-04 226.79 245.00 244.99 238.91 534974.9 28 2018-01-05 236.24 251.97 238.91 246.23 505568.3 27 2018-01-06 245.00 304.00 246.23 279.42 915363.2 26 2018-01-07 265.24 286.95 279.42 272.06 383044.0 25 2018-01-08 231.42 273.77 272.13 255.21 590692.6 24 2018-01-09 238.75 258.75 255.21 246.89 405246.7 23 2018-01-10 232.51 249.67 246.90 248.81 458501.9 22 2018-01-11 219.07 253.42 248.82 226.91 614793.4 21 2018-01-12 220.20 241.99 226.91 235.52 333942.0 20 2018-01-13 235.51 263.00 235.52 258.00 388832.4 19 2018-01-14 233.82 268.00 258.01 237.89 382712.6 18 2018-01-15 231.11 244.20 237.89 232.51 214971.7 17 2018-01-16 146.60 233.23 232.51 191.13 1433426.1 16 2018-01-17 135.00 216.00 191.13 189.00 1688826.1 15 2018-01-18 176.31 211.00 189.00 192.60 828745.1 14 2018-01-19 187.10 203.00 192.59 192.50 406267.1 13 2018-01-20 192.50 214.88 192.50 210.91 367598.1 12 2018-01-21 183.12 211.09 210.91 191.25 350699.1 11 2018-01-22 165.50 194.70 191.25 179.42 457260.8 10 2018-01-23 165.01 186.03 179.43 178.27 358927.1 9 2018-01-24 172.23 184.69 178.27 180.60 263765.9 8 2018-01-25 175.00 184.80 180.59 178.86 231200.6 7 2018-01-26 166.15 181.71 178.86 175.71 272640.8 6 2018-01-27 173.96 182.00 175.71 179.65 174090.4 5 2018-01-28 178.65 192.47 179.65 191.12 229183.0 4 2018-01-29 175.56 191.12 191.12 179.57 211220.3 3 2018-01-30 158.20 179.90 179.57 164.25 405258.9 2 2018-01-31 155.00 166.50 164.24 161.90 326536.7 1 2018-02-01 125.00 164.90 161.90 140.60 809943.9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-772382203, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOGNMAMQD4B4FSTPQ5E6VN3S5EMS5ANCNFSM4W4NGLBA.

DheerajAgarwal commented 3 years ago

BTC in this case. FYI, this is not package driven. It is defined by the API owned by Coinbase.

On Wed, 3 Feb 2021 at 10:40 pm, erickwy notifications@github.com wrote:

May I know whether the volume output is in USD or BTC please?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-772445767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDD4AIOCQEQVVAOBDWWPXDS5EY2HANCNFSM4W4NGLBA .

-- Dheeraj Agarwal Sent from my iPhone

erickwy commented 3 years ago

Thank you for your clarification again.


From: Dheeraj Agarwal notifications@github.com Sent: Thursday, February 4, 2021 5:22:57 AM To: DheerajAgarwal/rgdax rgdax@noreply.github.com Cc: erickwy erickwy@hotmail.com; Author author@noreply.github.com Subject: Re: [DheerajAgarwal/rgdax] public_candles() error in timing inputs (#13)

BTC in this case. FYI, this is not package driven. It is defined by the API owned by Coinbase.

On Wed, 3 Feb 2021 at 10:40 pm, erickwy notifications@github.com wrote:

May I know whether the volume output is in USD or BTC please?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-772445767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDD4AIOCQEQVVAOBDWWPXDS5EY2HANCNFSM4W4NGLBA .

-- Dheeraj Agarwal Sent from my iPhone

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-772797311, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOGNMAPVC572EEVO3JUC2K3S5GWCDANCNFSM4W4NGLBA.

erickwy commented 3 years ago

Hello. I am trying to do the same historical data collection via Kraken exchange's API. May I know whether there is a codes/packages I can refer to for R platform? Thank you.

DheerajAgarwal commented 3 years ago

Sorry mate. I haven’t built or heard of any.

On Tue, 9 Feb 2021 at 1:38 pm, erickwy notifications@github.com wrote:

Hello. I am trying to do the same historical data collection via Kraken exchange's API. May I know whether there is a codes/packages I can refer to for R platform? Thank you.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/DheerajAgarwal/rgdax/issues/13#issuecomment-775613036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDD4AJ634WMXRSRUU7VJ5DS6CNZHANCNFSM4W4NGLBA .

-- Dheeraj Agarwal Sent from my iPhone

erickwy commented 3 years ago

That's ok. Thank you for your prompt reply.