Updated as of
This feature enables the ping pong strategy, in which Hummingbot alternates buy and sell orders.
How It Works¶
By default, this parameter is set to
False. When enabled, after a filled order event on either side (buy/sell) it will only create orders on the opposite side on the next refresh.
For example, if your buy order is filled and the sell order was cancelled the bot will keep creating sell orders only until it gets filled.
Stopping the strategy using the
stop command breaks the current ping pong logic. Upon restarting the bot will initially create both buy and sell orders again assuming you have enough balance to place orders on each side.
Ping pong with single order level¶
The scenario below shows how ping pong balances trades when one side is filled.
- Buy order b1 and sell order s1 are created
- b1 gets filled and s1 is cancelled when not filled
- Sell order s2 is created
- s2 gets filled
- Buy order b3 and sell order s3 are created
Notice that the buy order b2 was not created in an attempt to offset the previous trade.
Ping pong with multiple order levels¶
Let's say initially we have 2 orders on each side, buy orders b1, b2, and sell orders s1, s2.
- b1 gets filled and b2, s1, s2 are cancelled when not filled
- Buy order b3 and sell orders s3, s4 are created
- s3 gets filled and b3, s4 are cancelled when not filled
- Buy order b4 and sell order s5 are created
- s5 gets filled and b4 is cancelled when not filled
- Buy order b5 is created
- b5 gets filled
- Buy orders b6, b7 and sell orders s6, s7 are created
||Whether to alternate between buys and sells.|