
この戦略は、複数のテクニカル指標を組み合わせた包括的な取引システムです。主に移動平均(MA)、相対力指数(RSI)、平均方向指数(ADX)を使用して、市場のトレンドと勢いを特定します。アドバンスト・トゥルー・レンジ(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")