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

[Updaters] Handle closed markets #37

Open
Herklos opened this issue Dec 30, 2019 · 0 comments
Open

[Updaters] Handle closed markets #37

Herklos opened this issue Dec 30, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@Herklos
Copy link
Member

Herklos commented Dec 30, 2019

From Drakkar-Software/OctoBot#986

Description was :
Idea: when InvalidOrder ccxt exception with "Market is closed" => stop watching this pair.
I suggest implementing this feature in 0.4.

error messsage on closed markets:

2019-10-11 16:30:02,486 ERROR RESTExchange[binance] Failed to create order : binance {"code":-1013,"msg":"Market is closed."} (order_type: TraderOrderType.SELL_LIMIT, symbol: PAX/ETH, quantity: 15.0, price: 0.00913642, stop_price: None)
2019-10-11 16:30:02,487 ERROR RESTExchange[binance] binance {"code":-1013,"msg":"Market is closed."}
Traceback (most recent call last):
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/exchanges/rest_exchanges/rest_exchange.py", line 220, in create_order
created_order = await self._create_specific_order(order_type, symbol, quantity, price)
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/exchanges/rest_exchanges/rest_exchange.py", line 254, in _create_specific_order
created_order = await self.client.create_limit_sell_order(symbol, quantity, price)
File "/home/doct0r/.local/lib/python3.7/site-packages/ccxt/async_support/binance.py", line 706, in create_order
response = await getattr(self, method)(self.extend(request, params))
File "/home/doct0r/.local/lib/python3.7/site-packages/ccxt/async_support/binance.py", line 1223, in request
response = await self.fetch2(path, api, method, params, headers, body)
File "/home/doct0r/.local/lib/python3.7/site-packages/ccxt/async_support/base/exchange.py", line 117, in fetch2
return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "/home/doct0r/.local/lib/python3.7/site-packages/ccxt/async_support/base/exchange.py", line 168, in fetch
self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response)
File "/home/doct0r/.local/lib/python3.7/site-packages/ccxt/async_support/binance.py", line 1216, in handle_errors
raise exceptions[error](self.id + ' ' + body)
ccxt.base.errors.InvalidOrder: binance {"code":-1013,"msg":"Market is closed."}
2019-10-11 16:30:02,488 INFO Trader[binance] Created order on binance: None
2019-10-11 16:30:02,489 ERROR DailyTradingModeCreator Failed to create order : 'NoneType' object is not subscriptable. Order: PAX/ETH | SELL_LIMIT | Price : 0.00913642 | Quantity : 15.0 | Status : OPEN
2019-10-11 16:30:02,489 ERROR DailyTradingModeCreator 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/tentacles/Trading/Mode/Default/daily_trading_mode.py", line 276, in create_new_order
updated_limit = await trader.create_order(current_order, portfolio)
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/trader/trader.py", line 196, in create_order
new_order = await self._create_not_loaded_order(order, new_order, portfolio)
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/trader/trader.py", line 243, in _create_not_loaded_order
new_order = self.parse_exchange_order_to_order_instance(created_order)
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/trader/trader.py", line 482, in parse_exchange_order_to_order_instance
return self.create_order_instance(order_type=self.parse_order_type(order),
File "/home/doct0r/Desktop/Multi-Octo/Me/Mining/trading/trader/trader.py", line 533, in parse_order_type
side = TradeOrderSide(order["side"])
TypeError: 'NoneType' object is not subscriptable

@Herklos Herklos added the enhancement New feature or request label Dec 30, 2019
@Herklos Herklos changed the title Handle closed markets [Updaters] Handle closed markets Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant