
三均線交差動量策略は,市場動向を追跡する典型的な技術指標策策である. 16周期,36周期,72周期の3つの単純な移動平均を組み合わせて,それらの多頭交差と空頭交差によって市場動向を判断し,カフマン自律的な移動平均をフィルターとして組み合わせて,トレンドの方向がより明確であるときに,多行または空行の操作を行う.
この戦略の核心指標は,16周期,36周期,72周期の3つの単純な移動平均である.短周期平均線上を長い周期平均線が横切ると,市場が多頭トレンドに入ることを示す.短周期平均線下を長い周期平均線が横切ると,市場が空頭トレンドに入ることを示す.例えば,16平均線上を36平均線と72平均線が横切ると,多頭信号であり,16平均線下を36平均線と72平均線が横切ると,空頭信号である.
カフマン自律移動平均 ((KAMA) は,傾向が不明な場合に誤信号を避けるためのフィルターとして使用されます. KAMAが非加速または非減速モードにある場合のみ (すなわち,線形段) 均線交差信号が活性化され,実行されます.
策略は平均線の交差を追跡し,傾向がより明快なときに,多行または空白の操作を行う.多行条件は16平均線上を通過36平均線と72平均線,およびKAMA線性 ((加速しない);空白条件は16平均線下を通過36平均線と72平均線,およびKAMA線性 ((減速しない) である.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
平均線パラメータを適切に調整し,ストップ・ローズを設定し,または波動の大きい市場でのみこの戦略を使用することでリスクを軽減することができます.
この戦略は以下の方法で最適化できます.
三均線交差動力の戦略は,全体として,より古典的で実用的な追跡トレンド型の戦略である.それは,複数の時間帯の均線の交差によって市場の中長線動きを判断し,一部のノイズを効果的にフィルターする.選択時の取引の参照指標の1つとして使用することができる.しかし,この戦略には一定の弱点があり,より広範な市場で中立性を保つためにさらなる拡張と最適化が必要である.
/*backtest
start: 2023-11-24 00:00:00
end: 2023-12-24 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Wielkieef
//@version=5
strategy(title='Three SMA-crossover strategy [30min] ', overlay=true, pyramiding=1, initial_capital=10000, default_qty_type=strategy.cash, default_qty_value=10000, calc_on_order_fills=false, slippage=0, commission_type=strategy.commission.percent, commission_value=0.03)
src = close
Length1 = input.int(16, title=' 1-SMA Lenght', minval=1, group='SMA')
Length2 = input.int(36, title=' 2-SMA Lenght', minval=1, group='SMA')
Length3 = input.int(72, title=' 3-SMA Lenght', minval=1, group='SMA')
SMA1 = ta.sma(close, Length1)
SMA2 = ta.sma(close, Length2)
SMA3 = ta.sma(close, Length3)
Long_ma = SMA1 > SMA2 and SMA2 > SMA3
Short_ma = SMA1 < SMA2 and SMA2 < SMA3
LengthMainSMA = input.int(100, title=' Trend SMA ', minval=1)
SMAas = ta.sma(src, LengthMainSMA)
// Powered Kaufman Adaptive Moving Average by alexgrover (modificated by Wielkieef)
lengthas = input.int(50, title=' KAMA Lenght')
sp = input.bool(true, title=' Self Powered')
er = math.abs(ta.change(close, lengthas)) / math.sum(math.abs(ta.change(close)), lengthas)
pow = sp ? 1 / er : 2
per = math.pow(math.abs(ta.change(close, lengthas)) / math.sum(math.abs(ta.change(close)), lengthas), pow)
a = 0.
a := per * src + (1 - per) * nz(a[1], src)
mad4h = 0.
a_f = a / a[1] > .999 and a / a[1] < 1.001
///.
Bar_color = close > SMAas ? color.green : Long_ma ? color.blue : Short_ma ? color.maroon : color.gray
barcolor(color=Bar_color)
long_cond = Long_ma and SMAas < close and not a_f and close > a
short_cond = Short_ma and SMAas > close and not a_f and close < a
long_stop = Short_ma and SMAas < close
short_stop = Long_ma and SMAas > close
SMA1plot = plot(SMA1, color=Bar_color, linewidth=2)
SMA2plot = plot(SMA2, color=Bar_color, linewidth=4)
SMA3plot = plot(SMA3, color=Bar_color, linewidth=2)
fill(SMA1plot,SMA3plot,title="RANGE " ,color = color.new(Bar_color, 50))
if long_cond
strategy.entry('Long', strategy.long)
if short_cond
strategy.entry('Short', strategy.short)
strategy.close_all(when=long_stop or short_stop)
//by wielkieef