
この戦略は,指数移動平均 ((EMA)) とランダムな指標 ((Stochastic)) を組み合わせた多周期分析に基づくトレンド追跡システムで,取引の方向と入場タイミングを決定する.戦略は,15分周期でトレンドの方向を確認し,1-5分周期で特定の入場機会を探し,厳格なリスク管理と分期利益を得ることで取引パフォーマンスを最適化する.
この戦略は,取引条件を検証する多層のメカニズムを採用しています.
この戦略は,多周期分析と複数の技術指標の配合により,比較的に完善なトレンド追跡取引システムを構築している.戦略の核心的な優位性は,その厳格なリスク管理と柔軟な収益計画にあるが,実際の適用では,市場環境と資金の規模に応じて適切なパラメータの最適化が必要である.推奨された最適化の方向によって,戦略は,異なる市場環境下でより安定したパフォーマンスを得る見通しがある.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("15-Min Trend Strategy", overlay=true, default_qty_type=strategy.fixed, default_qty_value=1)
// Define EMA for trend confirmation
ema50 = ta.ema(close, 50)
trendLong = close > ema50
trendShort = close < ema50
// Stochastic settings
length = 14
smoothK = 3
smoothD = 3
stochK = ta.sma(ta.stoch(close, high, low, length), smoothK)
stochD = ta.sma(stochK, smoothD)
// Entry conditions
longCondition = stochK < 30 and trendLong
shortCondition = stochK > 70 and trendShort
// ATR-based stop-loss calculation
atrValue = ta.atr(14)
stopLossLong = close - (1.5 * atrValue)
stopLossShort = close + (1.5 * atrValue)
takeProfitLong = close + (2 * atrValue)
takeProfitShort = close - (2 * atrValue)
// Execute trades
if longCondition
strategy.entry("Long", strategy.long, qty=2)
strategy.exit("TP Long 1", from_entry="Long", qty=1, stop=stopLossLong, limit=takeProfitLong)
strategy.exit("TP Long 2", from_entry="Long", qty=1, stop=stopLossLong, limit=takeProfitLong * 1.5)
if shortCondition
strategy.entry("Short", strategy.short, qty=2)
strategy.exit("TP Short 1", from_entry="Short", qty=1, stop=stopLossShort, limit=takeProfitShort)
strategy.exit("TP Short 2", from_entry="Short", qty=1, stop=stopLossShort, limit=takeProfitShort * 1.5)
// Move SL to breakeven after 50% move to target
if strategy.position_size > 0
if strategy.position_avg_price != 0
moveToBELong = close >= (strategy.position_avg_price + (takeProfitLong - strategy.position_avg_price) * 0.5)
if moveToBELong
strategy.exit("BE Long", from_entry="Long", qty=1, stop=strategy.position_avg_price)
moveToBEShort = close <= (strategy.position_avg_price - (strategy.position_avg_price - takeProfitShort) * 0.5)
if moveToBEShort
strategy.exit("BE Short", from_entry="Short", qty=1, stop=strategy.position_avg_price)