
이것은 세 개의 간단한 이동 평균 (SMA) 을 기반으로 한 트렌드 추적 전략입니다. 이 전략은 21, 50, 100 주기의 이동 평균의 교차와 위치 관계를 사용하여 시장의 흐름을 식별하고 적절한 시간에 거래합니다. 이 전략은 주로 5 분 시간 프레임에서 작동하며, 30 분 차트를 참조하여 트렌드 확인을 권장합니다.
이 전략은 트레이딩 신호를 세 가지 필터링 메커니즘을 사용하여 결정합니다.
구매 조건은 동시에 충족되어야 합니다:
판매 조건은 다음과 같습니다:
위험 관리 제안:
이 전략은 구조적으로 완전하고 논리적으로 명확한 트렌드 추적 전략이다. 트리플 평평선 필터링과 트렌드 확인 메커니즘을 통해 가짜 신호를 효과적으로 줄이고 거래 성공률을 높일 수 있다. 전략은 좋은 확장성을 가지고 있으며, 다양한 시장 환경에 따라 최적의 조정을 할 수 있다. 실물 거래 전에 충분한 재측량과 변수 최적화가 권장된다.
/*backtest
start: 2024-02-21 00:00:00
end: 2024-06-08 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Vezpa
//@version=5
strategy("Vezpa's Gold Strategy", overlay=true)
// ======================== MAIN STRATEGY ========================
// Input parameters for the main strategy
fast_length = input.int(21, title="Fast MA Length", minval=1)
slow_length = input.int(50, title="Slow MA Length", minval=1)
trend_filter_length = input.int(100, title="Trend Filter MA Length", minval=1)
// Calculate moving averages for the main strategy
fast_ma = ta.sma(close, fast_length)
slow_ma = ta.sma(close, slow_length)
trend_ma = ta.sma(close, trend_filter_length)
// Plot moving averages
plot(fast_ma, color=color.blue, title="21 MA")
plot(slow_ma, color=color.red, title="50 MA")
plot(trend_ma, color=color.orange, title="100 MA")
// Buy condition: 21 MA crosses above 50 MA AND both are above the 100 MA
if (ta.crossover(fast_ma, slow_ma) and fast_ma > trend_ma and slow_ma > trend_ma)
strategy.entry("Buy", strategy.long)
// Sell condition: 21 MA crosses below 50 MA AND both are below the 100 MA
if (ta.crossunder(fast_ma, slow_ma) and fast_ma < trend_ma and slow_ma < trend_ma)
strategy.close("Buy")
// Plot buy signals as green balloons
plotshape(series=ta.crossover(fast_ma, slow_ma) and fast_ma > trend_ma and slow_ma > trend_ma,
title="Buy Signal",
location=location.belowbar,
color=color.green,
style=shape.labelup,
text="BUY",
textcolor=color.white,
size=size.small,
transp=0)
// Plot sell signals as red balloons
plotshape(series=ta.crossunder(fast_ma, slow_ma) and fast_ma < trend_ma and slow_ma < trend_ma,
title="Sell Signal",
location=location.abovebar,
color=color.red,
style=shape.labeldown,
text="SELL",
textcolor=color.white,
size=size.small,
transp=0)