この戦略は,快,遅の2つのEMAの交差状況によって価格の傾向を判断し,トレンド追跡操作を行う.
戦略の原則:
順番に2つのEMAを計算し,典型的なパラメータは,速線13周期,遅線48周期である.
スローラインが下から突破すると,多入場を行う.
価格が上から下へと急激に突破すると,複数のストップ・ロスの退出を行います.
選択的に空白操作のルールに加わり,双方向取引を行う.
この戦略の利点は
EMAの協力により,中長期トレンドを効果的に識別できます.
トレンドの初期段階に早期に入場できる突破取引方法.
単一損失をコントロールする簡単な直接的な方法.
この戦略のリスクは
EMA平均線は遅滞問題があり,ベストエントリーポイントを逃す可能性がある.
停止の幅を適正に緩め,頻繁に停止することを避ける.
震災の状況では,明確なトレンドの方向を判断するのは難しい.
要するに,この戦略は,EMAの交差を活用してトレンド判断と追跡を行う.パラメータ最適化とリスク管理の面でまだ向上できるが,全体的な考え方はシンプルで実用的である.異なる市場タイプに最適化することで適応できる.
/*backtest
start: 2022-09-05 00:00:00
end: 2023-09-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
// strategy("EMA Strategy 13 48", shorttitle = "EMA Strategy 13 48", overlay=true, pyramiding = 3,default_qty_type = strategy.percent_of_equity, default_qty_value = 1000)
// === Inputs ===
// short ma
maFastSource = input(defval = close, title = "Fast MA Source")
maFastLength = input(defval = 13, title = "Fast MA Period", minval = 1)
// long ma
maSlowSource = input(defval = close, title = "Slow MA Source")
maSlowLength = input(defval = 48, title = "Slow MA Period", minval = 1)
// === Vars and Series ===
fastMA = ema(maFastSource, maFastLength)
slowMA = ema(maSlowSource, maSlowLength)
plot(fastMA, color=blue)
plot(slowMA, color=purple)
goLong() => crossover(fastMA, slowMA)
killLong() => crossunder(close, fastMA)
strategy.entry("Buy", strategy.long, when = goLong())
strategy.close("Buy", when = killLong())
// Shorting if using
goShort() => crossunder (fastMA, slowMA)
killShort() => crossover(fastMA, slowMA)
//strategy.entry("Sell", strategy.short, when = goShort())
//strategy.close("Sell", when = killShort())