CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.22k stars 302 forks source link

TypeError: 'Order' object is not subscriptable #15

Closed PasKemp closed 2 years ago

PasKemp commented 3 years ago

I'm getting a TypeError from the 'Order' object wich is returned by Gate.io Api.

Traceback (most recent call last): File "E:/Entwicklung/binanceListingTradingbot/main.py", line 63, in main stored_price = float(order[coin]['price']) TypeError: 'Order' object is not subscriptable

nemethm95 commented 3 years ago

I got this error also.

PasKemp commented 3 years ago

I have fixed this with an other Object. I want to get my balance from Gate.io with the WalletApi. With that the 'Total_balance' Object returned. In the picture you can see how you get the amount of your spot balance. Unbenannt

But i didn't find a solution for the 'Order' Object yet.

rarrows commented 3 years ago

It was actually this error that came first for me. The non subscriptable error came after restarting the script. Something to do with the parsing of the coin symbols I assume.

New annoucement detected: TBLVKJIWJRPRJYQXXAIOVUSZIEVPXW Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/gate_api/api_client.py", line 190, in __call_api response_data = self.request( File "/usr/local/lib/python3.9/site-packages/gate_api/api_client.py", line 447, in request return self.rest_client.GET( File "/usr/local/lib/python3.9/site-packages/gate_api/rest.py", line 237, in GET return self.request( File "/usr/local/lib/python3.9/site-packages/gate_api/rest.py", line 232, in request

gate_api.exceptions.ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 22 Oct 2021 02:37:21 GMT', '......... HTTP response body: {"label":"INVALID_CURRENCY","message":"Invalid currency TBLVKJIWJRPRJYQXXAIOVUSZIEVPXW"}

yermakovant7 commented 3 years ago

Did you know that the "quantity" is not the amount in dollars but the price of the announced currency?