
この戦略は,反転トレンド戦略とT3-CCI指標を組み合わせて,市場の反転点の時点で取引シグナルを発信することを実現し,ショートライン量化取引戦略に属します.
逆転トレンド戦略部分: 2日目閉盘価格比較を使用して価格逆転シグナルを判断し,9日目スローラインKライン指標と組み合わせて超買い超売り領域を判断し,多空信号を発する.
T3-CCI部分:T3平均線を使ってCCI指標の再平滑を行い,誤った信号を減らす,超買い超売り領域を判断し,反転トレンド戦略のフィルタリング入場タイミングに対応する.
この2つの信号の組み合わせは,最終的な取引の方向性を決定する.
2つの指標と価格の比較判断を使用して,潜在的逆転点を効果的に識別できます.
T3平均線の適用によりCCI信号の質が向上し,偽信号が減少する.
複数の種類の戦略を組み合わせることで,戦略の全体的な安定性を向上させることが期待される.
逆転が失敗すると,誤信号と損失が生じます.
パラメータの設定が不適切であることも,戦略のパフォーマンスに影響し,異なる市場に応じてパラメータを調整する必要がある.
逆転信号のタイム効率が悪く,迅速な逆転を間に合わせ捕捉することができない.
トレンドフィルターを加え,逆転の失敗を回避する.
マシン・ラーニングでパラメータを自動的に最適化してみましょう.
損失防止の仕組みを増やすこと
タイム・リバーシブを判断する指標を探求する.
この戦略は,複数の技術指標を総合的に使用して潜在的逆転点の判断を行う.市場逆転の機会を効果的に発見し,ショートライン操作に適した量化戦略である.パラメータ調整,ストップダスト保護,およびトレンド判断の組み合わせなどの複数の最適化手段によって,戦略の安定性をさらに強化することが期待される.
/*backtest
start: 2023-11-28 00:00:00
end: 2023-12-21 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 23/10/2020
// This is combo strategies for get a cumulative signal.
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
// The strategy sells at market, if close price is lower than the previous close price
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// 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...
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
vFast = sma(stoch(close, high, low, Length), KSmoothing)
vSlow = sma(vFast, DLength)
pos = 0.0
pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0)))
pos
T3_CCI(CCI_Period,T3_Period,b) =>
pos = 0.0
e1 = 0.0
e2 = 0.0
e3 = 0.0
e4 = 0.0
e5 = 0.0
e6 = 0.0
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
pos:= iff(xccir > 0, 1,
iff(xccir < 0, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & FX Sniper: T3-CCI", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
CCI_Period = input(14, minval=1)
T3_Period = input(5, minval=1)
b = input(0.618)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posT3_CCI = T3_CCI(CCI_Period,T3_Period,b)
pos = iff(posReversal123 == 1 and posT3_CCI == 1 , 1,
iff(posReversal123 == -1 and posT3_CCI == -1, -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)
if (possig == 0)
strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )