Type/to search

Momentum Brick Strategy

Cryptocurrency
Created: 2024-02-19 15:32:17
Last modified: 2 years ago
1
Follow
1782
Followers

img

The strategy judges the market momentum change based on the formation of simulated bricks and long or short on the brick direction.

Strategy Logic

The core logic is to simulate brick formation by calculating the ATR and closing price relationship. Specifically, two variables Brick1 and Brick2 are defined.

Brick1 is calculated by: if closing price exceeds Brick1 previous value + ATR, Brick1 = Brick1 previous value + ATR; if closing price is below Brick1 previous - ATR, Brick1 is Brick1 previous - ATR value; otherwise, Brick1 inherits Brick1 previous value.

Brick2 is calculated by: if Brick1 is not equal to Brick1 previous value, then Brick2 = Brick1 previous value; otherwise, inherit Brick2 previous value.

This simulates the brick formation. When Brick1 rises more than an ATR, an upward brick forms; when Brick1 falls more than an ATR, a downward brick forms. Brick2 just records the position of the previous brick.

When Brick1 and Brick2 go up across, it means the brick expands upward, judged as long. When Brick1 and Brick2 go down across, it means the brick shrinks downward, judged as short.

Advantage

  1. Use ATR to determine brick formation, avoid fixed brick size, can adapt dynamically to market fluctuation
  2. Identify momentum changes through crossover of bricks
  3. The sensitivity to market momentum judgment can be adjusted by different ATR cycles
  4. Visualize the formation and crossover of bricks to intuitively determine market trends

Risk

  1. ATR size selection will affect strategy returns. Too small ATR results in too many invalid signals. Too large ATR causes too few bricks and potential loss of opportunity.
  2. The actual trend may not follow the brick pattern. Brick crossover signals may be negated by market reversals.
  3. Need to be highly sensitive to transactions costs. Frequent trading based on brick crossover will greatly reduce net profit.

Solutions include parameter optimization to find optimal ATR cycle, adjust stop profit loss strategy to reduce loss from invalid signals, properly increase transaction varieties to reduce cost impact on returns.

Optimization

  1. Combine with other indicators for signal filtering to avoid invalid signals, for example volume and volatility indicators
  2. Add trend filtering, issue signals only in the trend direction to avoid reversal loss
  3. Adopt full sample parameter optimization during test period to find optimal parameters automatically

Summary

The strategy judges short-term trends and momentum in the markets through dynamically simulating brick crossover, with intuitive visualization. There is much room for optimization through parameter tuning and signal filtering to further enhance stability.

Source
Pine
/*backtest
start: 2023-02-12 00:00:00
end: 2024-02-18 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4


///Component Code Start
Strategy parameters
Strategy parameters
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
Color Background?
Margin?
Resolution of ATR
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)