Skip to main content

SgsFutures Trading Strategy

A futures grid strategy that's almost exactly like the spot stepgridscalp strategy. The main difference is that it does not (small stop losses aside) partially close trades at prices worse than avg. entry price. Default settings differ from spot, and ensure a higher trading frequency.

info

This strategy runs in long only mode.

SGS Futures strategy showing multi-timeframe grid trading with dynamic adaptations

Key features:

  • truly multi timeframe: user configurable low, medium und high timeframes for monitoring aspects like trend changes, momentum strength and more. For example you could trade on 5m charts, while also monitoring 15m and 4h.
  • different trading styles that are automatically used when opportune:
    • normal grid trading
    • cautious 'scalping' in upper ranges: aiming to exit the zone with no or a very small sized bag, using a smaller amount per buy order, strict buydowns for DCA and very cautious sell trailing
    • trade supports: when the market looks very bad, grid buy trading stops and the strategy moves into a mode where it trades higher timeframe supports with limit orders
  • different sell trailing styles that are automatically used when opportune:
    • regular trailing, with dynamic trailing ranges
    • candle low trailing, to trail bigger moves upwards
    • micro stop loss style, to quickly start sell trailing after riskier buy orders, accepting a tiny loss as outcome
  • quick detection of trend direction changes
info

Cancel orders must be disabled in the global bot settings when you use the 'trade supports' option (you can do that on the setup page).

About the trend module​

The trend options are what set this strategy apart from other similar strategies. The exact details are not public to protect the work of the author, but how the data is used is a lot simpler and more transparent than in previous strategies that use black box data.

SGS Futures strategy sidebar displaying real-time trading metrics and phase indicators All data mentioned below, is visible in the right sidebar on the chart page

Phase system​

Using data from three configurable timeframes, one out of six phases gets recognized at any time:

1: very bearish 2: bullish reversal 3: bullish 4: very bullish 5: bearish reversal 6: bearish

Trend sync uses the phase system to determine if any of the following is allowed:

  • opening new trades, coming from a situation where there is no balance to sell
  • grid trading
  • pausing grid trading, and placing limit orders at higher timeframe supports

Trend plus uses the phase system to apply dynamic trailing ranges, for example by increasing the sell trailing range in a very bullish market.

Trend scalping uses the phase system to go into 'scalping mode' when the market is either bullish, or very bullish. This mode using a more careful sell trailing mechanism (including tiny, partial stop losses), and reduces the number of 'high' buy orders, and instead buying more when price is slightly moving down again.

All trend options can be used together, or individually.

Overbought status and momentum​

By monitoring higher timeframes to determine if (and how much) the market is overbought and if the current momentum is bullish or bearish, the strategy can be either more careful with new trades, or extend trailing ranges to aim for more profit.

The strict entry and strict dca options depend heavily on longer term momentum status.

Overview of restrictions​

This strategy offers several settings that put restrictions on when new trades may be opened and when DCA is allowed, most of these settings can be used together.

When all restrictions are disabled, the strategy behaves like a more configurable version of stepgrid with small hardcoded limits on repeated buy orders in the same price zone, with much better sell trailing.

The overview below describes the main impact of each restrictive setting.

SettingRestrictions on new tradesRestrictions on any buy order
Price action analysis
  • New trades not allowed in phases 'very bearish' and 'bearish'
  • Grid buy trades not allowed in phases 'very bearish' and 'bearish'
Strict entry
  • New trades not allowed when money flow, momentum and volatility are not favorable on the upper timeframe
  • None
Strict DCA
  • None
  • Grid buy trades not allowed when momentum is not favorable on the upper timeframe
Exhaustion sensitivity
  • None
  • Grid buy trades not allowed when any of the timeframes is overbought, up to the specified timeframe (none, short, medium or long). For example when exhaustion sensitivity is set to 'medium', then buy orders are not allowed while the short, medium or both of these timeframes are overbought
Trade supports
  • None
  • Grid buy trades not allowed in phases 'very bearish' and 'bearish'. During this time limit orders are placed at medium or long term supports
Trend scalping
  • New trades not allowed on upper step when in phases 'bullish' or 'very bullish' and short term trend is bullish
  • Enforce additional grid buydown in phases 'bullish' and 'very bullish'
Custom trading range
  • New trades not allowed when price is not between 'trading range low' and 'trading range high'
  • Grid buy trades not allowed when price is below 'trading range DCA stop'

SgsFutures settings​

Balance settings​

LabelConfig ParameterDefault ValueDetailed Description
Trading limitTRADING_LIMIT40The base amount you use for each regular buy order in contracts on coin-m markets. This amount also calculates the 'buy count'.
Trading limit multiplierTL_MULTIPLIER1This setting allows you to modify the invested amount for each consecutive buy order. For example, with a trading limit of 100 USDT and a maximum buy count of 3:

- 1: each buy order is for 100 USDT
- 1.5: first buy 100, second buy 150, third buy 225
- 2: first buy 100, second buy 200, third buy 400

The range for this setting is between 1 and 5.
Always use TL multiplierALWAYS_USE_TL_MULTIPLIERfalseThis setting controls whether the 'TL ratio' settings use an absolute amount as input or the multiplier trading limit amount.

- Enabled: All TL ratio settings use the TL multiplier for the base amount to apply the ratio on.
- Disabled: Each TL ratio setting works as 'absolute amount set as trading limit' multiplied by the ratio.
Max buy countMAX_BUY_COUNT20Limits the maximum position size, applying to all order triggers except BTFD mode. The use of the trading limit multiplier is considered, factoring in the increased investment per buy order into the 'buy count' so that each DCA round is counted once. For example, a value of 40 means the total position size may not exceed 40 times the amount set as 'trading limit'. When the maximum is reached, the strategy switches to sell mode only.
Max open contractsMAX_OPEN_CONTRACTS999This setting specifies the maximum size of a futures position in quote units. If executing a subsequent order would exceed the maximum open contracts, the order will not be executed.
Max lossMAX_LOSS999999999999999Sets the maximum acceptable loss. If the unrealized loss exceeds this max loss, the strategy will close the full position at a loss. For example, if the max loss is set to 100, a stop loss will occur when the unrealized PnL exceeds -100.

Profit settings​

LabelConfig ParameterDefault ValueDetailed Description
GainGAIN2Specifies the minimum gain percentage necessary for a full close of the position. For instance, setting this to 1 means a full sell is only permissible when the price hits a sell step at least 1% 'above' the average entry price.
Partial sell gainGAIN_PARTIAL0.3Sets the minimum gain target for partial close orders. For example, setting this to 0.5 means that partial sell orders occur when the price reaches at least 0.5% above the average entry price and continues up to the gain target for a full close.
Partial sell ratioPARTIAL_SELL_RATIO0.3Determines the portion of the position size used for each partial close order. Setting this to 0.3 means that each partial close order will use 30% of the position size.
Use partial sell capPARTIAL_SELL_CAPtrueEnables an upper limit to the quantity of partial close orders.
Partial sell cap ratioPARTIAL_SELL_CAP_RATIO2Sets the maximum value for partial close orders. For instance, setting this to 2 means a partial close order may not exceed twice the 'trading limit'.

Period settings​

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD5Selects the trading timeframe to use for short-term market data analysis.
Period mediumPERIOD_MEDIUM15Selects the trading timeframe to use for medium-term market data analysis.
Period longPERIOD_LONG60Selects the trading timeframe to use for long-term market data analysis.

Customize grid​

LabelConfig ParameterDefault ValueDetailed Description
Auto step sizeAUTO_STEP_SIZEcandleSizeLets the bot automatically determine a grid step size that fits the pair's current volatility. Available options are 'none', 'ATR', and 'candleSize'. If set to 'none', the configured absolute or percentage step size is used instead.
Minimum step pctMIN_STEP_PCT0.3Sets the minimum percentage size for steps, to overrule automatic step size. A setting of 0.3 means that the absolute minimum for auto step size is 0.3% of the current price.
Step sizeSTEP_SIZE500Manually defines the grid step size for buy and sell orders when auto step size is not enabled. 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 the current price.
Pct step sizePCT_STEP_SIZEfalseWhen enabled, the value for step size represents a percentage.
Enforce step sizeENFORCE_STEPfalseUsed to ensure step size is respected. 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.
DirectionDIRECTIONLONGThis setting controls the direction the strategy trades. Available option is 'LONG', indicating trading only long positions.
Use market ordersMARKET_ORDERStrueControls whether grid orders are placed as market orders or not. Generally, enable this for most exchanges but disable for dYdX. When disabled, grid orders are placed as limit orders when price trailing finishes (note that these are not post-only orders, they are meant to fill immediately).

Customize trailing​

LabelConfig ParameterDefault ValueDetailed Description
Pct buy trailing rangePCT_TRAILING_RANGEfalseBy default, buy trailing ranges are set automatically based on the current distance between support and resistance. With this option, you can set a percentage as a custom trailing range to be used for buy and sell trailing.
Custom buy trailing rangeCUSTOM_TRAILING_RANGE0.3When pct buy trailing range is enabled, setting 0.5 will lead to having buy trailing ranges of 0.5% of the current price.
Pct sell trailing rangePCT_SELL_TRAILING_RANGEfalseBy default, sell trailing ranges are set automatically based on the current distance between support and resistance. With this option, you can set a percentage as a custom trailing range to be used for buy and sell trailing.
Custom sell trailing rangeCUSTOM_SELL_TRAILING_RANGE0.3When pct sell trailing range is enabled, setting 0.5 will lead to having sell trailing ranges of 0.5% of the current price.

IRIS-Trend | Price action​

LabelConfig ParameterDefault ValueDetailed Description
Price action analysisTREND_SYNCfalseWhen enabled, trend data of the configured timeframes for short, medium, and long term is used to follow price action to:
- (dis)allow opening new trades
- switch between normal grid trailing and grid trailing with increased trailing ranges.
Price action TL ratioPRICE_ACTION_TL_RATIO1Can be used to modify buy amounts when price action is very positive. Setting 2 places buy orders for 'trading limit' * 2.
Price action thresholdPRICE_ACTION_THRESHOLD0ATR percentage rank threshold used in the conditions to allow 'price action tl multiplier' and 'Price action analysis (during phase bullish reversal)'. Setting 0.5 means that the current medium period ATR percentage rank value must be at least 50% and the current candle is green.
Strict entrySTRICT_ENTRYfalseWhen enabled, more conservative criteria are used to (dis)allow opening new trades, mainly by not buying into overbought market conditions. This can lead to times of inactivity after a final sell, by design.
Strict DCASTRICT_DCAfalseWhen enabled, grid DCA trades are not allowed when the upper timeframe has bearish momentum.
Exhaustion sensitivityEXHAUSTION_SENSITIVITYMEDIUMThis setting controls up to which timeframe exhaustion must pass before a next DCA buy is allowed.

- NONE: disables this protection
- SHORT: do not allow buy orders when short term is exhausted
- MEDIUM: do not allow buy orders when short OR medium term is exhausted
- LONG: do not allow buy orders when short OR medium OR long term is exhausted

IRIS-Trend | Trade supports​

LabelConfig ParameterDefault ValueDetailed Description
Trade supportsTRADE_SUPPORTStrueWhen enabled, trend data of the configured timeframes for short, medium, and long term is used to follow price action to a mode in which limit orders targets are placed at medium or long term support levels.
S1 TL ratioSUPPORT_TL_RATIO2When trend sync is enabled and multiple timeframes move downwards, limit buy targets are placed at medium or high timeframe supports. This setting determines the buy order value for S1 targets, it multiplies 'trailing limit'. Setting 2 places buy orders for 'trading limit' * 2.
S2 TL ratioSUPPORT2_TL_RATIO2When trend sync is enabled and multiple timeframes move downwards, limit buy targets are placed at medium or high timeframe supports. This setting determines the buy order value for S2 targets, it multiplies 'trailing limit'. Setting 2 places buy orders for 'trading limit' * 2.

IRIS-Trend | Micro scalping​

LabelConfig ParameterDefault ValueDetailed Description
Micro scalpingTREND_SCALPINGtrueWhen enabled, trend data using the configured timeframes for short, medium, and long term is used to:
- (dis)allow opening new trades
- switch between normal grid trading and micro scalping

During micro scalping, partial stop loss orders are possible.
Micro scalp TL ratioSCALP_TL_RATIO0.625When trend scalping is enabled and a scalping zone is reached, buy and sell amounts are based on this ratio. This setting determines the buy order value for support targets, it multiplies 'trailing limit'. Setting 0.5 places buy orders for 'trading limit' * 0.5.
Initial buy step multiplierSCALP_INIT_BUY_MULTIPLIER0.6Can be used to modify the first buy step size, when not in a position and the strategy is in status 'scalping'. Lower values lead to opening a new trade quicker. This multiplier is used like 'multiplier * step size', where step size can be an automatically generated value, or a defined manual step size.
Dynamic stop lossDYNAMIC_SLfalseThis is a stop loss option for small positions (up to 2x 'trading limit', rounded), accumulated in higher regions. The goal is to accept a relatively small loss sometimes, before a trade gets hard to DCA effectively.

IRIS-Trend | Multiple timeframes​

LabelConfig ParameterDefault ValueDetailed Description
Multi timeframes modeMULTIPLE_TIMEFRAMES_MODEfalseWhen enabled, the strategy switches to a lower set of timeframes when it detects favorable conditions during a 'bullish reversal' phase, with the aim of reaching a higher trading frequency. When the lower set of timeframes all have exhausted market conditions, it switches back to the regular set of timeframes.
Multi timeframes mode TL ratioMTF_TL_RATIO1Trading limit ratio to use for buy trading using the lower set of timeframes. This setting determines the buy order value for support targets, it multiplies 'trailing limit'. Setting 0.5 places buy orders for 'trading limit' * 0.5.
Lower set low periodLOWER_PERIOD_LOW5Low period of lower set of timeframes.
Lower set medium periodLOWER_PERIOD_MEDIUM15Medium period of lower set of timeframes.
Lower set high periodLOWER_PERIOD_HIGH30High period of lower set of timeframes.
Regular set low periodMIDDLE_PERIOD_LOW15Low period of regular set of timeframes. Should normally be set identically to the period settings in the indicator section.
Regular set medium periodMIDDLE_PERIOD_MEDIUM60Medium period of regular set of timeframes. Should normally be set identically to the period settings in the indicator section.
Regular set high periodMIDDLE_PERIOD_HIGH240High period of regular set of timeframes. Should normally be set identically to the period settings in the indicator section.

IRIS-Trend | Accumulation cycle​

LabelConfig ParameterDefault ValueDetailed Description
Accumulation cycleACCUMULATION_CYCLEfalseWhen enabled, no partial sells 'below' avg entry are allowed, full sell only allowed when gain target is reached and the market is exhausted on the upper timeframe. New trades are only opened during the 'bullish reversal' phase. Micro scalping is disabled.

IRIS-Trend | Advanced trailing​

LabelConfig ParameterDefault ValueDetailed Description
Advanced trailingTREND_PLUStrueWhen enabled, trend data using the configured timeframes for short, medium, and long term is used to in- and decrease trailing ranges based on the currently detected market phase. This overrules a trailing modifier in 'strict price action'.
Buy multiplier smallTREND_PLUS_BUY_MULTIPLIER_SMALL1Smallest buy trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.
Buy multiplier mediumTREND_PLUS_BUY_MULTIPLIER_MEDIUM2Medium buy trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.
Buy multiplier largeTREND_PLUS_BUY_MULTIPLIER_LARGE5Largest buy trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.
Sell multiplier smallTREND_PLUS_SELL_MULTIPLIER_SMALL0.5Smallest sell trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.
Sell multiplier mediumTREND_PLUS_SELL_MULTIPLIER_MEDIUM2Medium sell trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.
Sell multiplier largeTREND_PLUS_SELL_MULTIPLIER_LARGE5Largest sell trailing range multiplier. Multiplies the currently active trailing range: auto or custom pct. 1x auto trailing range equals 0.2x ATR.

IRIS-Trend | BTFD mode​

LabelConfig ParameterDefault ValueDetailed Description
BTFD modeBTFD_MODEfalseWhen enabled, a configurable series of limit buy orders gets placed when price drops below a defined or automatic price target and there are no open orders at that time.
BTFD use trend filterBTFD_TREND_FILTERfalseWhen enabled, the trend module only allows to BTFD when the market is confirmed very bearish, sell volume is leading on the upper timeframe and volatility is high. Can be used together with manual or automatic price targets.
BTFD dip targetBTFD_DIP_TARGET0Manual price target to start BTFD mode. As soon as price drops below this target and there are no open orders, a series of limit buy orders get placed. Normal grid buy operations stop below this price.
BTFD max dip targetBTFD_MAX_DIP_TARGET0Manual price target to stop BTFD mode. No limit buys get placed below this target. Example: dip target set to 1000, max dip target set to 900, means that BTFD may only buy between 1000 and 900.
BTFD use automatic targetsBTFD_AUTO_TARGETnoneEnable to use automatic dip targets. Conditions to BTDF with auto targets: price drops below selected target and there are no open orders. When used together with the 'trade supports' option, BTFD would not activate if there are support orders open already. When combined with 'trade supports', it is strongly recommended to select long term S2 or a manually set target.
BTFD TL ratioBTFD_TL_RATIO1Can be used to modify buy amounts during BTFD. Setting 2 places buy orders for 'trading limit' * 2.
BTFD max buy countBTFD_MAX_BUY_COUNT25Limits maximum position size during BTFD mode. When trading limit multiplier is used, the increased investment per buy order is factored into 'buy count' so each DCA round is only counted once. A value of 40 means that the total position size may not exceed 40x the amount set as 'trading limit'. When max is reached, the strategy goes in sell mode only.
BTFD max dip ordersBTFD_MAX_ORDERS5Max number of buy orders to fire, each placed at one step distance from another, to place when BTFD mode starts. Intended to limit the number of orders per time that BTFD activates, not to cap position size itself. Takes max buy count and max dip target into account, and stops placing lower orders when either of those would get exceeded.
BTFD gainBTFD_GAIN1Percentage above avg entry price, to place the sell target after a BTFD order.
BTFD auto step sizeBTFD_AUTO_STEP_SIZEATRLets the bot automatically determine a grid step size for BTFD that fits the pairs current volatility. When set to none, the configured absolute or percentage step size is used instead.
BTFD step sizeBTFD_STEP_SIZE500Manually defined grid step size for BTFD buy orders, when auto step size is not enabled. 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 the current price.
BTFD pct step sizeBTFD_PCT_STEP_SIZEfalseWhen enabled, the value for step size represents a percentage.

Custom trading range​

LabelConfig ParameterDefault ValueDetailed Description
Custom trading rangeCUSTOM_TRADING_RANGE_MODEfalseWith 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 lowTRADING_RANGE_LOW8000Lower limit of manual trading range. Applies to opening new trades.
Trading range highTRADING_RANGE_HIGH10000Upper limit of manual trading range. Applies to opening new trades.
Trading range stopTRADING_RANGE_STOP7000Stop loss target of manual trading range.
Trading range DCA stopTRADING_RANGE_DCA_STOP7500Lower limit for DCA orders. No additional DCA orders are placed below this price.
Stop loss ratioTRADING_RANGE_STOP_RATIO1Can be used for partial stop losses that are triggered by DCA stop target. Regardless of input, minimum SL size is capped to 1x trading limit. Setting 0.5 places stop for 'quote balance' * 0.5. Note that setting a value below 1 can lead to repeated stops. When the last order trigger is this kind of stop order, it won't trigger again until another strategy trigger happens after, like a grid buy order.

Advanced​

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueAllows or disallows placing buy orders. Strategy performs better when trades are always allowed.
Sell enabledSELL_ENABLEDtrueAllows or disallows placing sell orders. Strategy performs better when trades are always allowed.
Stop after next sellSTOP_AFTER_SELLfalseUsed to stop trading after the current holding has been completely sold. When enabled, no new buy trades are placed at times where there is no balance to sell anymore.
ATR periodATR_PERIOD50Number of candles used to calculate Average True Range, which is used to calculate auto step size and trailing ranges. Default value of 50 should usually not need tuning.
Ignore trades beforeIGNORE_TRADES_BEFORE0Optional 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
tip

Other parameters

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