
이 전략은 가속된 흔들림 지표 ((AC) 와 무작위 지표 ((Stochastic) 를 결합한 정량 거래 시스템이다. 가격과 기술 지표 사이의 오차를 식별하여 시장 동력의 전환을 포착하여 잠재적인 트렌드 반전을 예측한다. 이 전략은 또한 평행 (SMA) 와 상대적으로 약한 지표 (RSI) 를 통합하여 신호의 신뢰성을 높이고, 위험을 제어하기 위해 고정된 스톱포드를 설정한다.
전략의 핵심 논리는 여러 기술 지표의 협동조합을 기반으로 한다. 우선 가속 진동 지표 ((AC) 를 계산한다. 이는 가격 중도값의 5주기 및 34주기 평균선 차이와 N주기 평균선을 어 얻는 것이다. 동시에 가격 혁신이 낮아 AC 지표가 높을 때, 낙관적 낙관성이 형성된다. 가격 혁신이 높아 AC 지표가 낮아 AC 지표가 낮아 낙관적 낙관성이 형성된다. 탈퇴 전략은 또한 RSI를 보조 확인 지표로 도입하여 여러 지표의 교차 검증을 통해 신호의 정확성을 높인다.
이 전략의 장점은 여러 지표의 교차 검증과 완벽한 위험 제어 시스템이지만, 가짜 돌파구 및 변수 최적화와 같은 문제에 주의를 기울여야 합니다. 지속적인 최적화 및 개선으로 이 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 것으로 예상됩니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
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/
// © JayQwae
//@version=5
strategy("Enhanced AC Divergence Strategy with Stochastic Divergence", overlay=true)
// Input settings
tp_pips = input.float(0.0020, "Take Profit (in price)", step=0.0001)
sl_pips = input.float(0.0040, "Stop Loss (in price)", step=0.0001) // 40 pips
ac_length = input.int(5, "AC Length")
rsi_length = input.int(14, "RSI Length")
stoch_k = input.int(14, "Stochastic K Length")
stoch_d = input.int(3, "Stochastic D Smoothing")
stoch_ob = input.float(80, "Stochastic Overbought Level")
stoch_os = input.float(20, "Stochastic Oversold Level")
// Accelerator Oscillator Calculation
high_low_mid = (high + low) / 2
ao = ta.sma(high_low_mid, 5) - ta.sma(high_low_mid, 34)
ac = ao - ta.sma(ao, ac_length)
// RSI Calculation
rsi = ta.rsi(close, rsi_length)
// Stochastic Oscillator Calculation
k = ta.sma(ta.stoch(close, high, low, stoch_k), stoch_d)
d = ta.sma(k, stoch_d)
// Stochastic Divergence Detection
stoch_bull_div = ta.lowest(close, 5) < ta.lowest(close[1], 5) and ta.lowest(k, 5) > ta.lowest(k[1], 5)
stoch_bear_div = ta.highest(close, 5) > ta.highest(close[1], 5) and ta.highest(k, 5) < ta.highest(k[1], 5)
// Main Divergence Detection
bullish_div = ta.lowest(close, 5) < ta.lowest(close[1], 5) and ac > ac[1] and stoch_bull_div
bearish_div = ta.highest(close, 5) > ta.highest(close[1], 5) and ac < ac[1] and stoch_bear_div
// Plot divergences
plotshape(bullish_div, title="Bullish Divergence", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(bearish_div, title="Bearish Divergence", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Strategy rules
if (bullish_div)
strategy.entry("Buy", strategy.long)
strategy.exit("Take Profit/Stop Loss", "Buy", limit=close + tp_pips, stop=close - sl_pips)
if (bearish_div)
strategy.entry("Sell", strategy.short)
strategy.exit("Take Profit/Stop Loss", "Sell", limit=close - tp_pips, stop=close + sl_pips)
// Alerts
if (bullish_div)
alert("Bullish Divergence detected! Potential Buy Opportunity", alert.freq_once_per_bar)
if (bearish_div)
alert("Bearish Divergence detected! Potential Sell Opportunity", alert.freq_once_per_bar)