StepGridHybrid Spot Trading Strategy
This strategy borrows the grid logic from the stepgrid strategy and combines it with a trend monitor that constantly evaluates the market on 15m, 1h and 4h timeframes.
Besides offering a lot of options for customizations, stepgridhybrid has:
- 'trading modes' that control when to start and stop trading a pair
- the ability to keep track of how much unsold buy volume remains below the current price
- the ability to automatically skip grid steps, for example when price is dropping out of a recently traded range
- the ability to place additional orders based on trend triggers, next to grid orders
- the ability to be combined with manual trades on the same pair
Trading behavior​
In it's pure form, stepGridHybrid is basically like stepGrid with one difference: sell amounts are based on remaining buy volume below the current price. This means that it is possible to skip buy steps (either intentionally or by accident), as soon as trading resumes at a lower level it will not attempt to sell units bought at higher rates unless the overall break even price is reached.
The integrated trend module offers settings to influence trading behavior like:
- when it's allowed to open a new trade
- place additional buy orders during a pump
- skip buy steps when price action is negative
- increase sell target and sell trailing range when price action is positive
When you run stepgridhybrid
, this is the kind of trading behavior to expect:
Let's break down what actually happens:
- Most trades follow the exact same logic as the stepgrid strategy
- Sell amounts are not static, each sell order sells the remaining volume bought at lower prices * 'partial sell ratio'
- When price was moving downwards rapidly, several buy steps were skipped with the goal to spend the funds later
- When in no position, the trading bot will buy again when either the next buy or sell step is reached - as long as the current trading mode allows opening new trades at that time
Skipping steps​
The marked zones in the screenshot above are intentionally skipped buy steps. There are different triggers for skipping steps, some of them are settings configurable, some are hardcoded.
Non grid orders​
The marked zones in the screenshot above are examples of additional buy orders that were triggered by conditions detected in the trend module. Such orders do not move the then active grid targets.
Trading modes​
Settings for trading modes mainly define when to start and stop grid trading. By default the strategy runs in an unrestricted mode, allowing it to open a new trade anytime.
By using one of the available trading modes, opening new trades is restricted by the entry and exit criteria of the selected mode. Meaning that as soon as all assets have been sold, a new trade can only be opened when the mode allows for it.
Modes are meant to be used one at a time, enabling multiple modes on a single pair can lead to unexpected behavior.
Trading modes can be extremely restrictive. Sometimes there can be several weeks or more between two 'entry signals' detected on the same pair.
Manual trading range mode​
Manually set a price range in which new trades are allowed. Optionally a stop limit price can be used.
TA mode​
Starts trading when the entry conditions for one of a collection of TA fractals is detected, disallows opening new trades when one or more exit scenarios have been detected. Think of 'fractals' as an attempt to detect a variety of bullish reversal patterns.
This mode includes an optional stop loss trigger.
Volatility mode​
Attempts to look for pairs that are currently in an uptrend on the 4h timeframe, and in the lower area of a volatility zone. Allows trading from near to the bottom to the top of an expected volatility range.
This mode includes a stop in profit mechanism that automatically gets activated near the top of the zone, as well as an optional stop loss trigger.
Pullback mode​
When one of several pullback scenarios is detected on the 4h timeframe, new trades are allowed until 15 minutes after the scenario loses validity.
This mode automatically increases the invested amount for the first few trades.
StepGridHybrid settings​
Balance settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Trading limit | TRADING_LIMIT | 80 | The base amount you invest for each individual buy order is 80 USDT. Due to multipliers, the actual investment per order can range from 20 to 160 USDT. |
Trading limit multiplier | TL_MULTIPLIER | 1 | Adjusts the invested amount for each buy order. For example, with a trading limit of 100 USDT: - A multiplier of 1.0 maintains 100 USDT per order. - A multiplier of 1.5 results in sequential orders of 100, 150, and 225 USDT. - A multiplier of 2 results in sequential orders of 100, 200, and 400 USDT. |
Auto TL ratio | USE_TLR | false | Enables dynamic adjustment of the buy amount based on price. The buy amount varies between 0.25 to 1 times the trading limit, depending on whether the price is high or low. |
Auto Partial sell ratio | USE_PSR | false | Automatically adjusts the partial sell ratio based on price. When prices are low, a higher ratio is used, leading to selling nearly the entire amount of the previous buy order. Conversely, a lower ratio is used when prices are high, resulting in smaller partial sell orders aimed at capturing better sell prices. |
Partial sell ratio | PARTIAL_SELL_RATIO | 0.95 | Defines the percentage of previously bought volume that can be sold at each sell step. For example, if 200 units were bought at lower prices, a partial sell ratio of 0.4 would allow selling 80 units at the current price. |
Use partial sell cap | PARTIAL_SELL_CAP | false | Limits the maximum quantity of a partial sell order to prevent selling more than intended. |
Partial sell cap ratio | PARTIAL_SELL_CAP_RATIO | 1 | Sets the maximum value of a partial sell order to not exceed the trading limit value. A setting of 1 means the maximum partial sell order equals the trading limit. |
Max buy count | MAX_BUY_COUNT | 40 | Limits the total position size to a maximum of 40 times the trading limit. When this maximum is reached, the strategy will only place sell orders. |
Min volume to sell | MIN_VOLUME_TO_SELL | 10 | The minimum order value that the strategy considers sellable. Please verify this value with your exchange to ensure it meets the minimum trade requirements. |
Max invested base | MAX_INVESTMENT | 999999999999999 | Limits the total investment in base currency, which in the case of USDT-BTC would be the USDT amount. For example, setting this to 1000 limits the maximum investment to 1000 USDT. |
Dynamic invest per order
In this strategy, the invest per buy order is not static.
The user setting for trading limit is the base amount for several multipliers in the strategy, deviations between 0.3x and 2x trading limit are possible.
Customize grid​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | Selects the candle period used for auto-calculating step size and trailing range. A lower period value increases trading frequency and associated risks. This strategy also considers longer periods like 1h and 4h for trend analysis. |
Auto step size | AUTO_STEP_SIZE | true | Allows the strategy to automatically determine a grid step size that matches the current volatility of the trading pair. |
Minimum step pct | MIN_STEP_PCT | 0 | Sets a minimum percentage for the grid step size to ensure it does not fall below a certain threshold, which can override the auto step size if it is set lower than this minimum percentage. |
Step size | STEP_SIZE | 500 | Manually sets the grid step size for buy and sell orders when auto step size is not used. This setting can represent an absolute value in fiat (e.g., 500 USDT in USDT-BTC) or a percentage when pct step size is enabled. |
Pct step size | PCT_STEP_SIZE | false | When enabled, the step size is treated as a percentage of the current price, modifying how the grid steps are calculated. |
Enforce step size | ENFORCE_STEP | false | Ensures that the specified step size is strictly adhered to, which can prevent orders from executing if the price does not align precisely with the grid steps, aiding in more precise capital management. |
Unit cost | unit_cost | true | Determines how the break-even price is calculated. When enabled, the break-even price reflects the average cost per unit of the remaining balance. When disabled, it reflects the price at which all remaining units can be sold without loss. |
Dynamic exit logic | DYNAMIC_EXIT_LOGIC | false | Modifies the exit strategy based on market conditions. In an uptrend, the exit target is the unit cost; in other situations, it is the overall break-even price. This setting is dependent on the 'unit cost' setting being disabled. |
Partial sell gain | GAIN_PARTIAL | 0.5 | Sets the minimum profit target for partial sells. A setting of 0.5% means partial sell orders are placed only when the buy price is at least 0.5% lower than the current price, after accounting for trading fees. |
Gain | GAIN | 1 | Defines the minimum profit percentage above the current break-even or unit cost that must be achieved before a full sell order is executed. For instance, a setting of 1% ensures that full sells only occur at prices 1% higher than the break-even or unit cost. |
Customize trailing​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Pct buy trailing range | PCT_TRAILING_RANGE | false | Enables setting a custom percentage to define the buy trailing range, which overrides the default automatic setting based on support and resistance distances. |
Custom buy trailing range | CUSTOM_TRAILING_RANGE | 0.3 | Defines the specific percentage used for the buy trailing range when 'Pct buy trailing range' is enabled. A setting of 0.5% means the trailing range will be 0.5% of the current price. |
Pct sell trailing range | PCT_SELL_TRAILING_RANGE | false | Allows you to set a custom percentage for the sell trailing range, which overrides the default automatic setting based on current market conditions. |
Custom sell trailing range | CUSTOM_SELL_TRAILING_RANGE | 0.3 | Specifies the percentage used for the sell trailing range when 'Pct sell trailing range' is enabled. A setting of 0.5% sets the trailing range to 0.5% of the current price, affecting how sell orders are trailed. |
Trend options​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Trend sync | TREND_SYNC | false | Restricts the initiation of new trades to periods when the 4h and 1h trends are aligned, enhancing consistency but potentially reducing trade frequency. This setting does not affect dollar-cost averaging (DCA) trades. |
Trend basic | TREND_BASIC | true | Enables dynamic trading actions based on market conditions, such as increased sell steps and trailing ranges during favorable markets, immediate buy orders during strong uptrends, and higher partial sell ratios following such buys. |
Trend plus | TREND_PLUS | true | Further enhances dynamic trading by enabling immediate buy orders during perceived short-term opportunities and increasing partial sell ratios following these buys, aiming to capitalize on market momentum. |
Trend orders | TREND_ORDERS | true | Controls whether orders initiated by 'Trend basic' and 'Trend plus' settings are allowed, providing a method to toggle these dynamic features on and off without disabling the settings entirely. |
Auto trend orders | AUTO_TREND_ORDERS | true | Limits the execution of trend-initiated orders to periods during a 4h uptrend, refining the strategy's market engagement to potentially more profitable times. |
Trailing range multiplier | TRAILING_MULTIPLIER | 2 | Applies a multiplier to the trailing range when conditions detected by 'Trend basic' or 'Trend plus' warrant a larger trailing range, such as in specific bullish conditions. This setting also affects custom pct trailing ranges. |
Sell step multiplier | SELL_STEP_MULTIPLIER | 1.2 | Increases the size of sell steps by a factor of 1.2 in certain market conditions identified by the trend modules, enhancing profit potential during specific trends. |
Trend trailing | TREND_TRAILING | true | Automatically adjusts buy trailing ranges in bearish market conditions to avoid premature or unprofitable buying, enhancing strategy efficiency during downtrends. |
Trend trailing multiplier (small) | TREND_TRAILING_MULTIPLIER | 1 | Applies a smaller multiplier to buy trailing ranges when the 4h trend is bullish but the 15m trend is bearish, allowing for adjusted buy points that reflect short-term market dips within a generally positive trend. |
Trend trailing multiplier (big) | TREND_TRAILING_BEARISH_MULTIPLIER | 2 | Applies a larger multiplier to buy trailing ranges when both the 4h and 15m trends are bearish, significantly widening the buy range to capture better entry points during pronounced downtrends. |
Trading modes​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Custom trading range | CUSTOM_TRADING_RANGE_MODE | false | Enables the definition of a specific price range within which the strategy operates. New trades are only opened within a price band of 8000 to 10000 USDT. DCA trades can occur at any price, but if the price falls below 7000 USDT, all holdings are sold. |
Trading range low | TRADING_RANGE_LOW | 8000 | Sets the lower limit of the custom trading range, below which new trades are not initiated. |
Trading range high | TRADING_RANGE_HIGH | 10000 | Sets the upper limit of the custom trading range, above which new trades are not initiated. |
Trading range stop | TRADING_RANGE_STOP | 7000 | Defines a stop loss target within the custom trading range. If the opening rate of the latest candle falls below this level, all holdings are sold to limit losses. |
Trading range DCA stop | TRADING_RANGE_DCA_STOP | 7500 | Sets the lower limit for placing DCA orders within the custom trading range, ensuring that no additional DCA orders are placed below this price level. |
Pullback mode | PULLBACK_MODE | false | Restricts new trades to times when a price pullback occurs, as primarily observed on 4h charts. This setting aims to optimize entry points but can significantly limit trading opportunities. |
Volatility mode | VOLATILITY_MODE | false | Limits trading to bullish pairs within a controlled volatility range. It aims to start trades at lower prices and stop at peaks, with a built-in stop mechanism to potentially minimize losses on the final sell order. |
TA mode | TA_MODE | false | Restricts trading to bullish pairs that meet specific technical analysis fractals, aiming to optimize trade entries based on technical signals. |
Dynamic stop loss | DYNAMIC_SL | false | Provides a dynamic stop loss target when used with volatility or TA mode, offering a safety mechanism that is not visible until it triggers, which can lead to potential losses. |
Advanced​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Stop after next sell | STOP_AFTER_SELL | false | Halts new trading activities after the current holdings are fully sold, ensuring that no new buy orders are placed when there is no balance left to sell. |
Forever bags | FOREVER_BAGS | false | Enables a strategy of holding onto trades indefinitely, ignoring the break-even price and focusing on potential long-term gains from significant market upswings. |
Buy enabled | BUY_ENABLED | true | Allows the placement of buy orders within the strategy, facilitating continuous trading activity and potentially increasing profitability. |
Sell enabled | SELL_ENABLED | true | Enables the placement of sell orders, ensuring the strategy can take profits and manage positions effectively. |
SMA period | SMAPERIOD | 50 | Defines the number of candles used to calculate support and resistance levels for trailing range calculations. The default setting of 50 is typically adequate without adjustments. |
ATR period | ATR_PERIOD | 50 | Specifies the number of candles used to determine the Average True Range, which helps calculate the auto step size for the strategy. The default setting of 50 generally does not require modification. |
Keep quote | KEEP_QUOTE | 0 | Sets a minimum amount of the quote currency to retain, preventing the strategy from selling this portion of the balance. For example, setting it to 0.01 in USDT-BTC means the strategy will not sell the last 0.01 BTC. |
Ignore trades before | IGNORE_TRADES_BEFORE | 0 | Allows the strategy to disregard any trades that occurred before the specified Unix timestamp. Useful for resetting the strategy's trading calculations and history. |
Other parameters
Besides settings mentioned on this page, no other strategy setting has any effect on stepgridhybrid.