Overview
This strategy is a comprehensive trading system that combines the pivot point reference (CPR), exponential moving average (EMA), relative strength index (RSI) and breakthrough logic. The strategy adopts the ATR dynamic trailing stop loss mechanism, identifies market trends and trading opportunities through the coordination of multiple technical indicators, and realizes dynamic risk management. This strategy is suitable for intraday and medium-term transactions, and has strong adaptability and risk control capabilities.
Strategy Principle
The strategy is based on the following core components:
- The CPR indicator is used to determine key support and resistance levels and calculate pivot points, upper and lower rails on a daily basis.
- The double EMA system (9 days and 21 days) is used to determine the trend direction and generate trading signals through golden cross and dead cross.
- The RSI indicator (14 days) is used to confirm the overbought or oversold state of the market and acts as a trading filter.
- Breakout logic incorporates price breakouts of pivot points to confirm trading signals.
- The ATR indicator is used to set a dynamic trailing stop loss and adaptively adjust the stop loss distance according to market volatility.
Strategy Advantages
- The comprehensive use of multiple technical indicators improves the reliability of signals.
- The dynamic trailing stop loss mechanism can effectively lock in profits and control risks.
- The CPR indicator provides an important price reference point, which helps to accurately identify the market structure.
- The strategy has good adaptability and parameters can be adjusted according to different market conditions.
- RSI filters and breakout confirmations enhance the quality of trading signals.
Strategy Risks
- Multiple indicators can produce lags and false signals in choppy markets.
- Trailing stops may be triggered prematurely during periods of high volatility.
- Parameter optimization needs to take market characteristics into consideration, and improper parameter settings may affect strategy performance.
- Conflicting signals may affect the accuracy of decision-making.
Strategy Optimization Direction
- Introduce volume indicators to confirm the validity of price breakouts.
- Add trend strength filter to improve the accuracy of trend tracking.
- Optimize the dynamic adjustment mechanism of stop-loss parameters to improve the protection effect.
- Added market volatility adaptive mechanism to dynamically adjust trading parameters.
- Consider adding sentiment indicators to improve market timing.
Summary
This strategy builds a relatively complete trading system through the synergy of multiple technical indicators. The dynamic stop loss mechanism and multi-dimensional signal confirmation provide good risk-return characteristics. The optimization space of the strategy mainly lies in the improvement of signal quality and the improvement of risk management. Through continuous optimization and adjustment, the strategy is expected to maintain stable performance in different market environments.
Strategy source code
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-04 08:00:00
period: 7h
basePeriod: 7h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Enhanced CPR + EMA + RSI + Breakout Strategy", overlay=true)
// Inputs
ema_short = input(9, title="Short EMA Period")
ema_long = input(21, title="Long EMA Period")
cpr_lookback = input.timeframe("D", title="CPR Timeframe")
atr_multiplier = input.float(1.5, title="ATR Multiplier")
rsi_period = input(14, title="RSI Period")
rsi_overbought = input(70, title="RSI Overbought Level")
rsi_oversold = input(30, title="RSI Oversold Level")
breakout_buffer = input.float(0.001, title="Breakout Buffer (in %)")
// Calculate EMAs
short_ema = ta.ema(close, ema_short)
long_ema = ta.ema(close, ema_long)
// Request Daily Data for CPR Calculation
high_cpr = request.security(syminfo.tickerid, cpr_lookback, high)
low_cpr = request.security(syminfo.tickerid, cpr_lookback, low)
close_cpr = request.security(syminfo.tickerid, cpr_lookback, close)
// CPR Levels
pivot = (high_cpr + low_cpr + close_cpr) / 3
bc = (high_cpr + low_cpr) / 2
tc = pivot + (pivot - bc)
// ATR for Stop-Loss and Take-Profit
atr = ta.atr(14)
// RSI Calculation
rsi = ta.rsi(close, rsi_period)
// Entry Conditions with RSI Filter and Breakout Logic
long_condition = ((close > tc) and (ta.crossover(short_ema, long_ema)) and (rsi > 50 and rsi < rsi_overbought)) or (rsi > 80) or (close > (pivot + pivot * breakout_buffer))
short_condition = ((close < bc) and (ta.crossunder(short_ema, long_ema)) and (rsi < 50 and rsi > rsi_oversold)) or (rsi < 20) or (close < (pivot - pivot * breakout_buffer))
// Dynamic Exit Logic
long_exit = short_condition
short_exit = long_condition
// Trailing Stop-Loss Implementation
if long_condition
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long",
trail_points=atr * atr_multiplier,
trail_offset=atr * atr_multiplier / 2)
if short_condition
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short",
trail_points=atr * atr_multiplier,
trail_offset=atr * atr_multiplier / 2)
// Plot CPR Levels and EMAs
plot(pivot, title="Pivot Point", color=color.orange, linewidth=2)
plot(tc, title="Top CPR", color=color.green, linewidth=2)
plot(bc, title="Bottom CPR", color=color.red, linewidth=2)
plot(short_ema, title="Short EMA", color=color.blue, linewidth=1)
plot(long_ema, title="Long EMA", color=color.purple, linewidth=1)
// Highlight Buy and Sell Signals
bgcolor(long_condition ? color.new(color.green, 90) : na, title="Buy Signal Highlight")
bgcolor(short_condition ? color.new(color.red, 90) : na, title="Sell Signal Highlight")
Strategy Parameters
The original address: Multi-Indicator Dynamic Trailing Stop Trading Strategy