Filled Order Delay

By default, Hummingbot places orders as soon as there are no active orders; i.e., Hummingbot immediately places a new order to replace a filled order. If there is a sustained movement in the market in any one direction for some time, there is a risk of continued trading in that direction: For example, continuing to buy and accumulate base tokens in the case of a prolonged downward move or continuing to sell in the case of a prolonged upward move.

The filled_order_delay parameter allows for a delay when placing a new order in the event of an order being filled, which will help mitigate the above scenarios.

How It Works

As an example, our buy and sell orders are created at exactly 00:00:00.

1
2
00:00:00 - (BTCUSDT) Creating 1 bid order at ['0.005 BTC, 9026.63 USDT']
00:00:00 - (BTCUSDT) Creating 1 ask order at ['0.005 BTC, 9072.081 USDT']
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Markets:                                                                 
  Exchange   Market  Best Bid Price  Best Ask Price  Mid Price
   binance  BTCUSDT         9071.79         9072.13    9071.9

Assets:                                                                 
                            BTC     USDT                                
   Total Balance           0.05      500                                
   Available Balance      0.045 454.8668                                
   Current Value (USDT) 453.598      500                                
   Current %              47.6%    52.4%                                

Orders:                                                                 
   Level  Type    Price Spread Amount (Orig)  Amount (Adj)       Age
       1  sell 9072.081  0.01%         0.005         0.005  00:00:01
       1   buy  9026.63  0.50%         0.005         0.005  00:00:01

When one order gets filled, it will wait for filled_order_delay before creating new sets of orders. The remaining order will be cancelled based on order refresh time. See examples in the next sections.

Filled order delay with shorter order refresh time

1
2
- order_refresh_time: 30.0
- filled_order_delay: 60.0

Let's say our sell order was filled at 00:00:10.

1
2
3
00:00:10 - (BTCUSDT) Maker sell order of 0.0050000 BTC filled.
00:00:10 - (BTCUSDT) Maker sell order (0.0050000 BTC @ 9072.0810000000 USDT)
                     has been completely filled.

The unfilled order will be cancelled after 30 seconds from the time it was created. Which means from 00:00:30 until 00:01:09 you won't see any active orders.

1
00:00:30 - (BTCUSDT) Cancelling the buy limit order
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Markets:                                                                 
  Exchange   Market  Best Bid Price  Best Ask Price  Mid Price
   binance  BTCUSDT         9073.91         9074.37    9074.14

Assets:                                                                  
                             BTC     USDT                                
   Total Balance           0.045 545.3783                                
   Available Balance       0.045 545.3783                                
   Current Value (USDT) 408.3363 545.3783                                
   Current %               42.8%    57.2%                                

No active maker orders.                                                  
1
2
00:01:10 - (BTCUSDT) Creating 1 bid order at ['0.005 BTC, 9047.709 USDT']
00:01:10 - (BTCUSDT) Creating 1 ask order at ['0.005 BTC, 9093.266 USDT']

Filled order delay with longer order refresh time

1
2
- order_refresh_time: 120.0
- filled_order_delay: 60.0

Using the same scenario, our sell order was filled at 00:00:10 and leaves the buy order active.

1
2
3
00:00:10 - (BTCUSDT) Maker sell order of 0.0050000 BTC filled.
00:00:10 - (BTCUSDT) Maker sell order (0.0050000 BTC @ 9072.0810000000 USDT)
                     has been completely filled.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
Markets:                                                                 
  Exchange   Market  Best Bid Price  Best Ask Price  Mid Price
   binance  BTCUSDT          9071.8         9072.83   9072.315

Assets:                                                                
                             BTC     USDT                              
   Total Balance           0.045 545.3604                              
   Available Balance       0.045 500.2273                              
   Current Value (USDT) 408.2542 545.3604                              
   Current %               42.8%    57.2%                              

Orders:                                                                
   Level Type   Price Spread Amount (Orig)  Amount (Adj)       Age
       1  buy 9026.63  0.50%         0.005         0.005  00:00:11

Notice the timestamps. Since the refresh time is longer than the filled order delay, the unfilled order will remain active until it's time to create new sets of orders.

1
00:01:09 - (BTCUSDT) Cancelling the buy limit order
1
2
00:01:10 - (BTCUSDT) Creating 1 bid order at ['0.005 BTC, 9047.709 USDT']
00:01:10 - (BTCUSDT) Creating 1 ask order at ['0.005 BTC, 9093.266 USDT']

Relevant Parameters

Parameter Prompt Definition
filled_order_delay How long do you want to wait before placing the next order if your order gets filled (in seconds)? How long to wait before placing the next set of orders in case at least one of your orders gets filled.