多動量指標のコンボ戦略

作者: リン・ハーンチャオチャン, 日時: 2023-09-24 13:24:47
タグ:

概要

この実験戦略は,チャンデモメント,RMI,トリプルHMARSI,ダブルEVWRSI,トリプルEMARSIおよび他のモメント指標を組み合わせ,すべての指標が一致信号を与えるときにポジションに入力する.多要素実験モデル.

戦略の論理

  1. チャンド・モメントを計算して 買・売線を設定します

  2. RMI,Triple HMA RSI,Double EVW RSI,Triple EMA RSIなどの指標を計算する.

  3. 各指標の購入・販売ラインを設定する.

  4. チャンデ・モメンタムが買いラインを超えると,他のインジケーターもそれぞれの買いラインを下回っているかどうかを確認します.すべての条件が満たされている場合は,ロング信号を生成します.

  5. 逆に チャンデ・モメンタムが セールラインを下回り 他の指標が セールラインを超えると ショート信号が生成されます

利点

  1. インディケーターを組み合わせることで 相互の検証が可能になり 誤った信号は避けられます

  2. チャンデ・モメンタムは 傾向の変化を 敏感に捉えています

  3. RMI は,過買い/過売りレベルを特定するための動力レベルを示します.

  4. HMA RSI,EVW RSIなどで異なるRSI計算をテストする.

  5. 柔軟な多指標組み合わせにより,指標の有効性試験が可能になります.

リスク

  1. 多指標コンボの要件は 満たすのが難しく 取引が少なく 機会が失われます

  2. ストップ・ロスのようなリスク管理メカニズムはありません

  3. 時間枠に依存する指標のパフォーマンスは,すべての期間に機能しない可能性があります.

  4. パラメータの最適化なし パラメータの調節が不十分

  5. 戦略を完全に検証するには バックテストデータが不十分です

解決 できる 方法:

  1. より多くの取引のための指標の限界を緩める.

  2. 損失を制限するために,後退またはハードストップ損失を組み込む.

  3. 最適なパラメータを見つけるために 異なる製品とタイムフレームをテストします

  4. マシン学習やグリッド検索を パラメータ最適化に使う

  5. より多くの市場でのバックテストで 安定性を確保します

オプティマイゼーションの方向性

  1. 最適な設定を見つけるために異なるパラメータセットをテストします.

  2. 調整可能な多時間スケールモメントインジケーターを追加します

  3. 逆トレンドの取引を避けるためにトレンド検出を組み込む.

  4. マシンラーニングを使って 多指標の重さを改善する

  5. 移動平均システムと組み合わせてエントリを改善します

概要

この戦略は,複数のモメント指標を組み合わせることで,より信頼性の高いトレンドターニングポイントを特定しようとしています. 多様化された論理は,パラメータ選択,指標重量化,リスク制御などの分野で大きな拡張性と最適化可能性を秘めています. 安定性を確保しながら,より多くの品質の信号を取得するために,しかし,カーブフィッティングなどのリスクは管理する必要があります.


/*backtest
start: 2023-08-24 00:00:00
end: 2023-09-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © burgercrisis

//@version=4
strategy("RMI + Triple HMRSI + Double EVWRSI + TERSI Strategy")

//* Backtesting Period Selector | Component *//
//* https://www.tradingview.com/script/eCC1cvxQ-Backtesting-Period-Selector-Component *//
//* https://www.tradingview.com/u/pbergden/ *//
//* Modifications made *//
testStartYear = input(2021, "Backtest Start Year") 
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(999999, "Backtest Stop Year")
testStopMonth = input(9, "Backtest Stop Month")
testStopDay = input(26, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

testPeriod() => true
/////////////// END - Backtesting Period Selector | Component ///////////////


src = input(close, "Price", type = input.source)
CMOlength = input(9, minval=1, title="Alpha Chande Momentum Length")

//CMO
momm = change(src)
f1(m) => m >= 0.0 ? m : 0.0
f2(m) => m >= 0.0 ? 0.0 : -m
m1 = f1(momm)
m2 = f2(momm)
sm1 = sum(m1, CMOlength)
sm2 = sum(m2, CMOlength)
percent(nom, div) => 100 * nom / div
chandeMO = percent(sm1-sm2, sm1+sm2)
plot(chandeMO, "Chande MO", color=color.blue)




//RMI
// Copyright (c) 2018-present, Alex Orekhov (everget)
// Relative Momentum Index script may be freely distributed under the MIT license.
length3 = input(title="RMI Length", type=input.integer, minval=1, defval=30)
momentumLength3 = input(title="RMI Momentum ", type=input.integer, minval=1, defval=25)
up3 = rma(max(change(src, momentumLength3), 0), length3)
down3 = rma(-min(change(src, momentumLength3), 0), length3)

rmi3 = (down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3)))-50
//
//
// end RMI, end Alex Orekhov copywrite
//
//

lengthMA = input(7)
lengthRSI = input(14)
thrsi = hma(hma(hma(rsi(src, lengthRSI), lengthMA), lengthMA), lengthMA)
thrsi1 = (thrsi-50)*10

lengthMA2 = input(7)
lengthRSI2 = input(14)
devwrsi = ((ema(ema(vwma(rsi(src, lengthRSI2), lengthMA2), lengthMA2), lengthMA2))-50)*5

lengthMA3 = input(7)
lengthRSI3 = input(14)
tersi = ((ema(ema(ema(rsi(src, lengthRSI3), lengthMA3), lengthMA3), lengthMA3))-50)*10

rmirsi = ((thrsi*rmi3/25))

//Boundary Lines

obLevel1 = input(0, title="Chande Sellline")
osLevel1 = input(0, title="Chande Buyline")
hline(obLevel1, color=#0bc4d9)
hline(osLevel1, color=#0bc4d9)

obLevel2 = input(0, title="Triple HMRSI Sellline")
osLevel2 = input(0, title="Triple HMRSI Buyline")
hline(obLevel2, color=#5a0bd9)
hline(osLevel2, color=#5a0bd9)

obLevel3 = input(0, title="DEVWRSI Sellline")
osLevel3 = input(0, title="DEVWRSI Buyline")
hline(obLevel3, color=#5a0bd9)
hline(osLevel3, color=#5a0bd9)

obLevel4 = input(0, title="TERSI Sellline")
osLevel4 = input(0, title="TERSI Buyline")
hline(obLevel4, color=#5a0bd9)
hline(osLevel4, color=#5a0bd9)

obLevel5 = input(0, title="RMI Sellline")
osLevel5 = input(0, title="RMI Buyline")
hline(obLevel5, color=#5a0bd9)
hline(osLevel5, color=#5a0bd9)

obLevel6 = input(0, title="RMI*RSI Sellline")
osLevel6 = input(0, title="RMI*RSI Buyline")
hline(obLevel6, color=#5a0bd9)
hline(osLevel6, color=#5a0bd9)

plot((thrsi1), title="THRSI")
plot(devwrsi, color=color.red, title="DEVWRSI")
plot(tersi, color=color.yellow, title="TERSI")
plot(rmirsi, color=color.purple, title="RMI*HMRSI")
plot(rmi3, color=color.orange, title="RMI")




longcondition1 = crossover(chandeMO, osLevel1)
shortcondition1 = crossunder(chandeMO, obLevel1)
longcondition2 = rmirsi<osLevel6 and rmi3<osLevel5 and tersi<osLevel4 and devwrsi<osLevel3 and thrsi1<osLevel2  and longcondition1
shortcondition2 = rmirsi>obLevel6 and rmi3>obLevel5 and tersi>obLevel4 and devwrsi>obLevel3 and thrsi1>obLevel2  and shortcondition1

if testPeriod()
    if longcondition2
        strategy.entry("Buy", strategy.long)
    if shortcondition2
        strategy.entry("Sell", strategy.short)






hline(0, color=#C0C0C0, linestyle=hline.style_dashed, title="Zero Line")

もっと