Articles on: Signals and Automation

Grid Bot Processing

Bot set up (example)



The distance between the upper and lower prices is divided by the number of orders to get the grid size/spacing between grids. e.g. upper = 80, lower = 70, grids = 10, then the grid size is 1.
You might notice that you would actually need 11 grids from 70 to 80 in steps of 1. However, one of the gaps between grids is double-sized: the trade-free zone.
It moves up and down with the current price. So when the grid bot starts you will have X buy orders spaced at intervals of 1 from the lower price to just below the current price.
The remaining (10 - X ) orders will be sell orders starting from the upper price and spaced according to the grid going down.
So if the current price is 77.2, There would be Buy orders at 70, 71, 72, 73, 74, 75, 76, 77. And Sell Orders at 79, 80.
That's 10 orders on the grid, with a double gap around the current price for the trade-free zone.
If the investment amount is 500USDT, then the amount of base currency for the grid is calculated using the investment amount divided by the (current price + 1%).
In this case the total amount of base ccy would be 6.4125, with 0.64125 bought or sold at each grid level.
If there is no base currency already available, or not enough base currency, then the first thing for the bot to do is market buy enough base currency to cover the sells above the current price. (As soon as the bot is Saved, a limit order is placed at 1% above the current price.)
So in this case, 1.2825 of base currency is bought immediately. Then the remaining orders are all placed: 8 buys and 2 sells.
If the price goes down to 77, that buy order will be filled and a new Sell order is placed at 78.

Notifications



You will not receive Push Notifications or email notifications of grid bot trades, since these would soon overwhelm your Inbox.

You will receive notifications of grid bot errors. Check these to see if your bot needs any attention

Investment currency/s



You can define what's used initially--QUOTE or BOTH currencies (both base and quote currency).
When BOTH is used, if you have enough base currency, it would be used to cover the initial sell orders. But some quote currency is also needed for the buy orders. So either you can provide that, or some base ccy will be sold to cover those orders. After the bot has started, only the coins already allocated are used, with profits going to quote currency.

Trailing Up



Trailing Up is triggered when the current price reaches one grid level above the upper price.
The bottom Buy order is cancelled and and a new Buy is placed place a step above the grid to get some funds for the next Sell.
The Buy is placed at the grid Upper price (which would have been empty).
If the price reverses enough to fill that sell order, then a Sell order is placed one step above.
If the Buy order doesn't fill and the price moves up another step, then the current bottom Buy order is cancelled and a new Buy is placed above the last one.
So effectively the whole grid is being moved up.

The danger with trailing up is:
If your initial entry involved Selling base currency and Buying Quote currency, then when the price increases your initial buy is losing value, which creates negative floating PnL.
Orders above the grid will be more expensive than those in the grid. For TU, the lowest buy order is cancelled and funds used to create a buy order at the top of the grid--the orders will become more expensive as the grid trails up! Beware running out of quote currency. If the order size becomes greater than your available funds, you will continue to receive error messages about not being able to place Buy orders. The best thing to do at this point is to re-grid your bot, i.e. edit it, change the price range (if you think a new range is appropriate), make your orders smaller, and/or leave some quote currency available for the larger order sizes.

When to use Trailing Up

The best use for Trailing Up is for following the rising price and moving your Grid to a new, stable range. With Trailing Up, you don't have to manually move your grid when the price moves up.
Trailing is generally not a profitable mode for a grid bot, so it's best to only use it for this purpose.
Trailing Up is generally not recommended for markets that spike up and then return to the original range. In this case, it is more profitable to include the price spikes in the grid range rather than Trailing Up and Down with the spikes.

Trailing Down



Trailing down is triggered when the current price reaches one grid level below the lower price.

The top sell order is cancelled and a new sell is placed at the bottom of the grid to sell some coins in order to have funds for the next buy order.
The sell is placed at the grid lower price (which would have been empty).
If the price reverses enough to fill that sell order, then a Buy order is placed one grid below it.
If the sell order doesn't fill and the price moves down another grid level, then the current top sell order is cancelled and a new sell is placed one step below the last one.
Effectively the whole grid is being moved down. No extra funds are used or needed for trailing down.

The 2 dangers with trailing down are:
Order sizes will get smaller due to lower prices. If an order size is less than the minimum for the exchange, the exchange will reject it with an error message. The bot will keep trying to place the order, but will fail. The solution is to either pause the bot, edit it to increase the order size, or wait until the price moves up again.
If your initial order was to Buy base currency, then when the price decreases your initial buy is losing value, which creates negative floating and unrealised PnL.

When to use Trailing Down

Similarly to Trailing Up, the best use for Trailing Down is for following the falling price and moving your Grid to a new, stable range. With Trailing Down, you don't have to manually move your grid when the price moves down.
Trailing is generally not a profitable mode for a grid bot, so it's best to only use it for this purpose.
Trailing Down is generally not recommended for markets that spike down and then return to the original range. In this case, it is more profitable to include the price spikes in the grid range rather than Trailing Up and Down with the spikes.

Take Profit



The Take Profit price is static--it does not move up if your bot trails up, or down if your bot trails down. When the price reaches your Take Profit price, the bot will Stop, and all orders will be cancelled. If you have selected one of the options: Convert to Base currency or Convert to Quote currency, then that instruction will be applied to the funds released from your orders, but not your profits or any coins set aside for fees.

When your bot reaches the top of the grid (and your Take Profit price), all orders in the grid will be Buy orders, and all order funds will be in Quote currency. So if you select the option to Convert to Quote, no additional action will be taken by the bot

Stop Loss



As for the Take Profit, the Stop Loss price is static--it does not move up if your bot trails up, or down if your bot trails down. When the price reaches your Stop Loss, it will Stop, all orders will be cancelled, f you have selected one of the options: Convert to Base currency or Convert to Quote currency, then that instruction will be applied to the funds released from your orders, but not your profits or any coins set aside for fees.

When your bot reaches the bottom of the grid (and your Stop Loss price), all orders in the grid will be Sell orders, and all order funds will be in Base currency. If you have selected the option to convert to base currency, then no additional action will be taken by the bot.

Editing a Grid Bot


When you edit a grid bot, if there are existing orders, the value of those is counted in the balance for the account.

When you edit a grid bot that has been running, the currency option will default to BOTH (i.e. use both your Base and Quote currencies to fund the bot). It will add together the funds already in your account with the funds that will be available once the current orders have been cancelled.



Grid Bot Settings
Grid Bot Error Messages
Grid Bot Analytics
Grid Bot Backtesting in Altrady

If you have further questions, please contact Customer Support, liked at the bottom of this page.

Updated on: 27/01/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!