この戦略は,TEMA,DEMA,HMAの3つの異なるタイプの移動平均の組み合わせを使用して,中短期平均TEMAとDEMAが金叉/デッドフォーク信号を発信するときに入場し,長期平均HMAを使用してトレンドの方向を判断し,逆転取引信号をフィルターします.
具体的には,この戦略は,二指数移動平均DEMAを用いることで中期トレンドを判断し,三指数移動平均TEMAを用いることで短期トレンドを判断し,密集型移動平均HMAを用いることで長期トレンドを判断する.短期中期が同じ方向で開始され (TEMAとDEMAは同方向の突破) 長期の主なトレンドも同方向 (HMAの方向は突破と一致) している場合にのみ,取引シグナルが生成される.
複数のパラメータテストによって最適なパラメータの組み合わせを見つけ,ストップ・ローズ戦略を導入し,入場条件を適切に緩和してリスクを管理することができます.
この戦略は,複数の均線指標を組み合わせてトレンドを判断する. 優点は,信号生成が明確で,配置可能なスペースが大きいこと. 欠点は,遅れのリスクと複数のパラメータに依存することである. パラメータ最適化,ストップダスト戦略などの制御可能なリスクを使用して,組合せ均線の優位性を発揮する. この戦略は,トレーダーがトレンド取引のテクニックを完全に掌握するのを助けます.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tuned-com
//@version=4
strategy("TEMA/DEMA/HMA", overlay=true, pyramiding=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=1000000, commission_type=strategy.commission.percent, commission_value=0.1)
Tlength = input(8, title="TEMA Length", minval=1)
Dlength = input(43, title="DEMA Length", minval=1)
Hlength = input(52, title="Hull Length", minval=1)
Rlength = input(2, title="Hull Trend Test Length", minval=1)
//TEMA//
ema1 = ema(close, Tlength)
ema2 = ema(ema1, Tlength)
ema3 = ema(ema2, Tlength)
tema = 3 * (ema1 - ema2) + ema3
//DEMA//
e1 = ema(close, Dlength)
e2 = ema(e1, Dlength)
dema = 2 * e1 - e2
//HMA//
hma = wma(2 * wma(close, Hlength / 2) - wma(close, Hlength), round(sqrt(Hlength)))
up = crossunder(dema, tema) and rising(hma, Rlength)
down = crossover(dema, tema) and falling(hma, Rlength)
downc = crossunder(dema, tema)
upc = crossover(dema, tema)
plot(dema, color=color.green, linewidth=2)
plot(tema, color=color.aqua, linewidth=2)
plot(hma, color=rising(hma, Rlength) ? color.green : na, linewidth=2, transp=0)
plot(hma, color=falling(hma, Rlength) ? color.red : na, linewidth=2, transp=0)
bgcolor(rising(hma, Rlength) ? color.green : na, transp=70)
bgcolor(falling(hma, Rlength) ? color.red : na, transp=70)
plotarrow(tema - dema, colorup=color.green, colordown=color.red, transp=70)
if up
strategy.entry("Long Entry", strategy.long)
if down
strategy.entry("Short Entry", strategy.short)