Grid trading is a trading bot that automates the buying and selling of futures contracts. It is designed to place orders in the market at preset intervals within a configured price range.
Grid trading is when orders are placed above and below a set price, creating a grid of orders at incrementally increasing and decreasing prices. In this way, it constructs a trading grid. For example, a trader could place buy-orders at every $1,000 below the market price of Bitcoin, while also placing sell-orders at every $1,000 above Bitcoin’s market price. This takes advantage of ranging conditions.
Grid trading performs the best in volatile and sideways markets when prices fluctuate in a given range. This technique attempts to make profits on small price changes. The more grids you include, the greater the frequency of trades will be. However, it comes with an expense as the profit you make from each order is lower.
Thus, it is a tradeoff between making small profits from many trades, versus a strategy with lower frequency but generates a bigger profit per order.
Binance Grid Trading is now live on USDⓈ-M Futures. Users can customize and set grid parameters, to determine the upper and lower limits of the grid and the number of grids. Once the grid is created, the system will automatically buy or sell orders at preset prices.
Let’s understand how it works.
Suppose you expect Bitcoin to hover in a price range between $50,000 to $60,000 in the next 24-hours. In this case, you could set up a grid trading system to trade within this predicted range.
On the grid trading panel, you could set parameters of the strategy, including:
- The upper and lower boundaries of the price range,
- The number of orders to be placed within the configured price range,
- The width between each buy- and sell-limit order.
In this scenario, as the price of Bitcoin falls towards $55,000, the grid trading bot will accumulate buy positions on the way down at a lower price than the market. As prices recover, the bot will sell on the way up at a higher price than the market. This strategy essentially attempts to profit from price reversions.
Read more about Long Short Grid Trading.
Risk Warning: Grid trading as a strategic trading tool should not be regarded as financial or investment advice from Binance. Grid trading is used at your discretion and at your own risk. Binance will not be liable to you for any loss that might arise from your use of the feature. It is recommended that users should read and fully understand the Grid Trading Tutorial and make risk control and rational trading within your financial ability.
Set-up Your Grid Trading Strategy
1. After logging in, go to the USDⓈ-M Futures trading interface and click [Grid Trading].
If you’re using Binance App, tap [Futures] - [USDⓈ-M Futures] - [Grid Trading].
2. Select a symbol to execute the strategy and set the grid parameters. Click [Create] to confirm.
Please note that the following situations may cause grid creation to fail:
- When you are currently running a grid trading on the selected symbol.
- When you have open orders or positions on the selected symbol.
- When you are under hedge position mode, please adjust to one-way mode.
- When you exceed the limit, the total quantity of working and limit triggered grid trading is 10.
Grid Trading Mechanism
The grid trading life cycle:
- Grid Trigger (optional)
- Initial structure
- Open position
- Grid Update
- Stop Trigger (optional)
- Cancellation
Setting a Grid Trigger (optional)
For parameters #10 & #11:
Users can choose to start grid limit orders immediately or choose to trigger when the market price reaches a certain value. The grid orders will be triggered when the chosen trigger price (Last price or Mark price) rises above or falls below the trigger price you enter.
Defining the initial structure of grid strategy
For parameters #1, #2,# 3,# 4 & #6:
The initial structure is to determine a series of price levels, according to the latest market price (buy, sell, mid-price), place sell limit orders at a price higher than the market price, and a buy limit order at a price lower than the market price, and wait for the price to be triggered.
Note that the number of limit orders is the number of grids +1 at the time of initial construction because no positions are held. One of them (the one near the latest market price) is the initial opening order waiting to be executed;
Initial creation process
For neutral grids, the strategy will begin with no initial position. The initial position will be triggered when the market trades beyond the nearest price point after the initial construction.
Example:
Suppose you have set your strategy parameters as such:
Contract: BTCUSDT Perpetual
Lower price: $20,000
Upper price: $45,000
Number of grids: 5
Mode: Arithmetic
The price distribution will be as follows: $20,000, $25,000, $30,000, $35,000, $40,000, $45,000
Initial sell orders for the neutral grid will be placed above the current market price. Meanwhile, the buy orders will be populated below the current market price. Do note that the price nearest to the market price would be excluded. In this scenario, the initial grid limit orders will be populated as such:
Side | Price |
Sell | $45,000 |
Sell | $40,000 |
Buy | $30,000 |
Buy | $25,000 |
Buy | $20,000 |
Grid Update
Grid update means that every time a price point is touched i.e. limit order is filled, the grid limit order will update in time. The price of the most recently executed order will always be the one that is left blank, then buy or sell limit orders are filled in again according to the set parameters, thus the number of limit orders in the grid is maintained, as shown in the following example.
The initial market price is $10,010, and the grid limit price at each unit is:
Price | Direction |
$10,200 | Sell |
$10,100 | Sell |
$10,000 | Buy |
$9,900 | Buy |
$9,800 | Buy |
Assuming that the price drops to $10,000 and the buy order is executed, it is the initial open position, and the grid limit order becomes:
Price | Direction |
$10,200 | Sell |
$10,100 | Sell |
$10,000 | - |
$9,900 | Buy |
$9,800 | Buy |
The price rises to $10,100 and the sell order is executed, and the grid limit orders are updated as follows:
Price | Direction |
$10,200 | Sell |
$10,100 | - |
$10,000 | Buy |
$9,900 | Buy |
$9,800 | Buy |
When the price drops to $9,900 and two buy orders are executed, the grid limit orders are updated as follows:
Price | Direction |
$10,200 | Sell |
$10,100 | Sell |
$10,000 | Sell |
$9,900 | - |
$9,800 | Buy |
And so on.
Setting a Stop Trigger (optional)
For parameter #12:
Users can choose to manually terminate grid operation or to set Stop Trigger.
Stop Trigger means that when the market price rises above Stop_upper_limit or falls below Stop_lower_limit i.e. the market is no longer following a swinging trend, the grid will stop its operation.
Order Cancellation
For parameters #13 & #14:
Users can choose whether to cancel all orders and close all positions manually or automatically after the grid is stopped.
When 'cancel all orders' on stop is enabled, the system will automatically cancel all the unfilled orders for the symbol when the grid is stopped; When close all positions on stop is enabled, the system will automatically close all the open positions at the market price for the symbol when the grid is stopped
Note that during the grid operation, the following scenarios will cause the grid to terminate:
- Manually terminate the grid;
- Insufficient margin causes some positions to be liquidated or fail to place orders;
- Manually cancel some or all grid limit orders;
- Manually close some or all grid positions;
- When the delivery contract is delivered, the product no longer exists and the grid strategy will be automatically stopped. During the delivery process, the system will automatically remove user limit orders and settle open positions.
The system will prompt for above actions if a grid is currently in operation, notification as shown below:
The recommended grid trading leverage is lower than 20, because when the leverage is too high, the insufficient margin may cause position liquidation or opening order, and lead the grid to terminate. If the leverage is higher than 20x, a second confirmation will pop up to remind users.
Grid Trading parameters
1. Choose a symbol
The first parameter that you must select is the contract on which the trading bot will be deployed.
2. Select Cross/Isolated margin mode
Determine the type of margin for the grid trading position: Isolated or Cross margin modes. In an isolated margin mode, the margin is independent in each trading pair. Meanwhile, the margin is shared between all trading pairs in the futures account for cross margin mode.
3. Adjust leverage
Select your desired leverage amount. Leverage magnifies both gains and losses. With leverage, you can magnify relatively small price movements to potentially create profits that justify your time and effort. But do bear in mind that leverage is a double-edged sword, and you must use it prudently.
4. Lower & Upper price
Set the lower price and the upper price of the grid (cannot be modified after the grid order is placed). If the highest or lowest grid is exceeded, no more positions will be opened. For example, if the current BTCUSDT price is $48,000, the user judges that the price will fall when it reaches above $49,000, in this case, the upper price can be set to $49,000. After the price reaches $49,000, the grid will no longer open positions.
5. Mode: Arithmetic / Geometric (cannot be modified after the grid order is placed)
Arithmetic: Each grid has an equal price difference.
The arithmetic grid divides the price range from grid_lower_limit to grid_upper_limit into grid_count by equal price difference.
The price difference of each grid is:
price_diff = (grid_upper_limit - grid_lower_limit) / grid_count
Then it constructed a series of price intervals:
price_1 = grid_lower_limit
price_2 = grid_lower_limit + price_diff
price_3 = grid_lower_limit + price_diff * 2
...
price_n = grid_lower_limit + price_diff * (n-1)
At grid_upper_limit,n = grid_count
Example: Arithmetic price_diff = 100: 1000, 1100, 1200, 1300, 1400,... (the next price is 100 higher than the previous one)
Geometric: Each grid has an equal price difference ratio.
The geometric grid divides the price range from grid_lower_limit to grid_upper_limit by into grid_count by equal price ratio.
The price ratio of each grid is:
price_ratio = (grid_upper_limit / grid_lower_limit) ^ (1/grid_count)
The price difference of each grid is:
price_diff_percentage = ( (grid_upper_limit / grid_lower_limit) ^ (1/grid_count) - 1) * 100%
Then it constructed a series of price intervals:
price_1 = grid_lower_limit
price_2 = grid_lower_limit* price_ratio
price_3 = grid_lower_limit * price_ratio ^ 2
...
price_n = grid_lower_limit* price_ratio ^ (n-1)
At grid_upper_limit,n = grid_count
Example: Geometric grid price_diff_percentage = 10%: 1000, 1100, 1210, 1331, 1464.1,... (the next price is 10% higher than the previous one)
6. Grids (i.e. number of limit orders) — cannot be modified after the grid order is placed.
The minimum is 2 and the maximum is 149
Note: Price difference can't be less than tick size, otherwise it requires to adjust Grid_count or Grid upper/lower limit.
How to calculate?
1. Arithmetic grid, price_diff=(grid_upper_limit - grid_lower_limit)/gridCount<tickSize
2. Geometric grid, min_price_diff=grid_lower_limit*price_ratio<tickSize , price_ratio = (grid_upper_limit / grid_lower_limit) ^ (1/grid_count)
7. Profit/grid (fees deducted)
Note that if Profit/grid is below maker commission, the system will prompt that the total grid profit may not cover trading fee.
How to calculate? (Profit/grid is estimated and for reference only)
1. Arithmetic grid
profit_per_grid_lower=[1+ (grid_upper_limit - grid_lower_limit)/(grid_count* grid_upper_limit )]*(1-commission%)^2-1
profit_per_grid_higher=[1+(grid_upper_limit - grid_lower_limit)/(grid_count*grid_lower_limit)]*(1-commission%)^2-1
For example: Price interval 1000-2000,Grid_count 10,Commission 0.1%,then the price difference of each grid is: (2000-1000)/10=100,profit_per_grid_lower = ((2000+100)/2000)×(1-0.1%)×(1-0.1%)-1=4.79%;profit_per_grid_higher = ((1000+100)/1000)×(1-0.1%)×(1-0.1%)-1=9.78%
2. Geometric grid:
profit_per_grid_geo=(grid_upper_limit/grid_lower_limit)^(1/grid_count)-1-2*transaction fee%
For example:Price interval 1000-2000,Grid_count 10,Commission 0.1%,then the price ratio of each grid is: (2000-1000) ^ (1/10) = 107.18%, Profit/grid = 107.18%-1-2×0.1%=6.98%
8. Initial margin (cannot be modified after the grid order is placed)
Initial margin = initial_value / leverage
User can manually input or drag the slider (the percentage of the investable amount is up to 100%, Initial margin = percentage * margin balance), and it must be within the interval between the min_initial_margin and the margin balance.
min_initial_margin= minQty*sum(price)/(leverage*adjust_coef)
minQty: the minimum grid_qty
adjust_coef: the current default is 0.9, it will be adjusted according to market conditions
9. Total investment (cannot be modified after the grid order is placed)
Total investment = Initial margin * leverage
After leverage is set,the minimum Initial_value = sum(price * minQty);the maximum Initial_value = margin * leverage
10. Qty/Order (i.e. Grid quantity)
grid_qty = adjust_coef * initial_margin*leverage / sum(price)
11. Available margin balance (i.e. margin balance of USDⓈ-M Futures account)
12. Trigger_type: Last price / Mark price(Optional, can be modified before the grid is triggered)
1. Grid trigger type: When the last price or market price you choose reaches the set trigger price, the grid will start running.
2. Stop trigger type: When the last price or market price of the symbol you choose reaches the set top or bottom stop price, the grid will be stopped.
13. Trigger_price(Optional, can be modified before the grid is triggered)
The grid orders will be triggered when Last Price / Mark price rises above or falls below the trigger price you enter.
14. Stop_upper_limit / Stop_lower_limit , i.e. Stop loss top price / Stop loss bottom price (Optional, can be modified before the grid is triggered)
1. Stop_upper_limit
Stop loss top price should be higher than upper price, last price and trigger price; when the latest market price reaches Stop_upper_limit, the grid will stop working.
2. Stop_lower_limit
Stop loss bottom price should be less than lower price, last price and trigger price; when the latest market price reaches Stop_lower_limit, the grid will stop working.
15. Cancel all Orders on Stop (Optional, ticked by default, can be modified before the grid is triggered)
Enable cancel all orders on stop to automatically cancel all unfilled orders for the symbol when the grid stops; when disabled, you can cancel all manually after the grid stops.
16. Close all Positions on Stop (Optional, can be modified before the grid is triggered)
Enable close all positions on stop to automatically close all the open positions at the market price for the symbol when the grid stops; when disabled, you can close all positions manually after the grid stops.
*The above parameter setting suggestions are for reference only. Futures trading carries a substantial risk and the possibility of both significant profits and losses. Past gains are not indicative of future returns. All of your margin balance may be liquidated in the event of extreme price movement.
How to check Active Grid
Time | Creation time of the grid |
Symbol | For contracts in grid trading, users can click on the leverage displayed next to the symbol to adjust the grid leverage. |
Initial Margin | Margin at the time of grid creation |
Total Profit | Total profit=Grid profit + Unrealized P&L Notes:
|
Total profit % | ROI = Total Profit / initial_margin * 100% |
Realized profit | Realized profit and loss from grid trading Cumulative profits of all completed orders. For arithmetic grid type, total profits = number of completed orders * Profit/grid - total commission |
Unrealized P&L | Unrealized profit and loss on open orders calculated based on Mark Price / Last Price, and return on equity percentage |
Duration | Starting from the grid creation, when the operation time exceeds 1 day, the operation time is displayed as 1d2h9m; when the operation time exceeds 1 year, the operation time is displayed as 1y1d2h9m, updated every minute; if the operation time is less than 1 minute, it is displayed as — |
Liq. Price | Please refer to the calculation of liquidation price |
Grid Status |
|
- Adjust margin
Adjust margin is available only on Isolated margin mode.
- Termination
Click on termination to stop grid operation. Users can choose whether to cancel unfilled orders and close all positions manually or automatically after the grid is stopped.
When "cancel all orders on stop" is enabled, the system will automatically cancel all the unfilled orders for the symbol when the grid is stopped; When close all positions on stop is enabled, the system will automatically close all the open positions at the market price for the symbol when the grid is stopped.
- Check Grid Detail
How to calculate Current Margin
position_notional_value=Latest_Mark_Price * abs(size)
present notional = max(abs(position_notional_value + open order's bid_notional), abs(position_notional_value - open order's ask_notional))
open order's ask_notional=askNotional
open order's bid_notional=bidNotional
- Crossed margin:
Current margin = present notional / current leverage
- Isolated margin:
Current margin=(present notional-position_notional_value)/ leverage + isolatedWalletBalance
*Abs: absolute value
- Active Order
The Active order shows all open orders(including partial filled)
Buy order book: sort by limit order price from high to low, top to bottom
Sell order book: sort by limit order price from low to high, top to bottom
- Completed orders
A summary of all completed orders. Each transaction consists of a pair of the corresponding buy and sell orders, the transaction type is FILO (First In Last Out), profits can be calculated based on each pair of matched buy and sell orders, and the remaining order awaiting to be matched will have profits displayed as --。
BNB commission fee is converted into margin assets at the real-time exchange rate at the time of the transaction.
How to check History
Click on the [History] tab to check grid transaction history and view grid details and completed orders.
Grids Status
- Canceled: State after manually terminating the grid
- Expired: Forced termination due to reasons as below.
Expiration Reason | |
1 | Failed to place an order. |
2 | Strategy manual termination successful |
3 | Manually placing or cancelling an order of {{symbol}} has stopped the grid |
4 | Market price has reached set grid strategy stop-loss price |
5 | Position has been liquidated |
6 | Maximum open order quantity reached |
7 | Insufficient margin account balance |
8 | The order price is above the limit |
9 | The market is closed or paused. |
10 | Failed to close position, unable to fill |
11 | Exceed the maximum allowable notional value at current leverage |