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.
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:
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:
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.
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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Trading limit | TRADING_LIMIT | 20 | The base amount you invest for each individual buy order. |
Max buy count | MAX_BUY_COUNT | 10 | Limits 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_CONTRACTS | 0 | Sets 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_SHORT | 0 | Similar 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. |
Leverage | LEVERAGE | 0 | Selects 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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | Configures 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. |
Direction | DIRECTION | LONG | Choose 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 variant | TREND_VARIANT | legacy | Choose a trend source when in AUTO mode:
|
Auto gain | AUTO_GAIN | True | Activates 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. |
Gain | GAIN | 0.5 | Manually 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 multiplier | GRID_MULTIPLIER | 1 | Adjusts 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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Use buy trailing | USE_BUY_TRAILING | True | Enables price trailing for long orders, allowing you to potentially benefit from continued price increases after an order is placed. |
Use custom buy trailing range | USE_CUSTOM_BUY_TRAILING | True | Activates the option to set a specific trailing percentage for buy orders, overriding the default trailing settings. |
Custom buy trailing range | BUY_TRAILING_PCT | 0.2 | Sets 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 trailing | USE_SELL_TRAILING | True | Enables price trailing for short orders, which can help in maximizing profit from price drops after placing an order. |
Use custom sell trailing range | USE_CUSTOM_SELL_TRAILING | True | Allows for the setting of a specific trailing percentage for sell orders, giving you control over how aggressively to trail price movements. |
Custom sell trailing range | SELL_TRAILING_PCT | 0.2 | Defines 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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Trading limit multiplier | TL_MULTIPLIER | 1 | Adjusts the investment amount for each consecutive buy order. For example, with a trading limit of 100 USDT and a max buy count of 3:
|
Minimum buydown | MIN_BUYDOWN | 0 | Sets 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 TL | KEEP_ONE_TL | False | When 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 sell | STOP_AFTER_SELL | False | Halts trading activities after the current holding is completely sold, preventing new buy trades during times when there is no balance available to sell. |
Buy enabled | BUY_ENABLED | True | Allows 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 enabled | SELL_ENABLED | True | Allows 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 period | SMAPERIOD | 50 | Defines 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 quote | KEEP_QUOTE | 0 | Specifies 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 delay | FIRST_ORDER_EXTRA_DELAY | 30 | Adds 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. |
Other parameters
Watch mode is respected.
Besides settings mentioned on this page, no other strategy setting has any effect on futuresgrid.