What Is Futures Grid Trading
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. 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.
How does Poloniex futures grid trading work?
You can customize and set grid parameters to determine the grid's upper and lower prices and the number of grids. Once the grid is created, the system automatically buys or sells orders at preset prices.
For example,
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 strategy, including:
- The upper and lower boundaries of the price range;
- The number of grids;
- The number of orders in a grid trading;
For more details, please refer to Grid Trading Example.
The following situations may cause grid creation to fail:
- When you are already running a grid trading on the selected symbol;
- When you have open orders or positions on the selected symbol;
- When the profit of your grid is zero or below.
How to set the parameters of grid trading?
1. Choose the contract on which the trading bot will be deployed
2. Select isolated/cross margin mode and the leverage
Determine the type of margin for the grid trading position: isolated or cross margin modes.
- Isolated margin mode: Margin is independent for each trading pair
- Cross margin mode: Margin is shared between all trading pairs in the futures account
- Then, adjust the leverage. 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, so please use it prudently.
3. Lower/upper price
*Cannot be modified after placing the grid order
Set the lower price and the upper price of the grid, and the grid will place orders between the lower and upper prices.
4. Arithmetic/geometric mode
*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 price to grid higher price into grid count by an equal price difference.
The price difference of each grid is:
Price difference = (Grid higher price - Grid lower price) / Grid count
Then it constructed a series of price intervals:
Price 1 = Grid lower price
Price 2 = Grid lower price + Price difference
Price 3 = Grid lower price + Price difference * 2
…
Price n = Grid lower price + Price difference* (n-1)
At the grid upper price, n = grid count
Example: Arithmetic price difference = 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 the grid lower price to the grid upper price into grid count by an equal price ratio.
The price ratio of each grid is:
Price ratio = (Grid upper price / Grid lower price) ^ (1 / Grid count)
Then it constructed a series of price intervals:
Price 1 = Grid lower price
Price 2 = Grid lower price * Price ratio
Price 3 = Grid lower price * Price ratio ^ 2
…
Price n = Grid lower price * Price ratio ^ (n-1)
At the grid higher price, n = grid count
Example: Geometric grid price ratio = 1.1: 1,000, 1,100, 1,210, 1,331, 1,464.1,... (the next price is 10% higher than the previous one)
5. Grid count
*Cannot be modified after placing the grid order
Minimum: 2
Maximum: 149
Note: Price difference cannot be lower than the tick size, otherwise you need to adjust the grid count or the grid higher/lower price.
How to calculate?
1) Arithmetic grid, price difference = (Grid higher price - grid lower price) / Grid count < Tick size
2) Geometric grid, minimum price difference = Grid lower price*(Price ratio - 1)< Tick size , Price ratio = (Grid higher price / Grid lower price) ^ (1 / Grid count)
6. Profit/Grid (excl. trading fees)
If the profit per grid is lower than the maker fee, you will receive a notification asking you to adjust the parameters and place a new order as the total profits of the grid order may not be sufficient to cover the trading fee.
How to calculate? (The profit/grid shown is for reference only)
1) Arithmetic grid
d = (Higher price - Lower price) / Grid count
c = Trading fee rate (your current maker fee rate)
Profit per grid lower = (Higher price * (1-c)) / (Lower price - d) - 1 - c
Profit per grid higher = (1-c) * d / Lower price - 2c
Example: Price interval = 1,000 - 2,000, Grid count = 10, Maker fee = 0.1%
Price difference of each grid = (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 = (Higher price / Lower price) ^ (1/Grid count)
c = Trading fee rate (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 = (2,000 - 1,000) ^ (1/10) = 107.18%
Profit/grid = (1 - 0.1%) * 107.18% - 1 - 0.1% = 6.97%
7. Initial margin
*Cannot be modified after placing the grid order
You may adjust the percentage of the initial margin up to 100% (Initial margin = Percentage * Free margin). Please note that it must fall within the interval between the minimum initial margin and the free margin.
Neutral grid:
Minimum initial margin= (1/Leverage + MAX (Taker fee rate, Maker fee rate, 0)*2)* SUM (All grid order prices) * 1* Contract value
It indicates the margin required when the number of contracts for an order is 1.
Long/Short grid:
When placing long/short grid orders, a portion of the order may be filled immediately at the market price, making the actual margin taken up by this portion of the order correlated to the average execution price after the order is filled rather than the order price calculated when building the grid. Therefore, we need to first define the assumed execution prices for long/short grids when the orders placed are filled immediately.
Assumed price (BUY) = Grid order price
Assumed price (SELL) = MAX (Grid order price, Mark price)
Therefore,
Minimum initial margin = SUM (Assumed prices of all grid orders) * 1* Contract value / (Leverage * Adjustment coefficient)
If you have set a trigger price, the mark price should be replaced by the trigger price.
*The adjustment coefficient is set to 0.9 by default. and will be adjusted according to market conditions.
8. Total investment
*Cannot be modified after placing the grid order
Total investment = Initial margin * Leverage
9. Qty/Grid
Qty/Grid = (INT (Initial margin/Minimum initial margin))* Contract value
10. Free margin
The margin balance of your futures account.
11. Trigger type: last price / mark price
*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.
12. Trigger price
*Optional, can be modified after placing the 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.
13. Stop top price / Stop bottom price
*Optional, cannot be modified after filling in
1) Stop top price
The stop top price should be higher than the upper price, the last price, and the trigger price. When the latest market price reaches the stop top price, the grid will stop working.
2) Stop bottom price
The stop bottom price should be lower than the lower price, last price, and trigger price. When the latest market price reaches the stop bottom price, the grid will stop working.
14. Cancel all orders on stop
*Optional, can be modified after placing the grid order
You can enable this function to automatically cancel all unfilled orders of the symbol when the grid stops.
15. Close all positions on stop
*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.
*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.
Futures grid parameters explained
- Total profit
The sum of realized and unrealized profit and loss from grid trading
- Realized P&L
The cumulative profits of all completed orders since the grid trading strategy is set up
- Unrealized P&L
The unrealized profit and loss on open orders calculated based on the difference between the average entry price of the current position and the last price
- Matched profit
The realized profit of filled grid orders that are matched by one buy order and one sell order
- Unmatched P&L
The unrealized P&L of filled grid orders that are not matched, calculated based on the difference between the last price and the average execution price of unmatched orders
- Duration
The time period from when the grid is triggered till it stops
- Liq. price
Estimated liquidation price of the grid positions
- APR
The annualized rate of return calculated on a minute-by-minute basis since the grid trading strategy is triggered
- Current margin
The sum of margin used by the current grid position and the margin in use for open grid orders
- Grid position margin
The margin used by the grid position
- Grid order margin
The total margin in use for open grid orders
- Initial sell quantity
If the latest market price is between the grid's lower and higher prices when the short grid trade is triggered, the open sell orders at price levels below the market price will be filled immediately, and the total filled order amount is the initial sell quantity.
- Initial buy quantity
If the latest market price is between the grid's lower and higher prices when the long grid trade is triggered, the open buy orders at price levels above the market price will be filled immediately, and the total filled order amount is the initial buy quantity.
- Initial entry price
The average execution price when the first grid order is executed
- Grid start price
The latest market price when the grid trading strategy is triggered
How are grid orders matched?
To help you better observe the operation process of your grid trading strategy, each completed buy order and each filled sell order are displayed in matched pairs and profits are calculated for matched orders based on the logic of "buying low and selling high". Orders are matched according to the sequence of when they are filled, and the "first-in-last-out" methodology is applied.
For example, suppose buy order no.1, no.2 and sell order no.3, no.4 are filled respectively in the following time sequence: 1, 2, 3, 4.
Then they will be matched as follows:
Buy order no.1 is filled, no match;
Buy order no.2 is filled, no match;
Sell order no.3 is filled, matched with buy order no.2;
Sell order no.4 is filled, matched with buy order no.1.
Risk warning: Grid trading as a strategic tool should not be regarded as any financial or investment advice from Poloniex. Grid trading is used at your discretion and at your own risk. Poloniex will not be liable to you for any loss that might arise from your use of this feature. Users are advised to read and fully understand the grid trading tutorial and trade rationally within their financial ability. Click here for the complete risk warning for strategy trading.