Disclaimer: In compliance with MiCA requirements, unauthorized stablecoins are subject to certain restrictions for EEA users. For more information, please click here.
The trailing up function allows your USDⓈ-M Futures grid bot to adjust the trading range upwards to align with an upward-trend market, while the trailing down function moves the trading range downwards to align with a downward-trend market. These settings can address the limitations of traditional grid trading, where profits are often limited due to price breakthroughs.
When you enable the trailing up or down functions, your grid order’s upper and lower limits will automatically adjust as the asset's price rises or falls. This feature can potentially secure higher profits by taking advantage of price movements beyond the grid’s original range.
Note: To use the trailing down feature on the app, please upgrade to version 2.86.0 or above.
Please note:
1. You can activate trailing up or trailing down when placing a grid trading order. Simply check the box next to [Trailing Up] or [Trailing Down] to enable the feature.
2. Once [Trailing Up] is checked, you will need to set a trailing up limit price, which determines when the grid would stop moving up. The trailing up limit price should be higher than the Upper Price, and lower than the Trailing Cap Price and Stop Top Price for the neutral grid, Take Profit Price for the long grid, and Stop Loss Price for the short grid (if any).
Similarly, when [Trailing Down] is checked, you will need to set a trailing down limit price, which determines when the grid would stop moving down. The trailing down limit should be lower than the Lower Price when Trailing Down is enabled. The trailing down limit price should be higher than the Stop Bottom Price for the neutral grid, Stop Loss Price for the long grid, and Take Profit Price for the short grid (if any).
Based on your settings, you will see the corresponding trailing tag on the confirmation pop-up and order details page: [Trailing Up] if only trailing up is enabled, [Trailing Down] if only trailing down is enabled, and [Trailing] if both trailing up and trailing down are enabled.
You can monitor your trailing orders from [Running] and [History] tabs.
Let's use the below example to understand how trailing up and trailing down functions work in grid trading.
Initially, the bot will set up a grid trading structure with a buy order at the lower limit price ($25,000) and multiple sell orders from $33,000 to $45,000 evenly distributed across the grid based on the price gap.
Price | Order |
$45,000 | Sell |
$41,000 | Sell |
$37,000 | Sell |
$33,000 | Sell |
$29,000 | None |
$25,000 | Buy |
If the price rises above the upper limit price or falls below the lower limit price, the bot won’t place any new orders. It will wait for the price to drop and fulfill the existing buy orders to pair with the sell orders or wait for the price to rise and fulfill the existing sell orders to pair with the buy orders.
If the price rises above the upper limit price and the price difference between the grid levels ($45,000 + $4,000 = $49,000), the bot will adjust the grid upwards:
Conversely, if the price falls below the lower limit price, and the price difference between the grid levels ($33,000 - $4,000 = $29,000), the bot will adjust the grid downwards:
When using the Trailing Down feature for long grids or the trailing up feature for short grids, it's important to understand that these functions operate counter to the grid's original direction. This can result in the creation of reverse positions, which may not align with your initial trading strategy.
1. Impact on long grids (Trailing down enabled)
Scenario: In a continuous downtrend, enabling the trailing down function for a long grid can lead to the creation of short positions.
Mechanism: As the market price drops, the entire grid adjusts downward. Since the trailing down feature keeps the quote amount for each grid order, meaning more of the base asset is sold as prices decline. This increased selling pressure within the adjusted price range can lead to the formation of short positions, even though the grid was initially set up to take long positions.
2. Impact on short grids (Trailing up enabled)
Scenario: In a continuous uptrend, enabling the trailing up function for a short grid can result in the creation of long positions.
Mechanism: As the market price rises, the grid adjusts upwards. The trailing up feature ensures that the quote amount per grid order remains constant, resulting in the purchase of more of the base asset as prices rise. This accumulation within the new price range can lead to the formation of long positions, contrary to the original short strategy.
In a trailing up or down grid trading strategy, each grid maintains the same quote value, rather than the base quantity, due to the fluctuating price range. While in traditional grid trading, each grid usually has the same amount of the base currency (e.g., BTC in a BTC/USDT perpetual contract) regardless of the grid’s price level.
1. Grid quantity per order in quote asset
The average cost ratio, which accounts for any open loss for each order, is used to calculate the quantity for each grid.
The formula for calculating the trailing grid quantity in quote is as follows:
grid_qty in quote = adjust_coef * initial value* avg_cost_ratio / (grid_count+1)
In this formula:
For sell orders:
For buy orders:
If a trigger price has been set, the mark_price should be changed to this trigger price. The "assuming price" is the expected execution price for a buy or sell order in the context of a trailing up grid trading strategy. This assuming price is used to adjust the order quantities to maintain a constant quote value across each grid.
Please note:
The price range in a trailing up or trailing down strategy is not fixed. As the asset price rises or falls, the bot adjusts the price grid upwards or downwards, canceling lower buy orders and placing new ones at higher prices, or canceling higher sell orders and placing new ones at lower prices. By ensuring each grid holds the same quote value, the bot can maintain a consistent investment size across changing price levels, allowing for more efficient use of capital and enabling the grid to follow upward and downward movements in a rising market.
Example: Assume that each grid should hold a value of $300. If the price of BTC is $30,000, you would buy/sell 0.01 BTC per order. However, if the price rises to $33,000, you would adjust the quantity to approximately 0.00909 BTC so that the quote value remains at $300.
Using the parameters from the above section, the formula for calculating the grid quantity in the quote asset is:
Grid Qty in Quote = adjust_coef * initial margin * leverage * avg_cost_ratio / (grid_count + 1)
= 0.95 * 500 * 5 * 1 / (5 + 1) = 395.83 USDT
2. Minimum initial margin
The minimum initial margin is calculated similarly to the general guidelines. First, the smallest quantity (min_qty) that the bot can trade is calculated, and then it is used it to calculate the minimum initial margin:
Min_qty = Max(minQty, minNotional/grid_lower_limit)
Then,
min_initial_margin = max((grid_count+1) * min_notional, (grid_count+1) * trailing_coef * initial_grid_upper_limit * min_qty)/ Leverage
Please note:
For ETHBTC perpetual contracts, values are rounded to 4 decimal places; for other symbols, they are rounded to 2 decimal places.
Example calculation:
3. Maximum trailing up count
The maximum number of times the bot can adjust the price grid upwards for a trailing up grid is calculated as follows:
Estimated_trailing_cap= Min(initial margin * initial leverage/min_qty, maxPrice)
Max Trailing Up Count = (Estimated_trailing_cap - Initial Upper Limit)/Price Difference
Please note: This value is rounded down to the nearest integer.
Example calculation:
4. Trailing cap price
The maximum price at which the Trailing Up grid bot will stop adjusting the price grid upwards as follows:
Trailing Cap Price = Initial Upper Limit + Price Difference * Max Trailing Up Count
Please note: This value is rounded to the nearest tick size.
Example calculation:
Trailing Cap Price = 45,000 + 4,000 * 13 = 97,000
In trailing up orders, matched profits equals the sum of all matched profits from buy and sell orders:
Matched Profits = (Sell Order Average Price - Buy Order Average Price) * Matched Sell Order Size - Matched Trading Fee
Example calculation:
To calculate the matched profits for the sell and buy orders:
1. Matched size
The matched quantity is the lower quantity between the buy and sell orders, which is 0.05 BNB.
2. Matched trading fee
The matched trading fee is calculated as follows:
Matched Trading Fee = Buy Order Fee for Matched Size + Sell Order Fee for Matched Size
= (0.05/0.06) * 0.00227094 + (0.05/0.05) * 0.0019099
= 0.00380235 USDT
3. Matched profits for this order
The matched profits are calculated using the following formula:
Matched Profits = (Sell Order Average Price - Buy Order Average Price) * Matched Sell Order Size (matched size) - Matched Trading Fee
= (381.980 - 378.490) * 0.05 - 0.00380235
= 0.17069765 USDT
To learn more about the Binance Futures Grid Bot, visit this FAQs page.