# Spotgrid

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.

{% hint style="info" %}
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.
{% endhint %}

## Trading behavior

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

![Typical spotGrid trades. Green arrows are buys, orange arrows are sells.](https://949519763-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_Rejuz9K0BDQxSQvUH%2F-MUEVAq-2UqowWF3GKCN%2F-MUTnXahar1sxEaMDOWL%2Fimage.png?alt=media\&token=0305e50e-cb94-4089-8e51-ee158da20ec4)

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:

![Slowly accumulating with same sized orders](https://949519763-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_Rejuz9K0BDQxSQvUH%2F-MUEVAq-2UqowWF3GKCN%2F-MUU31jnAo21fFDbu0Ot%2Fimage.png?alt=media\&token=acd40a39-0f99-4176-873d-3da09aaa747f)

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.

{% hint style="success" %}
The next trading targets are always visible on the chart.&#x20;

Keep in mind the targets lines are moving over time, they represent the current targets.
{% endhint %}

## How to create a spotGrid strategy

* Using the advanced strategy editor: create a new strategy and select spotGrid as buy and sell method
* Using Easy Edit: create a new strategy and select spotGrid as buy method

## Essential settings

To use spotGrid, there are just three essential settings:

| Setting                                                                                                                        | Description                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Trading limit**                                                                                                              | <p><strong>The amount to invest per buy order.</strong></p><p></p><p>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.</p> |
| **Max buy count**                                                                                                              | <p><strong>Limits how many buy orders are allowed.</strong></p><p></p><p>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.</p>                     |
| **Min volume to sell**                                                                                                         | <p><strong>To ignore tiny balances.</strong> </p><p></p><p>Set this to the minimum order size of the pair, to make the bot ignore small balances that cannot be sold. </p>                                                                |
| <p><em>for futuresGrid only</em>                   </p><p></p><p><strong>Max open contracts</strong>                      </p> | <p><strong>Limits position size</strong></p><p><br>On an USDT-BTC pair, setting max open contracts to 0.1 means that no buy order gets fired if it would result i the total position exceeding 0.1 BTC.</p>                               |

There are a few more settings that can optionally be used with this strategy, described below



## Additional settings

There are a few additional settings you can use with this strategy.

| Setting                                                | Description                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Stop after next sell**                               | <p><strong>To stop trading a pair after the position closes</strong></p><p></p><p>When enabled, no buy orders are placed when there is no balance left to sell. </p><p>Averaging down of the current position continues.  </p>                                                                                                            |
| **Auto gain**                                          | <p><strong>Activates dynamic sell target</strong> </p><p></p><p>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.</p>                                    |
| **Gain**                                               | <p><strong>Manual sell target value</strong></p><p></p><p>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.</p>                                                                                                |
| **Grid multiplier**                                    | <p><strong>Controls the distances between buy orders</strong> </p><p></p><p>Can be used to increase or decrease the distance between buy orders. </p><p></p><p>The default value 1 means that the hardcoded levels are used. </p><p>1.5 would increase the levels with a factor 1.5x, a value of 0.5 would halve the default levels. </p> |
| **Period**                                             | <p><strong>Sets the chart interval</strong></p><p></p><p>The default period is 15. Make sure to only use <a href="../../../how-to-work-with-gunbot/basic-workings/period#supported-period-values">supported period values.</a></p>                                                                                                        |
| **SMA period**                                         | <p><strong>How many candles are used for calculating support and resistance levels</strong> </p><p></p><p>By default 50 candles are used to calculate support and resistance. </p>                                                                                                                                                        |
| **Keep quote**                                         | <p><strong>Keep a number of units when selling</strong> </p><p></p><p>By setting keep quote at any number above 0, this number of units will be held back when the next sell order happens.</p>                                                                                                                                           |

{% hint style="info" %}
**Other parameters**

&#x20;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 spotGrid.
{% endhint %}

###
