
이 전략은 다중 평행 시스템 기반의 트렌드 추적 전략으로, 트렌드 강도 확인과 변동성 포착 메커니즘을 결합합니다. 전략은 5주기, 25주기 및 75주기 삼중 평행 시스템을 핵심으로 사용하여, ADX 지표를 통해 강한 트렌드를 필터링하고, 빠른 변동 모니터링 시스템을 통합하여 적시에 수익을 창출합니다. 이러한 다층 거래 메커니즘은 시장의 추세를 효과적으로 식별하고 적절한 시기에 거래 할 수 있습니다.
이 전략은 세 가지 핵심 메커니즘을 기반으로 작동합니다.
특정 거래 규칙:
적응 변수를 입력하세요:
트렌드 확인 메커니즘을 강화:
정지 손실을 최적화:
시장 환경 분류:
이 전략은 여러 평행선 시스템, 트렌드 강도 확인 및 변동 모니터링의 3 차원을 통해 전체적인 거래 시스템을 구축한다. 전략의 핵심 장점은 다층 확인 메커니즘과 유연한 위험 제어 시스템이다. 최적화 제안을 제공함으로써 전략은 적응성과 안정성을 더욱 향상시킬 수 있다. 실제 적용에서 거래자는 특정 시장 특성에 따라 매개 변수를 최적화하고 합리적인 자금 관리 전략과 함께 사용하도록 권장한다.
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("5SMA-25SMA Crossover Strategy with ADX Filter and Sudden Move Profit Taking", overlay=true)
// パラメータの設定
sma5 = ta.sma(close, 5)
sma25 = ta.sma(close, 25)
sma75 = ta.sma(close, 75)
// ADXの計算
length = 14
tr = ta.tr(true)
plus_dm = ta.rma(math.max(ta.change(high), 0), length)
minus_dm = ta.rma(math.max(-ta.change(low), 0), length)
tr_sum = ta.rma(tr, length)
plus_di = 100 * plus_dm / tr_sum
minus_di = 100 * minus_dm / tr_sum
dx = 100 * math.abs(plus_di - minus_di) / (plus_di + minus_di)
adx = ta.rma(dx, length)
// ロングとショートのエントリー条件
longCondition = ta.crossover(sma5, sma25) and close > sma75 and adx > 20
shortCondition = ta.crossunder(sma5, sma25) and close < sma75 and adx > 20
// 急激な変動を検知する条件(ここでは、前のローソク足に比べて0.6%以上の値動きがあった場合)
suddenMove = math.abs(ta.change(close)) > close[1] * 0.006
// ポジション管理
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// 急激な変動があった場合、ポジションを利益確定(クローズ)する
if (strategy.position_size > 0 and suddenMove)
strategy.close("Long")
if (strategy.position_size < 0 and suddenMove)
strategy.close("Short")
// エグジット条件
if (strategy.position_size > 0 and shortCondition)
strategy.close("Long")
if (strategy.position_size < 0 and longCondition)
strategy.close("Short")
// SMAとADXのプロット
plot(sma5, color=color.blue, title="5SMA")
plot(sma25, color=color.red, title="25SMA")
plot(sma75, color=color.green, title="75SMA")
plot(adx, color=color.orange, title="ADX")
hline(20, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)