Skip to content

Position executor - cancels unfilled LIMIT entry order when time_limit is reached before a position opens #139

@rapcmia

Description

@rapcmia

Describe the bug

position_executor cancels an unfilled entry order when time_limit is reached, even though no position was ever opened.

Tested using sample position_executor payload below:

curl -sS -u admin:xxx http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
  {
    "account_name": "master_account",
    "executor_config": {
      "type": "position_executor",
      "connector_name": "architect_perpetual_sandbox",
      "trading_pair": "JPY-USD",
      "side": 1,
      "entry_price": "0.006301",
      "amount": "10000",
      "leverage": 1,
      "triple_barrier_config": {
        "stop_loss": "0.01",
        "take_profit": "0.0005",
        "time_limit": 60,
        "open_order_type": 2,
        "take_profit_order_type": 1,
        "stop_loss_order_type": 1,
        "time_limit_order_type": 1
      }
    }
  }' | jq
  • The entry order was placed on the exchange and visible ok
  • The order never filled
  • After 60s (time_limit), the executor terminated with close_type: TIME_LIMIT
  • The entry order was canceled even though no position had been opened.

Steps to reproduce bug

  1. Setup hummingbot-api on any connector
  2. Setup position executor and make sure the entry price is far from mid
    • Make time_limit: 60 then deploy it
    • Observed that executor will be TERMINATED with closeType.TIME_LIMIT which normally occurs when a position is opened on exchange
    • Entry price are normally canceled with early stop, insufficient or filled

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions