
この戦略は,均線交差,RSI動量指標,ATR波動率指標を組み合わせた多層の確認取引システムである.この戦略は,9周期と21周期の指数移動平均 ((EMA) を主要なトレンド判断基準として採用し,同時にRSI指標と組み合わせて動量確認を行い,ATR指標を使用してポジションサイズとストップ・ロスの位置を動的に調整する.この戦略は,複数の技術指標の協同配合によって,偽信号を効果的にフィルターし,取引の信頼性を向上させる.
戦略の核心的な論理は以下のレベルに基づいています.
この戦略は平均線交差,RSI動量,ATR波動率の3次元を組み合わせて,安定した取引システムを構築する.この戦略の優点は,完全な多層確認機構と動的なリスク管理システムにあるが,波動的な市場ではリスクが高くなる可能性がある.市場環境のフィルタリングを追加し,パラメータの自主適応などの方向での最適化により,戦略のパフォーマンスは向上する.全体的に,これは論理的に明確な,実用的に強固な取引戦略である.
/*backtest
start: 2025-02-13 00:00:00
end: 2025-02-20 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("BTC Scalping Strategy", overlay=true, margin_long=100, margin_short=100, pyramiding=1)
// Inputs
emaFastLength = input.int(9, "Fast EMA Length")
emaSlowLength = input.int(21, "Slow EMA Length")
rsiLength = input.int(14, "RSI Length")
rsiOverbought = input.int(70, "RSI Overbought")
rsiOversold = input.int(30, "RSI Oversold")
atrLength = input.int(14, "ATR Length")
riskPercent = input.float(1, "Risk Percentage", step=0.5)
// Calculate Indicators
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)
// Entry Conditions
longCondition = ta.crossover(emaFast, emaSlow) and rsi < rsiOverbought
shortCondition = ta.crossunder(emaFast, emaSlow) and rsi > rsiOversold
// Exit Conditions
takeProfitLevelLong = close + (atr * 3)
stopLossLevelLong = close - (atr * 1.5)
takeProfitLevelShort = close - (atr * 3)
stopLossLevelShort = close + (atr * 1.5)
// Position Sizing
equity = strategy.equity
riskAmount = equity * (riskPercent / 100)
positionSizeLong = riskAmount / (close - stopLossLevelLong)
positionSizeShort = riskAmount / (stopLossLevelShort - close)
// Strategy Execution
if (longCondition)
strategy.entry("Long", strategy.long, qty=positionSizeLong)
strategy.exit("Exit Long", "Long", limit=takeProfitLevelLong, stop=stopLossLevelLong)
if (shortCondition)
strategy.entry("Short", strategy.short, qty=positionSizeShort)
strategy.exit("Exit Short", "Short", limit=takeProfitLevelShort, stop=stopLossLevelShort)
// Plotting
plot(emaFast, color=color.new(color.blue, 0), linewidth=2)
plot(emaSlow, color=color.new(color.red, 0), linewidth=2)
hline(rsiOverbought, "RSI OB", color=color.new(color.red, 50))
hline(rsiOversold, "RSI OS", color=color.new(color.green, 50))
// Alerts
alertcondition(longCondition, "Long Signal", "Potential Long Entry")
alertcondition(shortCondition, "Short Signal", "Potential Short Entry")