hummingbot / hummingbot

Open source software that helps you create and deploy high-frequency crypto trading bots
https://hummingbot.org
Apache License 2.0
8.18k stars 2.82k forks source link

kucoin perpetual - unable to trade using dman_v4 #6770

Closed nikspz closed 6 months ago

nikspz commented 9 months ago

Describe the bug

Unable to use D-man v4 (v2_market-making_dman_v4_multiple_pairs.py script) using kucoin perpetual.

  1. Bot placed one side (for example buy) orders to OPEN position, get filled
  2. then another (sell) order to OPEN filled, and instead of OPEN another position on exchange, bot closes 1. position with that.
  3. history --verbose reported 2 orders to OPEN was filled,
  4. status reported ACTIVE POSITION
  5. exchange showing no position opened
  6. after bot triggered to CLOSE position it stuck with OSError: Error submitting order HummingbotBCEUT60ebf137168fd839420bf096a: ret_code <300009> - No open positions to close.

Steps to reproduce

  1. Clone and install latest dev branch
  2. connect kucoin perpetual
  3. (change exchange to kucoin_perpetual, pair, order levels and amount), candles exchange is default (candles_exchange = "binance_perpetual")
  4. and start v2_market-making_dman_v4_multiple_pairs.py script
  5. wait for 2 position OPEN

Actual: history --verbose reported 2 orders to OPEN was filled,

  1. status reported ACTIVE POSITION
  2. exchange showing no position opened
  3. after bot triggered to CLOSE position it stuck with OSError: Error submitting order HummingbotBCEUT60ebf137168fd839420bf096a: ret_code <300009> - No open positions to close.

Release version

dev-1.24.0

Type of installation

Source

Attach required files

logs_dman4kucoinperp3.log kucoin-dmanv4.zip

2024-01-12 12:31:41,243 - 369352 - hummingbot.client.hummingbot_application - INFO - Creating the clock with tick size: 1.0
2024-01-12 12:31:41,252 - 369352 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2024-01-12 12:31:41,644 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-01-12 12:31:41,853 - 369352 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for CAKE-USDT. 1/1 completed.
2024-01-12 12:31:42,001 - 369352 - hummingbot.strategy.script_strategy_base - WARNING - kucoin_perpetual is not ready. Please wait...
2024-01-12 12:31:42,073 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_api_user_stream_data_source.KucoinPerpetualAPIUserStreamDataSource - INFO - Subscribed to private account and orders channels wss://stream.kucoin.com/realtime_private...
2024-01-12 12:31:42,211 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_api_order_book_data_source.KucoinPerpetualAPIOrderBookDataSource - INFO - Subscribed to public order book, trade and funding info channels...
2024-01-12 12:31:44,729 - 369352 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-01-12 12:31:45,005 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - ERROR - Position mode PositionMode.HEDGE is not supported. Mode not set.
2024-01-12 12:31:45,087 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - INFO - Leverage for CAKE-USDT successfully set to 20.
2024-01-12 12:31:45,154 - 369352 - hummingbot.data_feed.candles_feed.binance_perpetual_candles.binance_perpetual_candles - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2024-01-12 12:31:45,519 - 369352 - hummingbot.data_feed.candles_feed.binance_perpetual_candles.binance_perpetual_candles - INFO - Subscribed to public klines...
2024-01-12 12:31:46,109 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: 3.063087259999999867836119774 amount: 2.611744074179591065642129634.
2024-01-12 12:31:46,110 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,110 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT sell order: price: 3.064312739999999867841982523 amount: 2.610699585447665614256096276.
2024-01-12 12:31:46,110 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,111 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: 3.002425999999999869206748771 amount: 3.996767946986870125275451983.
2024-01-12 12:31:46,111 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,111 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT sell order: price: 3.124973999999999866471353526 amount: 3.840031949065816391673744670.
2024-01-12 12:31:46,112 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,112 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: 2.941151999999999870574446392 amount: 6.120050918823644882036351157.
2024-01-12 12:31:46,112 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,113 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT sell order: price: 3.186247999999999865103655904 amount: 5.649277771221826035533617634.
2024-01-12 12:31:46,113 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:31:46,209 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT SELL order HummingbotSCEUT60ebed8eae1bf839420bf096a for 2.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,209 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,234 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "2.0", "price": "3.0643", "order_id": "HummingbotSCEUT60ebed8eae1bf839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224212443139", "leverage": 20, "position": "OPEN", "event_name": "SellOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,235 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT BUY order HummingbotBCEUT60ebed8eae37a839420bf096a for 3.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,236 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,247 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "3.0", "price": "3.0024", "order_id": "HummingbotBCEUT60ebed8eae37a839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224208281601", "leverage": 20, "position": "OPEN", "event_name": "BuyOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,248 - 369352 - hummingbot.connector.client_order_tracker - INFO - The BUY order HummingbotBCEUT60ebed8eadd65839420bf096a amounting to 2.0/2.0 CAKE has been filled.
2024-01-12 12:31:46,331 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "order_id": "HummingbotBCEUT60ebed8eadd65839420bf096a", "trading_pair": "CAKE-USDT", "trade_type": "TradeType.BUY", "order_type": "OrderType.LIMIT", "price": "3.0624", "amount": "2.0", "trade_fee": {"percent": "0.0006", "percent_token": "USDT", "flat_fees": []}, "exchange_trade_id": "1699187081046", "exchange_order_id": "135264224229199874", "leverage": 20, "position": "OPEN", "event_name": "OrderFilledEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,332 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT SELL order HummingbotSCEUT60ebed8eae5cc839420bf096a for 3.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,333 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,341 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "3.0", "price": "3.1249", "order_id": "HummingbotSCEUT60ebed8eae5cc839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224229220353", "leverage": 20, "position": "OPEN", "event_name": "SellOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,342 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT BUY order HummingbotBCEUT60ebed8eae886839420bf096a for 6.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,343 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,355 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "6.0", "price": "2.9411", "order_id": "HummingbotBCEUT60ebed8eae886839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224233472000", "leverage": 20, "position": "OPEN", "event_name": "BuyOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,356 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT SELL order HummingbotSCEUT60ebed8eaeb14839420bf096a for 5.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,356 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,397 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "5.0", "price": "3.1862", "order_id": "HummingbotSCEUT60ebed8eaeb14839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224225021955", "leverage": 20, "position": "OPEN", "event_name": "SellOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,398 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT BUY order HummingbotBCEUT60ebed8eadd65839420bf096a for 2.0 to OPEN a CAKE-USDT position.
2024-01-12 12:31:46,398 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:31:46,410 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "2.0", "price": "3.0630", "order_id": "HummingbotBCEUT60ebed8eadd65839420bf096a", "creation_timestamp": 1705062706.0, "exchange_order_id": "135264224229199874", "leverage": 20, "position": "OPEN", "event_name": "BuyOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,411 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Completed
2024-01-12 12:31:46,422 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062706.0, "order_id": "HummingbotBCEUT60ebed8eadd65839420bf096a", "base_asset": "CAKE", "quote_asset": "USDT", "base_asset_amount": "2.0", "quote_asset_amount": "6.12480", "order_type": "OrderType.LIMIT", "exchange_order_id": "135264224229199874", "event_name": "BuyOrderCompletedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:31:46,422 - 369352 - hummingbot.connector.client_order_tracker - INFO - BUY order HummingbotBCEUT60ebed8eadd65839420bf096a completely filled.
2024-01-12 12:32:46,471 - 369352 - hummingbot.strategy.script_strategy_base - INFO - (CAKE-USDT) Canceling the limit order HummingbotSCEUT60ebed8eae1bf839420bf096a. [clock=2024-01-12 12:32:46+00:00]
2024-01-12 12:32:46,588 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062766.0, "order_id": "HummingbotSCEUT60ebed8eae1bf839420bf096a", "exchange_order_id": "135264224212443139", "event_name": "OrderCancelledEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:32:46,588 - 369352 - hummingbot.connector.client_order_tracker - INFO - Successfully canceled order HummingbotSCEUT60ebed8eae1bf839420bf096a.
2024-01-12 12:32:48,522 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT sell order: price: 3.059511779999999952413432990 amount: 2.614796273149175495061887969.
2024-01-12 12:32:48,523 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing open order
2024-01-12 12:32:48,636 - 369352 - hummingbot.connector.client_order_tracker - INFO - Created LIMIT SELL order HummingbotSCEUT60ebedca33747839420bf096a for 2.0 to OPEN a CAKE-USDT position.
2024-01-12 12:32:48,636 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Created
2024-01-12 12:32:48,649 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062768.0, "type": "OrderType.LIMIT", "trading_pair": "CAKE-USDT", "amount": "2.0", "price": "3.0595", "order_id": "HummingbotSCEUT60ebedca33747839420bf096a", "creation_timestamp": 1705062768.0, "exchange_order_id": "135264485953781760", "leverage": 20, "position": "OPEN", "event_name": "SellOrderCreatedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:32:55,397 - 369352 - hummingbot.connector.client_order_tracker - INFO - The SELL order HummingbotSCEUT60ebedca33747839420bf096a amounting to 2.0/2.0 CAKE has been filled.
2024-01-12 12:32:55,419 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062775.0, "order_id": "HummingbotSCEUT60ebedca33747839420bf096a", "trading_pair": "CAKE-USDT", "trade_type": "TradeType.SELL", "order_type": "OrderType.LIMIT", "price": "3.0595", "amount": "2.0", "trade_fee": {"percent": "0.0002", "percent_token": "USDT", "flat_fees": []}, "exchange_trade_id": "1699187081471", "exchange_order_id": "135264485953781760", "leverage": 20, "position": "OPEN", "event_name": "OrderFilledEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:32:55,420 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Open Order Completed
2024-01-12 12:32:55,430 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705062775.0, "order_id": "HummingbotSCEUT60ebedca33747839420bf096a", "base_asset": "CAKE", "quote_asset": "USDT", "base_asset_amount": "2.0", "quote_asset_amount": "6.11900", "order_type": "OrderType.LIMIT", "exchange_order_id": "135264485953781760", "event_name": "SellOrderCompletedEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:32:55,430 - 369352 - hummingbot.connector.client_order_tracker - INFO - SELL order HummingbotSCEUT60ebedca33747839420bf096a completely filled.
2024-01-12 12:47:55,909 - 369352 - hummingbot.smart_components.strategy_frameworks.market_making.market_making_executor_handler - INFO - Global Trailing Stop Activated!
2024-01-12 12:48:08,004 - 369352 - hummingbot.smart_components.strategy_frameworks.market_making.market_making_executor_handler - INFO - Global Trailing Stop Triggered!
2024-01-12 12:48:08,004 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: NaN amount: 2.0.
2024-01-12 12:48:08,006 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing close order --> Filled amount: 2.0 | TP Partial execution: 0
2024-01-12 12:48:08,383 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - NETWORK - Error submitting buy MARKET order to Kucoin_perpetual for 2.0 CAKE-USDT NaN.
Traceback (most recent call last):
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
    await self._place_order_and_process_update(order=order, **kwargs,)
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
    exchange_order_id, update_timestamp = await self._place_order(
  File "/home/nikita/development1/hummingbot/connector/derivative/kucoin_perpetual/kucoin_perpetual_derivative.py", line 225, in _place_order
    raise IOError(f"Error submitting order {order_id}: {formatted_ret_code} - {resp['msg']}")
OSError: Error submitting order HummingbotBCEUT60ebf137168fd839420bf096a: ret_code <300009> - No open positions to close.
2024-01-12 12:48:08,423 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - WARNING - Failed to submit BUY order to Kucoin_perpetual. Check API key and network connection.
2024-01-12 12:48:08,425 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: NaN amount: 2.0.
2024-01-12 12:48:08,428 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing close order --> Filled amount: 2.0 | TP Partial execution: 0
2024-01-12 12:48:08,432 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705063688.0, "order_id": "HummingbotBCEUT60ebf137168fd839420bf096a", "order_type": "OrderType.MARKET", "event_name": "MarketOrderFailureEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:48:08,432 - 369352 - hummingbot.connector.client_order_tracker - INFO - Order HummingbotBCEUT60ebf137168fd839420bf096a has failed. Order Update: OrderUpdate(trading_pair='CAKE-USDT', update_timestamp=1705063688.0, new_state=<OrderState.FAILED: 6>, client_order_id='HummingbotBCEUT60ebf137168fd839420bf096a', exchange_order_id=None, misc_updates=None)
2024-01-12 12:48:08,560 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - NETWORK - Error submitting buy MARKET order to Kucoin_perpetual for 2.0 CAKE-USDT NaN.
Traceback (most recent call last):
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
    await self._place_order_and_process_update(order=order, **kwargs,)
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
    exchange_order_id, update_timestamp = await self._place_order(
  File "/home/nikita/development1/hummingbot/connector/derivative/kucoin_perpetual/kucoin_perpetual_derivative.py", line 225, in _place_order
    raise IOError(f"Error submitting order {order_id}: {formatted_ret_code} - {resp['msg']}")
OSError: Error submitting order HummingbotBCEUT60ebf1377dbe6839420bf096a: ret_code <300009> - No open positions to close.
2024-01-12 12:48:08,560 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - WARNING - Failed to submit BUY order to Kucoin_perpetual. Check API key and network connection.
2024-01-12 12:48:08,561 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: NaN amount: 2.0.
2024-01-12 12:48:08,562 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing close order --> Filled amount: 2.0 | TP Partial execution: 0
2024-01-12 12:48:08,565 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705063688.0, "order_id": "HummingbotBCEUT60ebf1377dbe6839420bf096a", "order_type": "OrderType.MARKET", "event_name": "MarketOrderFailureEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:48:08,565 - 369352 - hummingbot.connector.client_order_tracker - INFO - Order HummingbotBCEUT60ebf1377dbe6839420bf096a has failed. Order Update: OrderUpdate(trading_pair='CAKE-USDT', update_timestamp=1705063688.0, new_state=<OrderState.FAILED: 6>, client_order_id='HummingbotBCEUT60ebf1377dbe6839420bf096a', exchange_order_id=None, misc_updates=None)
2024-01-12 12:48:08,641 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - NETWORK - Error submitting buy MARKET order to Kucoin_perpetual for 2.0 CAKE-USDT NaN.
Traceback (most recent call last):
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
    await self._place_order_and_process_update(order=order, **kwargs,)
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
    exchange_order_id, update_timestamp = await self._place_order(
  File "/home/nikita/development1/hummingbot/connector/derivative/kucoin_perpetual/kucoin_perpetual_derivative.py", line 225, in _place_order
    raise IOError(f"Error submitting order {order_id}: {formatted_ret_code} - {resp['msg']}")
OSError: Error submitting order HummingbotBCEUT60ebf1379e6ec839420bf096a: ret_code <300009> - No open positions to close.
2024-01-12 12:48:08,642 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - WARNING - Failed to submit BUY order to Kucoin_perpetual. Check API key and network connection.
2024-01-12 12:48:08,643 - 369352 - hummingbot.strategy.script_strategy_base - INFO - Creating CAKE-USDT buy order: price: NaN amount: 2.0.
2024-01-12 12:48:08,644 - 369352 - hummingbot.smart_components.executors.position_executor.position_executor - INFO - Placing close order --> Filled amount: 2.0 | TP Partial execution: 0
2024-01-12 12:48:08,648 - 369352 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1705063688.0, "order_id": "HummingbotBCEUT60ebf1379e6ec839420bf096a", "order_type": "OrderType.MARKET", "event_name": "MarketOrderFailureEvent", "event_source": "kucoin_perpetual"}
2024-01-12 12:48:08,648 - 369352 - hummingbot.connector.client_order_tracker - INFO - Order HummingbotBCEUT60ebf1379e6ec839420bf096a has failed. Order Update: OrderUpdate(trading_pair='CAKE-USDT', update_timestamp=1705063688.0, new_state=<OrderState.FAILED: 6>, client_order_id='HummingbotBCEUT60ebf1379e6ec839420bf096a', exchange_order_id=None, misc_updates=None)
2024-01-12 12:48:08,746 - 369352 - hummingbot.connector.derivative.kucoin_perpetual.kucoin_perpetual_derivative.KucoinPerpetualDerivative - NETWORK - Error submitting buy MARKET order to Kucoin_perpetual for 2.0 CAKE-USDT NaN.
Traceback (most recent call last):
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 452, in _create_order
    await self._place_order_and_process_update(order=order, **kwargs,)
  File "/home/nikita/development1/hummingbot/connector/exchange_py_base.py", line 469, in _place_order_and_process_update
    exchange_order_id, update_timestamp = await self._place_order(
  File "/home/nikita/development1/hummingbot/connector/derivative/kucoin_perpetual/kucoin_perpetual_derivative.py", line 225, in _place_order
    raise IOError(f"Error submitting order {order_id}: {formatted_ret_code} - {resp['msg']}")
OSError: Error submitting order HummingbotBCEUT60ebf137b24f1839420bf096a: ret_code <300009> - No open positions to close.

kucoin perpetual - OPEN orders (closed with another level that tries to OPEN) kucoin perpetual - dmanv4 then bot tries to CLOSE order that not exist on exchange

rapcmia commented 9 months ago

Tried most of the scripts attached not able to reproduce. Therefore closing this ticket for now

nikspz commented 9 months ago

Reproduced on 1.24.0 Added steps to reproduce / actual