
これは,T3平滑移動平均とCCI指標を利用してトレンド追跡を実現する量化戦略である.この戦略は,T3-CCI指標を計算してトレンドを識別し,二重確認信号が得られたときに市場に出入してトレンドを追跡する.
この戦略は,まずT3平滑移動平均とCCI指標を計算し,CCI指標を一連の波でT3-CCI指標に計算する.T3-CCI指標が0軸を横切るときに買入シグナルを生じ,0軸を横切るときに売出シグナルを生じます.偽信号をフィルターするために,この戦略は,T3-CCI指標が2連期の同じ信号を維持することを要求します.
具体的には,この戦略は以下のステップを踏まえている.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
対策として
この戦略は以下の方向から最適化できます.
この戦略は,全体的に信頼性の高い中長線トレンド追跡戦略である.これは,二重確認とトレンド追跡特性を利用してリスクを制御し,トレンド取引の基本戦略として使用することができる.パラメータとルールの最適化により,戦略のパフォーマンスをさらに向上させることができる.
/*backtest
start: 2023-11-16 00:00:00
end: 2023-11-23 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version = 2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 19/12/2016
// This simple indicator gives you a lot of useful information - when to enter, when to exit
// and how to reduce risks by entering a trade on a double confirmed signal.
//
// You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="FX Sniper: T3-CCI Strategy", shorttitle="T3-CCI")
CCI_Period = input(14, minval=1)
T3_Period = input(5, minval=1)
b = input(0.618)
reverse = input(false, title="Trade reverse")
hline(0, color=purple, linestyle=line)
xPrice = close
b2 = b*b
b3 = b2*b
c1 = -b3
c2 = (3*(b2 + b3))
c3 = -3*(2*b2 + b + b3)
c4 = (1 + 3*b + b3 + 3*b2)
nn = iff(T3_Period < 1, 1, T3_Period)
nr = 1 + 0.5*(nn - 1)
w1 = 2 / (nr + 1)
w2 = 1 - w1
xcci = cci(xPrice, CCI_Period)
e1 = w1*xcci + w2*nz(e1[1])
e2 = w1*e1 + w2*nz(e2[1])
e3 = w1*e2 + w2*nz(e3[1])
e4 = w1*e3 + w2*nz(e4[1])
e5 = w1*e4 + w2*nz(e5[1])
e6 = w1*e5 + w2*nz(e6[1])
xccir = c1*e6 + c2*e5 + c3*e4 + c4*e3
cciHcolor = iff(xccir >= 0 , green,
iff(xccir < 0, red, black))
pos = iff(xccir > 0, 1,
iff(xccir < 0, -1, nz(pos[1], 0)))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(xccir, color=blue, title="T3-CCI")
plot(xccir, color=cciHcolor, title="CCIH", style = histogram)