Skip to main content

Futures Grid Trading Strategy

A grid like strategy with dynamic trading targets and integrated trailing for both buying and selling. You can for example use this as a DCA short bot, or trade both directions.

The idea of this trading strategy is to always be in a position, average down when prices goes down, take profit when price exceeds break even. And do so with an absolute minimum number of settings. You can use market or limit orders.

This strategy is basically the same as "spotgrid", it's just made for futures and additionally offers the option to trade shorts.

tip

This strategy is a bit different than all other Gunbot strategies: there are just a handful configurable options and it's "always in position": instead of waiting for the perfect entry it is always looking for chances to average down.

If you want to customize settings a lot, this strategy is not for you.

Trading behavior​

When you run futuresgrid on a pair in an uptrend, this is the kind of trading behavior to expect:

Typical futuresgrid trades. Green arrows are buys, orange arrows are sells.

Let's break down what actually happens:

  • When the strategy first runs and there is no balance to sell, it immediately places a market buy order
  • If price goes down and it exceeds the futuresgrid line in the chart, buy trailing is activated. As soon as trailing finishes, a buy order is placed. The break even price is now lower.
  • If price reaches the Sell target on the chart, sell trailing is activated and the complete position is sold at profit when trailing finishes.
  • After having sold, the strategy immediately starts buy trailing. If price goes up it will quickly open a new position, if price goes down it will place a buy order below the last sell rate.

You will see that the first few buy orders happen fairly quickly when price starts going down. After a few trades, the price distance between buy orders gets much bigger. All targets are set automatically.

When the market goes down, the strategy starts to accumulate units at ever lower prices:

Slowly accumulating with same sized orders

The bot will continue to accumulate until max buy count is hit, or when it run out of available funds. Every new buy order will lower the break even price. As soon as price hits the sell target and finishes trailing above break even, a sell order is placed.

Balance management is very important, make sure you can afford the planned number of buy orders.

tip

The next trading targets are always visible on the chart.

Keep in mind the targets lines are moving over time, they represent the current targets.

FuturesGrid settings​

Balance settings​

LabelConfig ParameterDefault ValueDetailed Description
Trading limitTRADING_LIMIT20The base amount you invest for each individual buy order.
Max buy countMAX_BUY_COUNT10Limits the maximum position size. When the maximum count is reached, the strategy shifts to sell mode only.

Setting this to 15, for instance, means that the total position size may not exceed 15 times the amount set as the 'Trading limit'.
Max open contracts (long)MAX_OPEN_CONTRACTS0Sets the upper limit for the position size of a futures long position, expressed in quote units.

Subsequent orders that would exceed this limit will not be executed.
Max open contracts (short)MAX_OPEN_CONTRACTS_SHORT0Similar to the long position setting, this controls the maximum size for futures short positions, also expressed in quote units.

Orders that would surpass this cap will not be placed.
LeverageLEVERAGE0Selects the desired leverage level for your positions. Setting this to 0 applies cross margin.

Note: Leverage options vary based on the exchange, including Bitmex, Bitmex Testnet, Futures Gunthy, and Binance Futures.

Customize targets​

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Configures which candle period is used to determine auto step size and trailing range. A lower period value typically results in more frequent trading but also increases risk.
DirectionDIRECTIONLONGChoose from LONG, SHORT, or AUTO for your trading direction. Selecting LONG will prioritize long positions even if you currently hold a short position, and it will remain until the position can be closed at a profit.

In AUTO mode, the strategy assesses the direction based on trends identified on 4-hour and 15-minute charts. When the trend is unclear, no new positions will be initiated.
Trend variantTREND_VARIANTlegacyChoose a trend source when in AUTO mode:
  • Legacy: Uses the strategy timeframe plus 1-hour and 4-hour data.
  • 4h: Utilizes only 4-hour data.
  • 1h_15m: Combines data from 1-hour and 15-minute charts.
  • Custom: Allows for a user-defined trend source.
Auto gainAUTO_GAINTrueActivates a dynamic profit target based on the distance between support and resistance levels. The minimum profit is set to twice the trading fees, adjusting lower as position size increases.

This setting overrides any manually set profit targets.
GainGAIN0.5Manually sets a profit target. When the price reaches this target percentage above the break-even point, a sell order is triggered.

This is expressed as a percentage increase from the break-even point.
Grid multiplierGRID_MULTIPLIER1Adjusts the distance between buy orders. A default value of 1 means standard levels are used. Increasing the multiplier (e.g., to 1.5) increases the distance proportionally, whereas decreasing it (e.g., to 0.5) reduces the gap.

Trailing settings​

LabelConfig ParameterDefault ValueDetailed Description
Use buy trailingUSE_BUY_TRAILINGTrueEnables price trailing for long orders, allowing you to potentially benefit from continued price increases after an order is placed.
Use custom buy trailing rangeUSE_CUSTOM_BUY_TRAILINGTrueActivates the option to set a specific trailing percentage for buy orders, overriding the default trailing settings.
Custom buy trailing rangeBUY_TRAILING_PCT0.2Sets a custom trailing range for buy orders. For example, a setting of 0.2% will create a trailing range of 0.2% below the current price, allowing for dynamic adjustment as prices fluctuate.
Use sell trailingUSE_SELL_TRAILINGTrueEnables price trailing for short orders, which can help in maximizing profit from price drops after placing an order.
Use custom sell trailing rangeUSE_CUSTOM_SELL_TRAILINGTrueAllows for the setting of a specific trailing percentage for sell orders, giving you control over how aggressively to trail price movements.
Custom sell trailing rangeSELL_TRAILING_PCT0.2Defines a custom trailing percentage for sell orders. Setting this to 0.2% establishes a trailing range that adjusts dynamically, 0.2% above the current price, optimizing the timing for exiting positions.

Advanced​

LabelConfig ParameterDefault ValueDetailed Description
Trading limit multiplierTL_MULTIPLIER1Adjusts the investment amount for each consecutive buy order. For example, with a trading limit of 100 USDT and a max buy count of 3:
  • Multiplier of 1: Each order is 100 USDT.
  • Multiplier of 1.5: First order is 100 USDT, second is 150 USDT, third is 225 USDT.
  • Multiplier of 2: First order is 100 USDT, second is 200 USDT, third is 400 USDT.
Minimum buydownMIN_BUYDOWN0Sets a minimum percentage distance between orders that increase a position, acting as an override to preset buydown levels. Setting this to 0.6% ensures a minimum gap of 0.6% between such orders.
Keep 1x TLKEEP_ONE_TLFalseWhen enabled, maintains an open position equivalent to 1x the trading limit after partially or fully closing a position, preventing immediate re-entry into the market.
Stop after next sellSTOP_AFTER_SELLFalseHalts trading activities after the current holding is completely sold, preventing new buy trades during times when there is no balance available to sell.
Buy enabledBUY_ENABLEDTrueAllows you to enable or disable placing of long orders. Closing existing long positions remains possible even when buying is disabled.

Typically, allowing continuous trading leads to better strategy performance.
Sell enabledSELL_ENABLEDTrueAllows you to enable or disable the placing of short orders. Closing existing short positions is still possible even when selling is disabled.

Generally, continuous trading improves the strategy's effectiveness.
SMA periodSMAPERIOD50Defines the number of candles used to calculate support and resistance levels. These levels are crucial for setting buydown targets and determining trailing ranges.

The default setting of 50 typically does not require adjustments.
Keep quoteKEEP_QUOTE0Specifies the amount of quote units to retain in your balance. For example, setting this to 0.01 in a USDT-BTC pair ensures that the last 0.01 BTC is not sold.
First order delayFIRST_ORDER_EXTRA_DELAY30Adds an additional delay after opening a new trade to prevent multiple orders in quick succession, especially useful if the exchange is slow to update balances.
tip

Other parameters

Watch mode is respected.

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