Grid Bot

Available to Professional Users only

A Grid Bot allows a user to set up a grid trading strategy. Grid trading is a strategy in which a trader earns from the spread between the bid and offer prices.

For example, if a buy order is placed at 1000 USD and a sell order is placed at 1100 USD for the same amount of token, the trader would have pocketed 100 USD in profit if both buy and sell orders were filled.

The simplicity (yet complexity due to the surrounding logic) of grid trading appeals to many traders. Even some of the largest hedge funds use grid trading for their market-making strategies.

In fact, most grid strategies have multiple layers of bid and offer prices.

Although grid trading is simple on its own, there are still many complexities and logics surrounding it. However, StockHero is able to simplify these complexities and offer our users an easy-to-deploy grid bot.

This is how a grid strategy works with multiple layers:

Assuming there are two layers, a user will place two buy and two sell orders for a stock as follow:

Sell Level 2: 3100

Sell Level 1: 3000

Buy Level 1: 2900

Buy Level 2: 2800

If both Buy Level 1 and Sell Level 1 trades are filled, the user would have pocketed 100 USD in profit, assuming 1 unit of the stock is transacted. This 100 USD in profit is known as the spread profit. And the spread percentage is about 3.4%. If Buy Level 2 and Sell Level 2 trades were filled, the same user would have earned 300 USD. Collectively, 400 USD in profit would be earned from this single grid strategy, yielding 7% (400 / (2900+2800)) in net profit.

It may seem that a grid trading strategy is a sure-win, but it is not. Grid trading would fail when the market suddenly moves out of range on either the buy or sell side, causing the grid strategy to be handicapped or one-legged. Hence, timing when to create your grid trades and when to exit is important.

Using StockHero Grid Bot

To deploy a grid strategy, you will need both the stock itself and your native currency to place a buy order. For example, if you want to a deploy grid strategy for the AAPL pair, you will need both AAPL and USD assets. This is because the bot will be placing buy orders using USD and sell orders using AAPL.

However, if you are running the bot connected to a margin account that allows you to place Margin-Short orders (without the need to own the physical stock), the DCA bot will still require you to own AAPL shares in order to place sell trades on the opposite side. This is because you cannot simultaneously have both margin-shorts and long-buy positions existing at the same time.

Understanding Mid Price

Mid price is the middle price between the closest bid and offer price. For example, if AAPL order book is currently looking like:

Sell Level 2: 3001

Sell Level 1: 3000

Buy Level 1: 2996

Buy Level 2: 2997

the mid price will be 2998 USD.

Upper Range Sell Price Limit

This configures the grid bot to place your sell orders below the sell price limit. For example, if the current mid price of the AAPL order book is 2998 USD and the Upper Range Sell Price Limit is 10%, the grid bot will not place any orders above 3297.80 USD (2998 x 110%).

Lower Range Buy Price Limit

This configures the grid bot to place your buy orders above the buy floor price limit. For example, if the current mid price of AAPL order book is 180 USD and the Lower Range Buy Price Limit is 10%, the grid bot will not place any orders below 162 USD (180 x 90%).

No. of Orders Between Mid Price and Range Limit

This indicates the total orders to place between the mid price and both buy and sell range limits (as described above). The orders will be placed at equal price distances. For example, if the number of orders is 3, the buy orders will be placed at the following price levels in steps of 6 USD ((180 - 162) / 3) :

174 USD

168 USD

162 USD

Per Order Amount

This indicates how much of an asset to buy or sell.

After entering all the values, StockHero will automatically calculate how many assets you need in order to run this grid strategy.

Entry Condition

A key criteria for running a good grid strategy is knowing when to start one. StockHero Grid Bot offers users three options for their entry condition. We will explain the Range condition.

The idea of the Range entry condition is that grid trading is typically more successful in a range-trading pattern. Any breakouts would invalidate a grid strategy. Hence, in order to determine a range trading pattern, a user may select the Range condition.

The range is measured using the highest and lowest CLOSED price of a candlestick. A range is confirmed to occur if it fulfills the values set by the user.

When should you use the Lesser condition and when should you use the Greater condition? A Lesser condition is a safer bet due to its lagging nature in confirming that a range trading pattern has started. A more aggressive trader would select Greater condition if he or she wanted to enter a grid trade almost immediately after a breakout or crash.

Exit Condition

Knowing when to exit an unfavorable grid trading position is as important as knowing when to enter.

StockHero Grid Bot will automatically close a deal if all buy and sell orders are filled. However, there are situations when a user may want to exit the grid trade entirely. A user can set the maximum Wait Time for the grid bot to wait for all its buy/sell orders to be filled. The grid bot can also be configured to exit if a breakout occurs. This is determined by the Outer Range Limit value.

For example, if the Outer Range Limit is set at 5% and we use the above AAPL example of 10% as the Range Limits, the grid bot will exit if the price of AAPL exceeds 5% above 3297.80 = 3462.69 USD.

A user can choose what to do with the remaining unfilled orders if the grid bot exits. Some users prefer to leave the open orders hanging in order to keep the previous grid strategy intact. After all, if all buy and sell orders are filled, the grid strategy is considered successful, and the bot automatically restarts with a new set of grid trades.

Please note that the backtest feature is not available for a grid bot.

Last updated