マルチインジケーター融合反転取引戦略


作成日: 2023-09-13 15:04:40 最終変更日: 2023-09-13 15:04:40
コピー: 0 クリック数: 695
1
フォロー
1617
フォロワー

この戦略は,多指標融合逆転取引戦略と呼ばれる.この戦略は,複数の技術指標を総合的に適用し,短期間に価格が逆転するタイミングを識別し,利益を得るために逆転取引を行う.

まず,この戦略は123反転形状を用いて短期価格反転を判断する.123反転形状は,価格が3日連続で閉店した際の高低のギャップが目立つ形状であり,第3日の閉店の反転前の2日間のトレンドである.統計によると,123反転形状を継続して信号を発信する利得率が高い.

次に,この戦略は,反転信号の信頼性を判断するためにランダムな指標RSIを組み込む. RSIが50未満は超売形を表し,50以上は超買い形を表します. RSIを組み合わせると,123の反転形だけで過度の信頼性のない信号を生じることを防ぐことができます.

最後に,この戦略は,CMO指標の多周期叉差の判定を導入した.CMO叉差は,異なる周期指標の移動平均を組み合わせて,価格動きの逆転を判断した.その信号は,再び123逆転の取引時間を確認した.

上記の複数の指標の総合的な使用は,価格逆転の捕捉の成功率を向上させ,過度の不確実性信号を避けることができます. RSIとCMOが123形状を支持するときに,強力な逆転取引信号を発信します.

この戦略は,ショートショート価格の脈動を捕捉する振動市場を整頓するのに適しています.しかし,複数の指標の組み合わせは,異なる指標が相互にヘッジされる場合にも容易であり,パラメータの最適化が必要です.止損戦略は,単一取引の最大損失を制御するために使用する必要があります.

概して,多指標融合反転取引戦略は,市場反転のタイミングの判断精度を高める様々なツールを統合している.しかし,いかなる単一の戦略も完璧であることは困難であり,現在の市場状況に応じてトレーダーが細かい検証と調整を必要とし,常に取引意識の柔軟性を維持する必要があります.

ストラテジーソースコード
/*backtest
start: 2023-01-01 00:00:00
end: 2023-03-11 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 25/02/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
// The related CMOaDisparity Index article is copyrighted material from Stocks & Commodities Dec 2009
// My strategy modification.
//
// 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

CMOD(LengthFirst, LengthSecond, LengthThird) =>
    pos = 0.0
    xEMAFirst = ema(close,LengthFirst)
    xEMASecond  = ema(close,LengthSecond)
    xEMAThird  = ema(close,LengthThird)
    xResFirst = 100 * (close - xEMAFirst) / close
    xResSecond = 100 * (close - xEMASecond) / close
    xResThird = 100 * (close - xEMAThird) / close
    pos := iff(xResThird > xResFirst, -1,
             iff(xResThird < xResSecond, 1, nz(pos[1], 0)))     
    pos

strategy(title="Combo Backtest 123 Reversal & CMOaDisparity 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)
//-------------------------
LengthFirst = input(50, minval=1)
LengthSecond = input(25, minval=1)
LengthThird = input(10, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOD = CMOD(LengthFirst, LengthSecond, LengthThird)
pos = iff(posReversal123 == 1 and posCMOD == 1 , 1,
	   iff(posReversal123 == -1 and posCMOD == -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 )