マルチファクター反転取引戦略


作成日: 2023-09-19 21:13:04 最終変更日: 2023-09-19 21:13:04
コピー: 1 クリック数: 719
1
フォロー
1617
フォロワー

概要

この戦略は,複数の技術指標を総合的に使用して,価格逆転を判断し,多要因駆動の逆転取引戦略に属します. 123形状と極化分形効率 ((PFE) の指標を統合し,両者が一致した信号を出すときに入場し,偽信号を効果的にフィルターし,取引の勝率を向上させることができます.

戦略原則

この戦略は主に2つの部分から構成されています.

  1. 形状判断: 閉盘価格が2日連続で上昇した後3日目に下がり,ストキャスティック速線が慢線より低くなると,買入シグナルが生じます. 閉盘価格が2日連続で下落した後3日目に反発し,ストキャスティック速線が慢線より高くなると,売出シグナルが生じます.

  2. PFE指数判断:PFEは,設定上限より高く見空し,設定下限より低く見空する.

123形はPFE指数と一致する信号を生成した場合のみ,入場する.両方が一致しない場合は,空席を維持する.

123形状は潜在的逆転点を識別できる。PFEはトレンド判定の効率性を高め,偽突破を追求することを避ける。両者は協働して判断精度を高め,多因子検証の効果を達成できる。

戦略的優位性

  • 123形状とPFE指標の相互検証により,偽信号が減少する
  • PFE指標の理論的基礎は堅牢で,価格効率の判断は有効である
  • 多要素駆動で判断の正確さを向上する
  • 逆転とトレンドの指標を組み合わせた戦略の柔軟性
  • 市場変化に対応するカスタマイズ可能なパラメータ

戦略的リスクと対応

  • 特定の要因が誤った信号を 発する可能性があります
  • 要素設定は,常に最適化と調整が必要である.
  • 短期間保有で,頻繁に損失を被るリスクがある

どう対処するか?

  1. 検証要素の増やし 精度向上
  2. パラメータ配置を最適化して,stablenessを向上させる
  3. 自動最適化による最適化方法
  4. 設定挨拶停止または移動停止

戦略最適化の方向性

この戦略は以下の点で最適化できます.

  1. ストップ・ロスの設定をVolatilityに追加する
  2. マシン・ラーニングなどの手法ですべてのパラメータを自動的に最適化します.
  3. トレンドが強い時,反転の頻度を下げる
  4. 市場変動に対する自適性指数との調整付きの保有
  5. 他の戦略の組み合わせ,リスク分散,全体的なリターン率の向上

要約する

この戦略は,価格の逆転点を判断する複数の要因を融合し,理論的な根拠があり,実行しやすい.単一の指標と比較して,複数の要因が判断精度を向上させ,比較的堅牢な逆転取引戦略である.パラメータ最適化,ストップ・マネジメント,組み合わせなどの方法によって戦略の効果をさらに強化することができる.

ストラテジーソースコード
/*backtest
start: 2023-09-11 00:00:00
end: 2023-09-13 08:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 16/04/2021
// 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 Polarized Fractal Efficiency (PFE) indicator measures the efficiency 
// of price movements by drawing on concepts from fractal geometry and chaos 
// theory. The more linear and efficient the price movement, the shorter the 
// distance the prices must travel between two points and thus the more efficient 
// the price movement.
//
// 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


PFE(Length,LengthEMA,BuyBand,SellBand) =>
    pos = 0.0
    PFE = sqrt(pow(close - close[Length], 2) + 100)
    C2C = sum(sqrt(pow((close - close[1]), 2) + 1), Length)
    xFracEff = iff(close - close[Length] > 0,  round((PFE / C2C) * 100) , round(-(PFE / C2C) * 100))
    xEMA = ema(xFracEff, LengthEMA)
    pos := iff(xEMA < SellBand, -1,
    	      iff(xEMA > BuyBand, 1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & PFE (Polarized Fractal Efficiency)", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- PFE ----")
LengthPFE = input(9, minval=1)
LengthEMA = input(5, minval=1)
BuyBand = input(50, step = 0.1)
SellBand = input(-50, step = 0.1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posPFE = PFE(LengthPFE,LengthEMA,BuyBand,SellBand)
pos = iff(posReversal123 == 1 and posPFE == 1 , 1,
	   iff(posReversal123 == -1 and posPFE == -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 )