before this I successfully made a trading bot with the help of you guys -> How to keep the index of my pandas dataframe after normalazation. json
Now I try to use the ccxt library to connect my bot to other exchanges.
When i use the fetch openorder method I get a response that is I think a json inside a list. It works trough ccxt unified api. anyway. so I can print the list[{}, {}] like that. and I can print like the first order or the third, but not all the orders without the [].
I would like to end up with the exact same table as in the above linked forum topic.
here is some code I tried and the response.
openorders = coinbase.fetch_open_orders('BTC/EUR')
data = openorders[3]
print('openorders')
print(openorders)
print('data')
print(data)
pprint(data)
pprint(openorders)
output from ccxt :
[{'id': '7c754fdb-c6dd-44cb-9e99-e780052d6d62', 'clientOrderId': None, 'info': {'id': '7c754fdb-c6dd-44cb-9e99-e780052d6d62', 'price': '45971.00000000', 'size': '0.00100000', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:02.495824Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322282495, 'datetime': '2021-03-09T20:38:02.495Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'sell', 'price': 45971.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001, 'filled': 0.0, 'remaining': 0.001, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}, {'id': '9ed743a9-3364-4179-b3e2-936ba6b3d9c7', 'clientOrderId': None, 'info': {'id': '9ed743a9-3364-4179-b3e2-936ba6b3d9c7', 'price': '45997.00000000', 'size': '0.00100000', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:03.507036Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322283507, 'datetime': '2021-03-09T20:38:03.507Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'sell', 'price': 45997.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001, 'filled': 0.0, 'remaining': 0.001, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}, {'id': 'abe9d82f-1d5b-4c00-83b7-664cfda76ac8', 'clientOrderId': None, 'info': {'id': 'abe9d82f-1d5b-4c00-83b7-664cfda76ac8', 'price': '46023.00000000', 'size': '0.00100000', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:04.738401Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322284738, 'datetime': '2021-03-09T20:38:04.738Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'sell', 'price': 46023.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001, 'filled': 0.0, 'remaining': 0.001, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}, {'id': '69c18563-e862-493e-af89-92984ad4ccdb', 'clientOrderId': None, 'info': {'id': '69c18563-e862-493e-af89-92984ad4ccdb', 'price': '45633.00000000', 'size': '0.00100600', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'buy', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:05.492519Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322285492, 'datetime': '2021-03-09T20:38:05.492Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'buy', 'price': 45633.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001006, 'filled': 0.0, 'remaining': 0.001006, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}, {'id': 'abf57e52-22b1-4f67-99ad-ccc0fe64f685', 'clientOrderId': None, 'info': {'id': 'abf57e52-22b1-4f67-99ad-ccc0fe64f685', 'price': '45607.00000000', 'size': '0.00100600', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'buy', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:06.48702Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322286487, 'datetime': '2021-03-09T20:38:06.487Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'buy', 'price': 45607.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001006, 'filled': 0.0, 'remaining': 0.001006, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}, {'id': '7681b8cf-ebd8-4666-b810-a951c2ea6a93', 'clientOrderId': None, 'info': {'id': '7681b8cf-ebd8-4666-b810-a951c2ea6a93', 'price': '45581.00000000', 'size': '0.00100600', 'product_id': 'BTC-EUR', 'profile_id': '0ef9a216-77ff-469f-a31b-b62393208a5e', 'side': 'buy', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': False, 'created_at': '2021-03-09T20:38:07.488203Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, 'timestamp': 1615322287488, 'datetime': '2021-03-09T20:38:07.488Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'BTC/EUR', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'buy', 'price': 45581.0, 'stopPrice': None, 'cost': 0.0, 'amount': 0.001006, 'filled': 0.0, 'remaining': 0.001006, 'fee': {'cost': 0.0, 'currency': 'EUR', 'rate': None}, 'average': None, 'trades': None}]
I would like to end up wit a table like in the link above.
ps. sorry somehow I can't get the response to print nicely in the forum ?