マルチファクター定量取引戦略


作成日: 2023-09-13 14:46:59 最終変更日: 2023-09-13 14:46:59
コピー: 0 クリック数: 672
1
フォロー
1617
フォロワー

多要素定量取引戦略.この戦略は,均線因子と振動指標因子を総合的に考慮して,リスクを制御し,安定性を高める.この記事では,この取引戦略の原理,利点,および潜在的なリスクについて詳しく説明する.

戦略原則

この戦略は以下の3つのモジュールから構成されています.

  1. 均線因子

5つの異なる周期のEMA平均線 ((8,13,21,34,55日) を使ってトレンドフィルターを構築する.平均線は短期から長期まで並べられ,短期平均線が長期平均線を横切るときにのみトレンド特性を有し,取引信号を生成する.

  1. 振動指標因子

RSIとストキャスティック2つの振動指標を組み合わせて,突破を検証し,振動的な市場で大量に偽突破を避ける.

RSIのパラメータは14で,RSIは40-70の範囲で多行条件に適合し,30-60の範囲で空行条件に適合する.

ストキャスティックパラメータは ((14,3,3),K線が20-80の範囲で多条件に適合し,5-95の範囲で空条件に適合する.

  1. 入場と出場の論理

均線因子と振動指標因子が同時に条件を満たしている場合にのみ,入場信号が誘発される.いずれかの因子が条件を満たしていない場合に,出場信号が生成される.

戦略全体は厳格な多要素フィルターメカニズムを採用し,高い勝率を維持しながら,取引信号の安定性と信頼性を確保しています.

戦略的優位性

  • 多要素デザインは,市場騒音をフィルターし,過剰取引を防ぎます.
  • トレンドファクターと逆転ファクターを考慮し,トレンドフォローと点取引の利点を考慮する
  • 均線と振動指標を組み合わせることで,トレンドの逆転点を捉えることができます.
  • 戦略の効果を最大限に発揮するために,パラメータを調整する.

危険性についてのヒント

  • 多因子戦略の信号頻度が低いため,取引機会の一部を逃す可能性があります.
  • 平均線が遅滞し,より短い周期の指標と組み合わせて検証する
  • 振動指標は偽信号を生成しやすいので,補助因子としてのみ使用すべきである.
  • 市場環境の変化に対応するためにパラメータを定期的に最適化する必要があります.

要約する

この戦略は,トレンドフォローと反転取引の優位性を成功的に融合させ,多要素モデルがリスクを効果的に制御し,安定した超利益を得ることができます.これは非常に実用的な量化取引戦略モデルであり,AIコミュニティの深入な研究と適用に値します.

ストラテジーソースコード
/*backtest
start: 2022-09-12 00:00:00
end: 2022-11-15 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title = "Combined Strategy", default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type=strategy.commission.percent, commission_value = .0020, pyramiding = 0, slippage = 3, overlay = true)

//----------//
// MOMENTUM //
//----------//
ema8 = ema(close, 8)
ema13 = ema(close, 13)
ema21 = ema(close, 21)
ema34 = ema(close, 34)
ema55 = ema(close, 55)

plot(ema8, color=red, style=line, title="8", linewidth=1)
plot(ema13, color=orange, style=line, title="13", linewidth=1)
plot(ema21, color=yellow, style=line, title="21", linewidth=1)
plot(ema34, color=aqua, style=line, title="34", linewidth=1)
plot(ema55, color=lime, style=line, title="55", linewidth=1)

longEmaCondition = ema8 > ema13 and ema13 > ema21 and ema21 > ema34 and ema34 > ema55
exitLongEmaCondition = ema13 < ema55

shortEmaCondition = ema8 < ema13 and ema13 < ema21 and ema21 < ema34 and ema34 < ema55
exitShortEmaCondition = ema13 > ema55

// ----------  //
// OSCILLATORS //
// ----------- //
rsi = rsi(close, 14)
longRsiCondition = rsi < 70 and rsi > 40
exitLongRsiCondition = rsi > 70

shortRsiCondition = rsi > 30 and rsi < 60
exitShortRsiCondition = rsi < 30

// Stochastic
length = 14, smoothK = 3, smoothD = 3
kFast = stoch(close, high, low, 14)
dSlow = sma(kFast, smoothD)

longStochasticCondition = kFast < 80
exitLongStochasticCondition = kFast > 95

shortStochasticCondition = kFast > 20
exitShortStochasticCondition = kFast < 5

//----------//
// STRATEGY //
//----------//

longCondition = longEmaCondition and longRsiCondition and longStochasticCondition and strategy.position_size == 0
exitLongCondition = (exitLongEmaCondition or exitLongRsiCondition or exitLongStochasticCondition) and strategy.position_size > 0

if (longCondition)
    strategy.entry("LONG", strategy.long)
if (exitLongCondition)
    strategy.close("LONG")
    
shortCondition = shortEmaCondition and shortRsiCondition and shortStochasticCondition and strategy.position_size == 0
exitShortCondition = (exitShortEmaCondition or exitShortRsiCondition or exitShortStochasticCondition) and strategy.position_size < 0

if (shortCondition)
    strategy.entry("SHORT", strategy.short)
if (exitShortCondition)
    strategy.close("SHORT")