Order Levels

DMM-Bot leverages Hummingbot V2, wherein configurability has been considerably enhanced.
There are two ways to set order levels in V2 strategies: manually and using the Order Level Builder.
Manual Order Levels
Manual configuration of order levels allows for precise control over the trading strategy. Here's an example from the DMan-Composed script:
OrderLevel: Represents a specific configuration for an order. Higher levels (e.g., level 3) may denote larger or more aggressive orders compared to lower levels (e.g., level 1).side=TradeType: Dictates the type of the order: eitherBUYorSELL. This parameter defines the direction of the trade.order_amount_usd: Specifies the monetary value of the order in USD. Different levels can have varied order amounts, offering a tiered approach to market engagement and risk distribution.spread_factor: A multiplier that influences the order's placement price relative to the current market price. Higher spread factors typically result in orders placed further from the current price, possibly aiming to capitalize on predicted market movements.order_refresh_time: The duration (in seconds) after which the order is reassessed or replaced. This is particularly important in volatile markets, where conditions can shift swiftly.cooldown_time: A time interval (in seconds) that follows the execution of an order, during which no new orders at the same level are placed. This mechanism helps in mitigating overexposure in rapidly changing market scenarios.triple_barrier_conf: A PositionExecutor configuration thats manages orders after execution, like stop losses or take profits.
Order Level Builder
The Order Level Builder, a feature of Hummingbot's V2 strategies framework, streamlines the creation of order level distributions. By leveraging this class, users can efficiently define complex order arrangements.
For instance, the DMan-V3 script specifies arithmetic distribution of 5 order levels, starting at 50% of the Bollinger Band width and incrementing every 30%.
Here are the various distributions that you can create.
Linear Distribution
Defines a series of order levels with equal spacing between the start and end values.
n_levels: Total count of order levels.start: Spread for the initial order level.end: Spread for the final order level.

Summary:
Provides an evenly distributed set of order levels.
Ideal for strategies needing a consistent spread.
The midpoint of the distribution represents the breakeven price.
Arithmetic Distribution
Incrementally increases the spread of each order level by a fixed step from the starting value.
n_levels: Total number of order levels.start: Starting spread value.step: Incremental increase of the spread per level.

Summary:
Suitable for a gradual and predictable increase in order levels.
Ensures a fixed increment between the spreads of consecutive levels.
Geometric Distribution
Multiplies the spread of each order level by a constant ratio for exponential growth.
n_levels: Total number of order levels.start: Spread for the initial order level.ratio: Multiplier for the spread increase.

Summary:
Widens order level spacing, which may be beneficial in volatile markets.
Suitable for market making distributions
Logarithmic Distribution
Generates order levels with spreads that increase logarithmically.
n_levels: Total number of order levels.base: Base of the logarithm determining spread increase rate.scaling_factor: Adjusts spread differences between levels.start: Initial spread value.

Summary:
Ideal for strategies focused on mean reversion.
Allows for denser order placement away from the mid price, improving breakeven price as order levels are filled.
Last updated