Skip to main content

stepgridhybrid

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:

Stepgridhybrid trading behavior

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 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#

Example of skipping buy 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#

Example of 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.

info

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.

Balance settings#

SettingDescription
Trading limit

The standard amount to invest per buy order.

On an USDT-BTC pair, a trading limit of 20 means that every buy order is for 20 USDT. Always make sure that trading limit is set higher than min volume to sell.

With this strategy some buy orders will use a different amount than specified as trading limit, the possible range is between 0.25x and 2x the standard amount.

Auto TL ratio

Change TL dynamically.

When enabled, the strategy will use a dynamic buy amount depending on if price is relatively high (lower amount) or relatively low (higher amount).

Amount ranges between 0.3x and 1x trading limit. If you use this, make sure to set a value for trading limit that is at least ~3.3x the minimum order size.

Auto Partial sell ratio

Change partial sell amount dynamically.

When enabled, the strategy sets partial sell ratio automatically. It will use a higher value when price is relatively low, and a lower value when price is relatively high.

What this means is that when prices are relatively high, partial sell orders will use less of the available balance at these rates, and aim to bring more sell volume to higher prices. When prices are relatively low, each partial sell order will sell almost the full amount of the previous buy order.

Partial sell ratio

Change partial sell amount dynamically.

The strategy is aware of how much volume was bought below the current price, and how much remains to be sold profitably. If a sell step is reached where nothing can be sold profitably, the step is skipped. When placing a sell order below the overall break even rate, the sell volume is defined by partial sell ratio.

If for example 200 units were bought at rates lower than the current price, a partial sell of 0.4 will lead to a partial sell order of 80 units.

Max buy count

Limits maximum trade size.

When max is reached, the strategy goes in sell mode only.

A value of 40 means that the total trade size may not exceed 40x the amount set as 'trading limit'. When max is reached, the strategy goes in sell mode only.

Min volume to sell

To ignore tiny balances.

Set this to the minimum order size of the pair, to make the bot ignore small balances that cannot be sold.

tip

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 settings#

SettingDescription
Period

Sets the chart timeframe

Sets which candles are used to calculate auto step size and trailing range. A lower value increases trading frequency and risk.

This strategy additionally uses a hardcoded trend module that watches 15m, 1h and 4h timeframes.

Auto step size

Enables using automatic step size.

Lets the bot automatically determine a grid step size that fits the pairs current volatility, Based on Average True Range (ATR).

Step size

Sets a manual step size.

Manually defined grid step size for buy and sell orders, when auto step size is not enabled.

Normally set as a price: setting 500 on USDT-BTC makes the bot trade each time price moves 500 USDT.

When using Pct step size, the value represents a percentage: setting 2 will lead to having steps of 2% of current price.

Pct step size

Use a percentage based step size.

When enabled, the value for step size represents a percentage.

Enforce step size.

Predictable minimum distance between orders.

Used to ensure orders are not placed at a rate worse than step target.

Price trailing can sometimes finish at a rate worse than the current grid step up or down. With this option enabled, orders may only get fired when trailing finishes at a better rate than the current step target. This can be useful for very precise balance management.

Unit cost

Determines how the break even price is calculated.

When enabled, break even target represents the average price per unit of remaining units in balance.

When disabled, break even target represents the point at which the remaining units can be sold for the total trade sequence to break even.

Dynamic exit logic

Different targets for different market situations.

Use this to dynamically change the exit logic used for the strategy. In uptrends the target is unit cost, in any other market situation the break even price for the complete order sequence is used.

Disable unit cost to use this option.

Customize trailing settings#

SettingDescription
Pct trailing range

Use custom trailing range

By default trailing ranges are set automatically based on the current distance between support and resistance. With this option you can set a percentage as custom trailing range to be used for buy and sell trailing.

Custom trailing range

Set trailing range as percentage

When Pct trailing range is enabled, setting 0.5 will lead to having trailing ranges of 0.5% of current price.

Trend settings#

SettingDescription
Trend sync

Use custom trailing range

When enabled, new trades may only be opened when the trends on 4h and 1h are aligned and bullish. Does not apply to dca trades.

This can be very restrictive.

Trend basic

Enables dynamic strategy behavior based on price action

Uses the trend module to modify the following part of the strategy:

  • using an increased sell step and trailing range when the market seems good for it
  • placing immediate buy orders (regardless of hitting a step) when price action is very positive
  • using a higher partial sell ratio after an immediate buy
  • skipping certain buy steps when price action is very negative

This option will usually lead to more trading volume and makes it more complex to plan capital allocation.

Trend plus

Enables dynamic strategy behavior based on trend

Uses the trend module to modify the following part of the strategy:

  • placing immediate buy orders (regardless of hitting a step) when there seems to be a short term opportunity
  • using higher partial sell ratio after an immediate buy

This option will usually lead to more trading volume and makes it more complex to plan capital allocation.

Trend orders

Disable immediate orders

When disabled, immediate orders triggered by trend basic and/or trend plus are not allowed.

Trailing range multiplier

Control dynamic changes to trailing range

This multiplier is used when trend basic and/or trend plus are enabled, and the trend module detects a situation where increased targets make sense.

Setting trailing multiplier to 2, multiplies the trailing range by 2 in specific situations. This multiplier also applies to custom pct trailing ranges.

Trend orders

Disable immediate orders

When disabled, immediate orders triggered by trend basic and/or trend plus are not allowed.

Auto trend orders

Allows additional trend orders in uptrends

When used together with "trend orders: true", such trend initiated orders are restricted to be allowed only during a 4h uptrend

Sell step multiplier

Control dynamic changes to trailing range

`This multiplier is used when trend basic and/or trend plus are enabled, and the trend module detects a situation where increased targets make sense.

Setting setting sell step multiplier to 1.2 makes the a sell step 1.2x times as big in specific situations. This multiplier also applies to a custom step size.

Trend trailing

Use much bigger buy trailing range during downtrend

Automatically use different buy trailing ranges for bearish situations.

The aim is to spend less on buy orders when price is not moving upwards, by using much bigger trailing ranges.

Trend trailing multiplier (small)

Controls buy trailing range

Trailing range multiplier to use when 4h structure is bullish, but 15m structure is bearish.

Sets buy trailing range to "multiplier * ATR", or if you use a custom pct trailing range, to "multiplier * pct trailing range"

Trend trailing multiplier (big)

Controls buy trailing range

Trailing range multiplier to use when 4h structure is bearish and 15m structure is not bullish or is bearish.

Sets buy trailing range to "multiplier * ATR", or if you use a custom pct trailing range, to "multiplier * pct trailing range"

Trading mode settings#

SettingDescription
Custom trading range

Set a price range to allow opening new trades in

With this mode you can define the price zone in which you want the strategy to operate, and optionally set a stop target.

With the settings like in the defaults, new trades may only be opened when price is between 8000 and 10000. DCA trades can be placed at any price. In case price drops below 7000 all funds get sold. Set stop target to 0 to effectively disable it.

Trading range low

Lower range limit

Lower limit of manual trading range. When not in a trade and price is below the lower limit, no new trades will get opened.

Trading range high

Upper range limit

Upper limit of manual trading range. When not in a trade and price is above the upper limit, no new trades will get opened.

Trading range stop

Stop loss target

Stop loss target of manual trading range. When in a trade and price drops below this target price, all assets get sold immediately.

Trading range DCA stop

Lower limit for allowing DCA orders.

Use this to block DCA orders below a specified price.

Pullback mode

Trade only during/after 4h pullbacks

When enabled, a pair may only open new trades when a pullback happens. Monitored on 4h charts, independent of the period you set in this strategy.

This can be very restrictive.

Volatility mode

Trade only within certain volatility ranges

When enabled, only bullish pairs are traded in a controlled volatility range: it will attempt to start trading relatively low and stop trading when price is about to peak.

This mode comes with a built in stop mechanism near the top to often allow for a clean exit with minimal loss on the last sell order. This stop mechanism is separated from the dynamic stop loss option, and cannot be disabled in this mode.

This can be very restrictive.

TA mode

Trade only during certain TA fractals

When enabled, only pairs are traded after they hit one or more TA fractals.

This can be very restrictive.

Dynamic stop loss

Stop loss mechanism for volatility and TA modes

This option is meant to be used together with volatility mode or TA mode and tries to provide a meaningful stop target. Can also be used with other, or no active modes.

You cannot see the stop target before it hits. This can lead to losses.

Advanced settings#

SettingDescription
Stop after next sell

To stop trading a pair after the position closes.

When enabled, no buy orders are placed when there is no balance left to sell.

Averaging down of the current position continues, partial sell orders do not make the bot stop afterwards.

Forever bags

Force identical behavior below and above break even.

Used to 'ride trends up'. The default strategy behavior is to exit a trade in one or a small number of sell orders above the break even price. Using the 'forever bags' option the break even price is completely ignored.

Buy enabled

Allow or disallow placing buy orders.

When disabled, no buy orders will be placed at all.

Sell enabled

Allow or disallow placing sell orders.

When disabled, no sell orders will be placed at all.

SMA period

How many candles are used for calculating support and resistance levels.

By default 50 candles are used to calculate support and resistance. In this strategy, support and resistance are used to determine appropriate trailing ranges.

ATR period

How many candles are used for calculating ATR.

Number of candles used to calculate Average True Range, which is used to calculate auto step size. Default value of 50 should usually not need tuning.

Keep quote

Keep a number of units when selling

By setting keep quote at any number above 0, this number of units will be held back when the next sell order happens.

Ignore trades before

Ignore part of the order history

Optional parameter to force Gunbot to not consider any trades before the time set Value represents a unix timestamp in milliseconds. Get a current timestamp on currentmillis.com

Warning: this setting can lead to all kinds of unexpected behavior. Only use it when you know you need it.

tip

Other parameters

Besides settings mentioned on this page, no other strategy setting has any effect on stepgridhybrid.