Type/to search

Stepwise Pyramiding Moving Average Breakout Strategy

Common strategy
Created: 2024-02-05 14:09:14
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This strategy uses a stepwise pyramiding approach based on the comparison between the current close price and previous close price to determine the market direction. When a long opportunity is identified, it will long with multiple gradual entries. When a short opportunity is identified, it will short with multiple gradual entries. The number of entries can be set through parameters. At the same time, the strategy incorporates time frame filters where trading signals are only generated within the configured trading time frame.

Strategy Logic

  1. Compare current bar's close price (close) with previous bar's close price (close[1]). If close > close[1], it is determined as a long opportunity and set longCondition=1. If close < close[1], it is determined as a short opportunity and set shortCondition=1.

  2. Within the allowed trading time frame, if longCondition=1, it will long with multiple gradual entries. If shortCondition=1, it will short with multiple gradual entries.

  3. The number of entries is set through the pyramiding parameter, which can be configured from 1 to 5, with 4 as the default.

  4. A stop loss condition is set after each entry in case the market reverses.

  5. Trading signals can be output to different trading interfaces such as toast or telegram.

The strategy mainly considers the advantages of breakout and moving average strategies. During long or short opportunities, it uses a stepwise pyramiding approach to better follow the trend while controlling risks. It also incorporates time frame filters to avoid generating signals during non-major trading sessions.

Advantage Analysis

  1. Stepwise pyramiding follows trends better.

  2. Adjustable number of entries makes it more flexible.

  3. Supports different trading interfaces for scalability.

  4. Has stop loss mechanisms to control risks.

  5. Time frame filter avoids false signals.

Risk Analysis

  1. Improper parameter settings may lead to larger losses.

  2. Network issues may prevent timely stop loss.

  3. Parameters need adjustments for different products.

  4. Need timely stop loss to lock in profits.

Solutions:

  1. Default 4 entries is appropriate.

  2. Check network connectivity.

  3. Adjust parameters according to product characteristics.

  4. Set stop loss levels.

Optimization Directions

  1. Consider adding more indicators to judge signal strength.

  2. Test parameter optimization results across different products.

  3. Incorporate machine learning algorithms to optimize parameters.

  4. Enhance risk management mechanisms.

Summary

This stepwise pyramiding moving average breakout strategy integrates the advantages of trend following and risk control. When effective signals are identified, it uses stepwise pyramiding to follow the trend while controlling risk exposure through configurable number of entries. It also incorporates functionalities like time frame filter to avoid false signals. The strategy can be further optimized in many aspects and has great extensibility. In general, it is very effective for trending products and is strongly recommended.

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

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © torresbitmex

//@version=5
Strategy parameters
Strategy parameters
매매 시간세팅
매매 시작
매매 종료
봇선택
봇선택
계정정보
계정
TVExtBot 인증키 (Optional)
진입 세팅
분할진입수
진입주문 메세지입력
롱 진입1 (Optional)
롱 진입2 (Optional)
롱 진입3 (Optional)
롱 진입4 (Optional)
롱 진입5 (Optional)
숏 진입1 (Optional)
숏 진입2 (Optional)
숏 진입3 (Optional)
숏 진입4 (Optional)
숏 진입5 (Optional)
종료주문 메세지입력
롱 전체종료 (Optional)
숏 전체종료 (Optional)
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)