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

get_product_trades start/end time and limit not working as expected #414

Closed
Spotnag opened this issue Dec 30, 2020 · 2 comments · May be fixed by #422 or #427
Closed

get_product_trades start/end time and limit not working as expected #414

Spotnag opened this issue Dec 30, 2020 · 2 comments · May be fixed by #422 or #427

Comments

@Spotnag
Copy link

Spotnag commented Dec 30, 2020

Does not seem like start, end and limit are being taken into account.

start_time = datetime.datetime.strptime('2020-10-01 00:00:00', '%Y-%m-%d %H:%M:%S').isoformat()
end_time = datetime.datetime.strptime('2020-12-26 23:59:59', '%Y-%m-%d %H:%M:%S').isoformat()

data = public_client.get_product_trades(product_id='BTC-USD', limit=10, before=start_time, after=end_time)
df = pd.DataFrame(list(data)[:-1])
print(df)

result:

                          time   trade_id           price        size  side
0     2020-12-30T13:45:30.397Z  116922625  28026.04000000  0.17982618  sell
1     2020-12-30T13:45:30.397Z  116922624  28026.03000000  0.09812919  sell
2     2020-12-30T13:45:30.397Z  116922623  28023.83000000  0.06736100  sell
3     2020-12-30T13:45:30.397Z  116922622  28023.34000000  0.53000000  sell
4     2020-12-30T13:45:27.821Z  116922621  28025.85000000  0.00341548  sell
...
1095   2020-12-30T13:33:55.41Z  116921530  27909.44000000  1.50000000   buy
1096  2020-12-30T13:33:55.168Z  116921529  27913.91000000  0.30399159  sell
1097  2020-12-30T13:33:53.866Z  116921528  27917.00000000  0.34066266  sell
1098   2020-12-30T13:33:53.85Z  116921527  27917.05000000  0.04125719  sell
1099  2020-12-30T13:33:52.813Z  116921526  27916.88000000  0.00131930  sell
@smbrandonjr
Copy link

The get_trades request is paginated per the Coinbase Pro API documentation. https://docs.pro.coinbase.com/?r=1#get-product-order-book

Are you handling that?

tbm added a commit to tbm/coinbasepro-python that referenced this issue Feb 3, 2021
The parameters had no effect since they were never passed to
self._send_paginated_message()

Fixes danpaquin#414
@Spotnag Spotnag closed this as completed Feb 8, 2021
@Spotnag
Copy link
Author

Spotnag commented Feb 8, 2021

Yes sorry, it seems i wat not handling the pagination correctly. Thanks.

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