
이 전략은 여러 가지 기술 지표를 결합한 포괄적인 거래 시스템입니다. 주로 이동 평균(MA), 상대 강도 지수(RSI) 및 평균 방향 지수(ADX)를 사용하여 시장 추세와 모멘텀을 파악합니다. Advanced True Range(ATR) 이 지표는 손절매 및 이익 실현 포지션을 동적으로 설정하는 데 사용됩니다. 시스템은 다양한 시간대의 지표 교차를 통해 거래 신호를 확인하는 다기간 분석 방식을 채택하여 거래의 정확성을 보장할 뿐만 아니라 위험을 효과적으로 통제합니다.
이 전략은 거래 신호를 확인하기 위해 3단계 검증 메커니즘을 사용합니다.
동시에 이 전략은 ATR을 기반으로 한 동적 손절매 및 이익 실현 시스템을 사용합니다.
이 전략은 여러 기술 지표의 시너지 효과를 통해 비교적 완전한 거래 시스템을 구축합니다. 이 전략의 핵심적인 장점은 다층 검증 메커니즘과 역동적인 위험 관리 시스템에 있지만, 다양한 시장 환경에서의 적응성에도 주의해야 합니다. 이 전략은 지속적인 최적화와 개선을 통해 실제 거래에서 안정적인 수익을 달성할 것으로 기대됩니다.
/*backtest
start: 2024-12-17 00:00:00
end: 2025-01-15 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=6
strategy("Daily Trading Strategy", overlay=true)
// --- Indikator ---
// Kombinasi MA untuk trend
fastMA = ta.sma(close, 20)
slowMA = ta.sma(close, 50)
// RSI untuk momentum
rsi = ta.rsi(close, 14)
// --- Fungsi untuk menghitung ADX ---
adx(length) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, length)
plus = fixnan(100 * ta.rma(plusDM, length) / trur)
minus = fixnan(100 * ta.rma(minusDM, length) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), length)
// ADX untuk kekuatan trend
adxValue = adx(14)
// --- Kondisi Entry Long ---
longEntry = ta.crossover(fastMA, slowMA) and rsi > 50 and adxValue > 25
// --- Kondisi Entry Short ---
shortEntry = ta.crossunder(fastMA, slowMA) and rsi < 50 and adxValue > 25
// --- Stop Loss dan Take Profit ---
// Fungsi untuk menghitung stop loss dan take profit
getSLTP(entryPrice, isLong) =>
atr = ta.atr(14)
sl = isLong ? entryPrice - atr * 2 : entryPrice + atr * 2
tp = isLong ? entryPrice + atr * 4 : entryPrice - atr * 4
[sl, tp]
// Hitung SL dan TP untuk posisi Long
[longSL, longTP] = getSLTP(close, true)
// Hitung SL dan TP untuk posisi Short
[shortSL, shortTP] = getSLTP(close, false)
// --- Eksekusi Order ---
if (longEntry)
strategy.entry("Long", strategy.long, stop=longSL, limit=longTP)
if (shortEntry)
strategy.entry("Short", strategy.short, stop=shortSL, limit=shortTP)
// --- Plot Indikator ---
// MA
plot(fastMA, color=color.blue)
plot(slowMA, color=color.red)
// RSI
plot(rsi, color=color.orange)
hline(50, color=color.gray)
// ADX
plot(adxValue, color=color.purple)
hline(25, color=color.gray)
// --- Alert ---
alertcondition(longEntry, title="Long Entry", message="Long Entry")
alertcondition(shortEntry, title="Short Entry", message="Short Entry")