Last updated: 8 Nov 2024
Disclaimer: In compliance with MiCA requirements, unauthorized stablecoins are subject to certain restrictions for EEA users. For more information, please click here.
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 BTC buy orders at every 1,000 USDT below the market price and place sell orders at every 1,000 USDT above the market price to take advantage of ranging conditions.
Grid trading performs 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 now supports USDⓈ-M and COIN-M Futures. You can customize and set grid parameters to determine the grid's upper and lower limits and the number of grids. Once the grid is created, the system automatically buys or sells orders at preset prices.
Let’s understand how it works.
You expect Bitcoin to hover in a price range between 50,000 USDT and 60,000 USDT 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 bot, including:
In this scenario, as the BTC price falls toward 55,000 USDT , the grid trading bot will accumulate buy positions on the way down at a lower-than-market price. As the price recovers, the bot will sell on the way up at a higher-than-market price. This strategy essentially attempts to profit from price reversions.
For more details, please read What Is 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 trade rationally within their financial ability.
1. Log in to your Binance account and go to [Futures]. Click [Trading Bots] - [Futures Grid].
If you’re using the app, go to [Futures] - [USDⓈ-M] or [COIN-M]. Tap [Grid] at the bottom left.
2. Select a symbol to execute the strategy and set the grid parameters. Select the grid direction (Long, Short, or Neutral), the range, the number of grids, and order size. Then click [Create] to confirm.
Please note that the following conditions might prevent the successful creation of a new grid:
Let’s use the USDⓈ-M Futures BTCUSDT Perpetual contract as an example to understand the process for grid trading.
For parameters #10 & #11:
You can place your grid limit orders immediately or trigger them when the market price reaches a certain value. The grid orders will be triggered when the market price (Last Price or Mark Price) rises above or falls below the trigger price you enter.
For parameters #1, #2,# 3,# 4, and #6:
You can determine a series of price levels according to the latest market price (buy, sell, mid-price), and 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. After that, you can wait for the limit orders to be triggered and executed.
For neutral grids, the strategy does not involve an initial position. Instead, the initial position is established only when the market exceeds the closest price point after the initial setup.
Example:
Suppose you have set your strategy parameters as such:
The price distribution will be as follows: 20,000 USDT, 25,000 USDT, 30,000 USDT, 35,000 USDT, 40,000 USDT, 45,000 USDT
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. 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:
Direction | Price |
Sell | 45,000 USDT |
Sell | 40,000 USDT |
Buy | 30,000 USDT |
Buy | 25,000 USDT |
Buy | 20,000 USDT |
Grid update means that every time a price point is touched, i.e., a 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 switched off, meaning it will not trigger any order. Buy or sell limit orders are then filled in again according to the set parameters to maintain the number of limit orders in the grid.
For example, the initial market price is 10,010 USDT , and the grid limit price at each unit is:
Price | Direction |
10,200 USDT | Sell |
10,100 USDT | Sell |
10,000 USDT | Buy |
9,900 USDT | Buy |
9,800 USDT | Buy |
Assuming that the price drops to 10,000 USDT and the buy order (the initial open position) is executed, the grid limit orders will become:
Price | Direction |
10,200 USDT | Sell |
10,100 USDT | Sell |
10,000 USDT | - |
9,900 USDT | Buy |
9,800 USDT | Buy |
Let’s assume the price then rises to 10,100 USDT, triggering the execution of the 10,100 USDT sell order. The grid limit orders will be updated as follows:
Price | Direction |
10,200 USDT | Sell |
10,100 USDT | - |
10,000 USDT | Buy |
9,900 USDT | Buy |
9,800 USDT | Buy |
If after that the price drops to 9,900 USDT, the two buy orders (10,000 USDT and 9,900 USDT) are then executed, and the grid limit orders will be subsequently updated as follows:
Price | Direction |
10,200 USDT | Sell |
10,100 USDT | Sell |
10,000 USDT | Sell |
9,900 USDT | - |
9,800 USDT | Buy |
And so on.
For parameter #12:
You can manually terminate the grid operation or set a Stop Trigger. There are 3 options for setting Stop Triggers:
You can also set whether you want to keep the position open when the grid take profit and stop loss trigger the termination. This setting is independent of other termination scenarios, such as termination due to insufficient margin.
For parameters #13:
You can choose to close all positions manually or automatically after the grid has been stopped.
When the close all positions on stop is enabled, the system will automatically close all open positions at market price for the symbol when the grid is stopped. This option will not affect your TP/SL settings. If the price reaches the TP or SL, your positions will be closed or remained open depending on your TP/SL settings.
Please note that during grid operation, the following scenarios will cause the grid to terminate:
The system will notify you if a grid is currently in operation. For example, the recommended grid trading leverage is below 20x. If the leverage continues to be higher than 20x, you will see a second reminder to lower the leverage.
Choose the contract on which the trading bot will be deployed.
All grids, whether in USDⓈ-Margined or COIN-Margined, operate in the Cross Margin mode by default.
In the Cross Margin mode, the margin is pooled together and shared among all trading pairs within the user’s strategy Futures account.
Start by adjusting the leverage. Please note that leverage magnifies both gains and losses. With leverage, you can magnify relatively small price movements to potentially create profits. However, leverage is a double-edged sword, please use it prudently.
*Cannot be modified after placing the grid order
Set the lower price and the upper price of the grid. If the highest or the lowest grid is exceeded, no more positions will be opened. For example, if the current BTCUSDT perpetual Futures price is 48,000 USDT and you expect the price will fall when it goes above 49,000 USDT. In this case, you can set the upper price to 49,000 USDT. After the price reaches 49,000 USDT, the grid will no longer open positions.
*Cannot be modified after placing the grid order
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 an 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: 1,000, 1,100, 1,200, 1,300, 1,400,... (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 into grid_count by an 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%: 1,000, 1,100, 1,210, 1,331, 1,464.1,... (the next price is 10% higher than the previous one)
*Cannot be modified after placing the grid order
Note: Price difference cannot be lower than the tick size, otherwise you need to adjust the 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)
If the profit/grid is less than the maker commission, you will be notified that the total grid profit may not be able to cover trading fees.
How to calculate? (The profit/grid displayed is for reference only)
1). Arithmetic grid
d = (grid_upper_limit - grid_lower_limit) / grid_count
c = TradingFeeRate (your current maker fee rate)
profit_per_grid_lower = (grid_upper_limit * (1-c)) / (grid_upper_limit-d) - 1 - c
profit_per_grid_higher = (1-c) * d / grid_lower_limit-2c
Example: Price interval = 1,000 - 2,000, Grid_count = 10, Commission = 0.1%
Price difference of each grid is = (2000-1000) / 10 = 100
profit_per_grid_lower = (2000*(1-0.1%)) / (2000-100) - 1 - 0.1% = 5.05%
profit_per_grid_higher = (1-0.1%) * 100 / 1,000 - 2 * 0.1% = 9.79%
2). Geometric grid
r = (grid_upper_limit/grid_lower_limit) ^ (1/grid_count)
c =TradingFeeRate (your current maker fee rate)
profit_per_grid_geo = (1-c) * r - 1 - c
Example: Price interval = 1,000 - 2,000, Grid_count = 10, Commission = 0.1%
Price ratio of each grid is = (2,000 / 1,000) ^ (1/10) = 107.18%
Profit/grid = (1 - 0.1%) * 107.18% - 1 - 0.1% = 6.97%
*Cannot be modified after placing the grid order
Initial margin = initial_value / leverage
You can adjust the percentage of the investable amount up to 100% (Initial margin = percentage * margin balance). Please note that it must be within the interval between the min_initial_margin and the margin balance.
For USDⓈ-M Futures Grid
Calculate the min grid qty:
min grid qty = max(minQty, minNotional/grid_lower_limit)
min_initial_margin= min grid qty * sum (price)/ (leverage * adjust_coef)
“assuming price” is defined as per the following formulas:
assuming_price (BUY) = price*
assuming_price (SELL) = max (mark_price, price)
*”price” is the price of every order in the grid trading strategy, automatically set by the grid parameters. This definition applies every time “price” is quoted moving forward in the article.
min_initial_margin = sum (min grid qty * assuming price + leverage * min grid qty * abs {min [0, side * (mark price - price)]}) / (leverage * adjust_coef)
Note: If you have set a trigger price, the mark price should be replaced by the trigger price.
For COIN-M Futures Grid
Calculate the minimum grid quantity:
min grid qty = minQty
min_initial_margin = min grid qty * sum (contract_multiplier / price) / (leverage * adjust_coef)
Define the assuming price:
assuming price (BUY)= min( mark price, price)
assuming price(SELL) = price
min_initial_margin = min grid qty * sum (contract_multiplier /assuming price + leverage * contract_multiplier * abs {min [0, side * (1 / Order's Price - 1 / mark price)]}) / (leverage * adjust_coef)
*”min grid qty” is the minimum trade amount of the symbol. You can find more details on the trading rules page.
*If you have set a trigger price, the mark price should be replaced by the trigger price.
*Currently, the adjust_coef has defaulted to 0.8. It will be adjusted according to market conditions.
*Cannot be modified after placing the grid order
Total Investment = Initial Margin * Leverage
For USDⓈ-M Futures Grid
Direction Neutral:
grid_qty = adjust_coef * initial_margin * leverage / sum (price)
Direction Long/Short Grid:
“assuming price” is defined as per the following formula:
assuming_price (BUY) = price
assuming_price (SELL) = max (mark_price, price)
grid qty = adjust_coef * initial_margin * Leverage / sum (assuming_price + leverage * abs (min (0, side * (mark_price-price)) ) )
*If you have set a trigger price, the mark price should be replaced by the trigger price.
For COIN-M Futures Grid
Direction Neutral:
grid qty = adjust_coef * initial_margin * leverage / sum (1 / price)
Direction Long/Short Grid:
“Assuming price” is defined as per the following formula:
assuming_price (BUY) = min(mark price, price)
assuming_price (SELL) = price
grid qty = adjust_coef * initial_margin * Leverage / sum(contract_multiplier /assuming_price + leverage *contract_multiplier* abs(min(0, side*(1 / price - 1 / mark price)) ) )
*If you have set a trigger price, the mark price should be replaced by the trigger price.
Under Default Mode, it will show the margin balance of your USDⓈ-M or COIN-M Futures account. Under Portfolio Margin Mode, you will see the available balance in your spot wallet.
*Optional, can be modified before the grid is triggered
1). Grid trigger type: When the last price or the market price you choose reaches the trigger price, the grid will start running.
2). Stop trigger type: When the last price or the market price reaches the top or bottom stop price, the grid will be stopped.
*Optional, can be modified after placing a grid order
Your grid order will be triggered when the last price or the mark price rises above or falls below the trigger price you set.
*Optional, can be modified after placing the grid order
1. Price Trigger
The stop_upper_limit price should be higher than the upper price, the last price, and the trigger price. When the latest market price reaches the Stop_upper_limit, the grid will stop working.
Stop_lower_limit price
The stop_lower_limitprice should be lower than the lower price, the last price, and the trigger price. When the latest market price reaches the Stop_lower_limit, the grid will stop working.
2. PNL Trigger
The calculation of the total profit will be based on the mark price, which may not be consistent with the data displayed on the page (the data displayed on the page is calculated by last price).
3. ROI% Trigger
The system will calculate the PNL corresponding to the ROI% you entered, and determine whether the conditions for triggering the TP/SL are met based on the estimated PNL.
4. Close All Positions on TP/SL Stop
You can also set whether or not you want to keep the position open when the grid take profit or stop loss triggers the termination. This setting is independent of other termination scenarios, such as termination due to insufficient margin.
*Optional, can be modified after placing the grid order
You can enable this function to automatically close all open positions of the symbol at the market price when the grid stops. This option will not affect your TP/SL settings. If the price reaches the TP or SL, your positions will be closed or remain open depending on your TP/SL settings.
*Please note that 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 could be liquidated in the event of extreme price movement. Binance shall not be liable for any of your losses.
position_notional = Latest_Mark_Price * size
position_notional_value = abs (position notional)
present notional = max (abs (position_notional + open order's bid_notional), abs (position_notional - open order's ask_notional))
*Abs: absolute value
open order's ask_notional = askNotional
open order's bid_notional = bidNotional