
双動量指数と反転複合策略は,反転策略と動量策略を組み合わせた複合策略である.これは,123反転策略と商品選択指数 (CSI) の2つの子策略を総合的に運用し,双動信号に基づいて入場時間を判断する.この策略は,取引信号の正確性を向上させることを目的としている.
この戦略は以下の2つの子戦略で構成されています.
123反転策 ≪それは,閉盘価格が上昇し,ストック指数が50を下回った2日連続で多額にする.閉盘価格が低下し,ストック指数が50以上で空きをする2日連続で空きする。反転策に属する。
商品選択指数 (CSI) 戦略.それは平均実物価格範囲指標 (ATR) と平均方向運動指標 (ADX) を組み合わせている.ATRは市場の波動性を反映し,ADXはトレンドの強さを反映している.CSI値が高くなるほど,市場の傾向性と波動性が強くなる.動量追跡型の戦略である.
この戦略は123反転戦略を主体としており,CSI戦略は補助的なconfirmationである. 両方の信号が一致するときにのみ取引信号を発行する. オーバーすると,閉盘価格が連続して2日上昇し,ストークは50を下回り,CSIは移動平均を通過する. 空きすると,閉盘価格が連続して2日低下し,ストークは50を超え,CSIは移動平均を通過する.
これにより,取引信号の反転特性が保証され,CSI指標フィルタが加えられ,偽信号が減少する.
この戦略の利点は以下の通りです.
逆転と動量との組み合わせにより,信号の精度が向上する.123逆転戦略は主信号として,突然の激烈な動きの逆転を捉えることができる.CSI指標は副確認として,部分的なノイズをフィルターすることができる.
複合フィルタを使用すると,純保有額を大幅に減らすことができます.たとえ子戦略自体には一定の偽信号比率があるとしても,最終的な信号は二重一致しなければならないので,偽信号のほとんどをフィルタリングして,不必要な繰り返し平仓を最小限に抑えることができます.
子策略のパラメータは個別に最適化できる。123反転策略とCSI策略のそれぞれのパラメータは,互いに干渉することなく,個別にテスト・最適化できる。これは最適なパラメータの組み合わせを見つけるのに便利である。
単独で有効な子策略.この策略は,123反転策略またはCSI策略のみを使用した取引をサポートしている.これは,策略の柔軟性を提供します.
複合フィルタリングによって偽信号を大幅に削減したにもかかわらず,以下の主要なリスクは残っています.
策略信号は比較的低頻度で発生する.二重確認方式を使用すると,一定割合の取引機会を 필터링することが必然である.これは,高い勝利率を達成するために必然的に支払われる.
2つの子策略のパラメータが不適切である場合,信号が希少または信号がないことになりかねません.パラメータを厳格にテストして最適化して最適なパラメータの組み合わせを見つける必要があります.
123反転は逆市操作である.この戦略は,連続して急激な単一価格突破が発生した場合,大きなリスクに直面する.
この戦略の主要な最適化領域は以下の通りです.
各子策略の内にあるパラメータを最適化して,最適なパラメータの組み合わせを見つける. ストッチ指数パラメータ,CSI指数パラメータなどを含む.
異なる市場状態のフィルターを追加するテスト.例えば,トレンドが盛んであるときにのみCSI戦略を使用し,揺れ動いている市場でのみ123反転戦略を使用するなど.これは,子戦略の劣勢を一定程度に克服する.
開発パラメータの自己適応と動的最適化モジュール. 策略がリアルタイム市場の状態と統計データに基づいてパラメータを自動的に調整し,最適なパラメータの組み合わせをリアルタイムで追跡できるようにする.
異なる損失の仕組みをテストする.適切な損失は,リスクを効果的に制御し,不必要な繰り返し開拓を減らすことができます.
双動量指数と反転複合策は,複数の信号の確認と組み合わせの考え方を適用し,反転策と動量策のそれぞれの優位性を有効に活用し,同時に相互のフィルタリングによって両者の劣位性を緩和し,高効率と高安定性を実現する.これは選択可能な典型的な量化策の1つです.
/*backtest
start: 2024-01-06 00:00:00
end: 2024-02-05 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 25/10/2019
// 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
// The Commodity Selection Index ("CSI") is a momentum indicator. It was
// developed by Welles Wilder and is presented in his book New Concepts in
// Technical Trading Systems. The name of the index reflects its primary purpose.
// That is, to help select commodities suitable for short-term trading.
// A high CSI rating indicates that the commodity has strong trending and volatility
// characteristics. The trending characteristics are brought out by the Directional
// Movement factor in the calculation--the volatility characteristic by the Average
// True Range factor.
// Wilder's approach is to trade commodities with high CSI values (relative to other
// commodities). Because these commodities are highly volatile, they have the potential
// to make the "most money in the shortest period of time." High CSI values imply
// trending characteristics which make it easier to trade the security.
// The Commodity Selection Index is designed for short-term traders who can handle
// the risks associated with highly volatile markets.
//
// 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
fADX(Len) =>
up = change(high)
down = -change(low)
trur = rma(tr, Len)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, Len) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, Len) / trur)
sum = plus + minus
100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), Len)
CSI(Length, Commission, Margin, PointValue) =>
pos = 0.0
K = 100 * ((PointValue / sqrt(Margin) / (150 + Commission)))
xATR = atr(Length)
xADX = fADX(Length)
nADXR = (xADX + xADX[Length]) * 0.5
xCSI = K * xATR * nADXR
xMACSI = sma(xCSI, Length)
pos := iff(xCSI < xMACSI, 1,
iff(xCSI > xMACSI, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Strategy 123 Reversal & Commodity Selection Index", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
PointValue = input(50)
Margin = input(3000)
Commission = input(10)
LengthCSI = input(14)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCSI = CSI(LengthCSI, Commission, Margin, PointValue)
pos = iff(posReversal123 == 1 and posCSI == 1 , 1,
iff(posReversal123 == -1 and posCSI == -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 )