SpotGrid Trading Strategy
A grid like strategy with dynamic trading targets and integrated trailing for both buying and selling.
The idea of this strategy is to always be in a position, use market orders only, average down when prices goes down, take profit when price exceeds break even. And do so with an absolute minimum number of settings.
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 spotgrid 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 spotgrid 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.
SpotGrid settings​
Balance settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Trading limit | TRADING_LIMIT | 20 | This setting defines the base amount of USDT to invest for each buy order in the USDT-BTC trading pair. You can adjust this to match your trading strategy's capital allocation per transaction. |
Max buy count | MAX_BUY_COUNT | 40 | Specifies the maximum number of positions you can open before the strategy switches to sell-only mode. This limit is a multiple of the 'Trading limit', with the default maximum allowing for up to 40 positions. Once this limit is reached, no further buy orders will be placed until some positions are sold. |
Min volume to sell | MIN_VOLUME_TO_SELL | 10 | Defines the minimum order value in USDT that you can sell, preventing sales of negligible amounts. Ensure this setting aligns with your exchange's minimum order requirements. |
Max invested base | MAX_INVESTMENT | 999999999999999 | Limits the total investment in USDT for the USDT-BTC pair to prevent overexposure. Adjust this value based on your overall trading capital and risk management strategy. |
Customize targets​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | Chooses the time period of candles for calculating auto steps and trailing ranges. A shorter period increases trading frequency and potentially raises risk, affecting how dynamically your strategy reacts to price changes. |
Auto gain | AUTO_GAIN | True | Enables a dynamic profit target based on the distance between support and resistance levels, ensuring a minimum profit of twice the trading fees. This setting automatically adjusts as your position size increases and supersedes any set manual target. |
Gain | GAIN | 0.5 | Sets a fixed profit target as a percentage above your break-even price. With a default setting of 0.5%, a sell order is placed each time the price exceeds this threshold, ensuring consistent profit realization. |
Grid multiplier | GRID_MULTIPLIER | 1 | Adjusts the spacing between your buy orders. The default value of 1 uses predefined levels, while setting it higher increases the spacing (e.g., 1.5 increases it by 50%), and a lower value decreases the spacing, allowing for finer control over order placement. |
Advanced​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Stop after next sell | STOP_AFTER_SELL | False | This setting allows you to stop trading entirely once all current holdings are sold. Enabling this can be useful for strategies where you wish to pause operations after liquidating positions. |
Buy enabled | BUY_ENABLED | True | Controls whether buy orders can be placed. With this enabled, the strategy can continue to perform at its best by taking advantage of market opportunities as they arise. |
Sell enabled | SELL_ENABLED | True | Controls whether sell orders can be executed. Keeping this enabled ensures that you can always capitalize on profit-taking opportunities. |
Unit cost | unit_cost | True | Determines if the break-even price is calculated based on the average cost per unit remaining or for the entire order sequence. This choice impacts how exit strategies are managed, especially when dynamic logic is not in use. |
SMA period | SMAPERIOD | 50 | Defines the number of candles used to calculate support and resistance levels, which in turn helps determine buydown targets and trailing ranges. The default setting of 50 is a balanced choice for typical market conditions. |
Keep quote | KEEP_QUOTE | 0 | Specifies a quantity of BTC (quote currency) to retain and not sell. Setting this to 0.01 BTC, for example, ensures that this small amount remains in your balance, unaffected by sell orders. |
Ignore trades before | IGNORE_TRADES_BEFORE | 0 | Allows you to set a timestamp (in milliseconds) before which all previous trades are ignored. Useful for restarting strategies without considering past performance. |
Other parameters
Watch mode is respected.
Besides settings mentioned on this page, no other strategy setting has any effect on spotgrid.