
この戦略は、三重指数移動平均 (TEMA) に基づいたトレンド追跡取引システムです。この戦略は、短期 TEMA と長期 TEMA のクロスオーバー信号を比較することで市場動向を捉え、ボラティリティ ストップを組み合わせることでリスクを管理します。この戦略は 5 分間の時間枠で実行され、シグナル生成の基礎として 300 期間および 500 期間の TEMA インジケーターを使用します。
戦略の中核となるロジックは、次の主要な要素に基づいています。
この戦略は、TEMA インジケーターのクロスオーバーを通じてトレンドを捉え、動的なストップロスでリスクを管理する完全なトレンド追跡システムです。この戦略は、明確な論理、簡単な実装、優れた実用性を備えています。ただし、実際の取引では、市場環境の識別とリスク管理に注意を払う必要があり、バックテストの検証に基づいて実際の市場状況に応じてパラメータを最適化することをお勧めします。
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("TEMA Strategy for Gold", overlay=true)
// Inputs
tema_short_length = input.int(300, title="Short TEMA Length")
tema_long_length = input.int(500, title="Long TEMA Length")
pip_value = input.float(0.10, title="Pip Value (10 pips = 1 point for Gold)")
// Calculate TEMA
tema_short = ta.ema(2 * ta.ema(close, tema_short_length) - ta.ema(ta.ema(close, tema_short_length), tema_short_length), tema_short_length)
tema_long = ta.ema(2 * ta.ema(close, tema_long_length) - ta.ema(ta.ema(close, tema_long_length), tema_long_length), tema_long_length)
// Plot TEMA
plot(tema_short, color=color.blue, title="300 TEMA")
plot(tema_long, color=color.red, title="500 TEMA")
// Crossover conditions
long_condition = ta.crossover(tema_short, tema_long)
short_condition = ta.crossunder(tema_short, tema_long)
// Calculate recent swing high/low
swing_low = ta.lowest(low, 10)
swing_high = ta.highest(high, 10)
// Convert pips to price
pip_adjustment = pip_value * syminfo.mintick
// Long entry logic
if (long_condition and strategy.position_size == 0)
stop_loss_long = swing_low - pip_adjustment
strategy.entry("Long", strategy.long)
label.new(bar_index, swing_low, style=label.style_label_down, text="Buy", color=color.green)
// Short entry logic
if (short_condition and strategy.position_size == 0)
stop_loss_short = swing_high + pip_adjustment
strategy.entry("Short", strategy.short)
label.new(bar_index, swing_high, style=label.style_label_up, text="Sell", color=color.red)
// Exit logic
if (strategy.position_size > 0 and short_condition)
strategy.close("Long")
label.new(bar_index, high, style=label.style_label_up, text="Exit Long", color=color.red)
if (strategy.position_size < 0 and long_condition)
strategy.close("Short")
label.new(bar_index, low, style=label.style_label_down, text="Exit Short", color=color.green)