Type/to search

Grid Trading Strategy Based on Real-time K-line Tracking

Common strategy
Created: 2024-02-01 14:40:22
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is a bi-directional grid trading strategy based on real-time tracking of K-line changes. It can generate steady profits in both bull and bear markets.

Strategy Logic

  1. Automatically calculate the price range and each grid price based on the number of grids set by users.

  2. When price breaks through a grid price, open long position with fixed quantity; when price falls below a grid price, close long position and open short position.

  3. By tracking price changes, profits can be obtained when price fluctuates within the grid range.

Advantage Analysis

  1. Automatically calculate a reasonable grid range without needing to determine support and resistance manually.

  2. Bi-directional trading adapts to changing market conditions.

  3. Fixed open position size facilitates risk control.

  4. Simple and straightforward code that is easy to understand and modify.

Risk Analysis

  1. Significant price swings may lead to expanding losses.

  2. Accumulated trading fees also impact final profits.

  3. Need to reasonably determine number of grids. More grids means more trades but each with limited profits.

Optimization Directions

  1. Incorporate stop loss strategy to limit losses.

  2. Add dynamic adjustment of number of grids.

  3. Consider adding leverage to amplify trading volume.

Summary

The strategy has an overall clear and simple logic to generate steady income through bi-directional grid trading, but also bears certain trading risks. Further optimizations may lead to better results.

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

//@version=4

//hk4jerry
Strategy parameters
Strategy parameters
Grid Bounds
Use Auto Bounds?
(Auto) Bound Source
(Auto) Bound Lookback
(Auto) Bound Deviation
(Manual) Upper Boundry(상단 가격)
(Manual) Lower Boundry(하단 가격)
Grid Lines
Grid Line Quantity(그리드 수)
Trading option
Initial balance(투자금액)
Start Time
End Time
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)