Spotgrid Advanced
Last updated
Last updated
A grid like strategy with dynamic trading targets and integrated trailing for both buying and selling.
Based on spotGrid, with additional configuration options, trend detection and 'continuous trading'.
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.
CT, short for 'continuous trading', is a mechanism that lets you keep trading profitably even when the current price is far below the overall break even price.
The principle is very simple: if price is above the price of the last buy order, up to the number of units bought in this trade can be sold for a small profit in base and in quote. The base profits you keep, the quote profits can help bring down break even of the overall position.
Besides the small profits from these partial trades, it allows your strategy to follow the market price more closely and sometimes fit in more DCA trades in one price range, compared to only waiting for prices to go down further to DCA.
The chart above shows several CT trades. Each sell order on this chart is only working with the units bought with the previous buy order. The number of units to 'CT sell' is configurable using the continuous trading limit multiplier, setting this to 1 would sell approx. the same number of units as last bought, 0.5 would sell approx. half of the units last bought.
Assuming your settings allow CT orders:
When price goes down after a DCA order: another DCA order gets placed when grid DCA target is hit.
When price goes up after a DCA order: CT sell target is set above last buy rate, using 'gain' or 'auto gain'. When the target is reached, a CT sell order is placed.
When price goes down after a CT sell order: if grid DCA target is reached, a 'CT buy' order is placed for approx. the same number of units as the CT sell order. The position size after this order is more or less identical compared to before the CT sell order.
When price goes down after a CT buy order: a normal DCA order is placed when the DCA target hits.
When price goes up after a CT sell order: if price is below break even and the distance between last sell rate and current price is more than the distance between first support and resistance, a new CT buy order gets placed.
Manual trading or changing settings related to trading limit can disrupt continuous trading.
If you use CT, make it a habit to only change trading limit settings after a complete sell order.
Using the advanced strategy editor: create a new strategy and select spotGridAdvanced as buy and sell method
Using Easy Edit: create a new strategy and select spotGridAdvanced as buy method
To use spotGridAdvanced, there are just three essential settings:
Setting
Description
Trading limit
The 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.
Max buy count
Limits how many buy orders are allowed.
Setting a max buy count of 10 means that the bot may do up to 10 buy orders in a row, to average down in ever increasing price distance.
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.
There are a few more settings that can optionally be used with this strategy, described below
There are a few additional settings you can use with this strategy.
Setting
Description
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.
Auto gain
Activates dynamic sell target
Enabled by default. The dynamic target is based on the distance between support and resistance, capped at a minimum profit of 2x trading fees. The target decreases when position size increases. Overrules a manually set target.
Gain
Manual sell target value
Set a manual sell target, as a percentage above the break even price. The sell target is where trailing starts. With 0.5 as value, the sell target is 0.5% above break even.
Grid multiplier
Controls the distances between buy orders
Can be used to increase or decrease the distance between buy orders.
The default value 1 means that the hardcoded levels are used.
1.5 would increase the levels with a factor 1.5x, a value of 0.5 would halve the default levels.
Period
SMA period
How many candles are used for calculating support and resistance levels
By default 50 candles are used to calculate support and resistance.
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.
Trading limit multiplier
Controls the invest per DCA trade
Can be used to increase or decrease the invested amount with each consecutive buy order. Examples with trading limit 100 USDT and max buy count 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'
Trailing range multiplier
Controls how big trailing ranges are
Can be used to increase or decrease the trailing range for all order types.
Default value 1 means that the hardcoded range is used. 1.5 would increase the range with a factor 1.5x, a value of 0.5 would halve the default trailing range
Start continuous trading
Controls from which number of buy orders continuous trading is allowed
A value of 3 means that when the position is 3x trading limit in size, the next sell target is placed above the last buy rate instead of above break even. Set a very high value to effectively disable this feature.
Continuous trading limit multiplier
Controls how much funds to use for CT
Sets the ratio between last buy order invest in base, and the amount used for trades during continuous trading.
Value between 0 and 1. When set to 0.5, halve of the base amount used for the previous DCA trade will be used for continuous trading.
Setting 1 would use the same amount as the last DCA buy order.
Continuous trading restart multiplier
Sets the minimum distance between a CT sell and a buy above that Default is 1, should usually not be changed.
Examples: 1: buy target above last sell rate is placed once price is 1x the distance between sup/res above last sell rate
0.5: buy target above last sell rate is placed once price is 0.5x the distance between sup/res above last sell rate
There is a hardcoded minimum distance of 2x trading fees.
This strategy can use a built in trend watches that monitors various indicators on 15m and 4h charts. You can use this to easily try to trade more when the market is actually favorable, and reduce risks when the market is going down.
Of course no trend detection is perfect, this one will be no exception. If you have a strong personal opinion about trend, it's probably a good idea to stick to that.
Setting
Description
Only open when trend is bullish
Avoid opening a new trade when market looks down
When enabled, new positions are only opened when both 4h and 15m charts indicate a bullish market.
This check is independent from the PERIOD in your strategy. Requires the exchange to offer both 15m and 4h candle data
No DCA when trend not bullish
Don't DCA while the market is bearish
When enabled, DCA trades are only allowed when both 4h and 15m charts indicate a bullish market
This check is independent from the PERIOD in your strategy. Requires the exchange to offer both 15m and 4h candle data
Double DCA distance when trend not bullish
Increase DCA distance while the market is bearish
When enabled, the DCA distance gets doubled when the 4h and/or 15m chart do not indicate a bullish market
This check is independent from the PERIOD in your strategy. Requires the exchange to offer both 15m and 4h candle data
Trend CT grid multiplier
Use a different CT buy target when trend is not bullish
Multiplier to adjust CT buy target while trend is not bullish and TREND_LOWER_DCA is used
A value of 2 would double the distance, a value of 1 results in the same behavior as when TREND_LOWER_DCA is disabled
Trend grid multiplier
Use a different grid multiplier when trend is not bullish
Multiplier to adjust the next DCA target while trend is not bullish and TREND_LOWER_DCA is used
A value of 2 would double the distance, a value of 1 results in the same behavior as when TREND_LOWER_DCA is disabled
Other parameters
Buy and Sell enabled options can be set as pair overrides. Watch mode is respected.
Besides settings mentioned on this page, no other strategy setting has any effect on spotGridAdvanced.