Type/to search

Dynamic Grid Trading Strategy

Common strategy
Created: 2024-01-23 10:53:05
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy implements grid trading by placing multiple parallel buy and sell orders within a price range. It adjusts the grid range and lines based on market fluctuations to profit.

Strategy Logic

  1. Set upper and lower bounds of the grid, which can be manually configured or automatically calculated based on recent high and low prices.
  2. Calculate grid interval width according to specified number of grid lines.
  3. Generate grid line prices array with corresponding quantity.
  4. When price drops below a grid line, open long order below it; when price rises above a grid line, close short order above it.
  5. Dynamically adjust bounds, interval width and grid line prices to adapt the strategy to market changes.

Advantage Analysis

  1. Can steadily profit in range-bound and volatile market, regardless of trend direction.
  2. Supports both manual and automatic parameter settings for strong adaptability.
  3. Optimizable parameters like grid quantity, interval width and order size for better reward.
  4. Embedded position control for lower risk.
  5. Dynamic grid range adjustment enhances adaptability.

Risk Analysis

  1. Severe loss may occur in strong trending market.
  2. Improper grid quantity and position settings may amplify risk.
  3. Auto calculated grid range may fail in extreme price swings.

Risk Management:

  1. Optimize grid parameters and strictly control total position.
  2. Close strategy before significant price move.
  3. Judge market condition with trend indicators, close strategy when necessary.

Optimization Directions

  1. Choose optimal grid quantity based on market character and capital scale.
  2. Test different periods to optimize auto parameters.
  3. Optimize order size calculation for more steady reward.
  4. Add indicators for trend identification and strategy close conditions.

Summary

The dynamic grid trading strategy adapts to the market by adjusting grid parameters. It profits in range-bound and volatile market. With proper position control, the risk is mitigated. Optimizing grid settings and incorporating trend judgment indicators can further improve the strategy's stability.

Source
Pine
/*backtest
start: 2023-12-23 00:00:00
end: 2024-01-22 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("sarasa srinivasa kumar", overlay=true, pyramiding=14, close_entries_rule="ANY", default_qty_type=strategy.cash, initial_capital=100.0, currency="USD", commission_type=strategy.commission.percent, commission_value=0.1)
i_autoBounds    = input(group="Grid Bounds", title="Use Auto Bounds?", defval=true, type=input.bool)                             // calculate upper and lower bound of the grid automatically? This will theorhetically be less profitable, but will certainly require less attention
i_boundSrc      = input(group="Grid Bounds", title="(Auto) Bound Source", defval="Hi & Low", options=["Hi & Low", "Average"])     // should bounds of the auto grid be calculated from recent High & Low, or from a Simple Moving Average
Strategy parameters
Strategy parameters
Grid Bounds
Use Auto Bounds?
(Auto) Bound Source
(Auto) Bound Lookback
(Auto) Bound Deviation
(Auto) Upper Boundry
(Auto) Lower Boundry
Grid Lines
Grid Line Quantity
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)