モメンタムトレンド同期戦略


作成日: 2024-01-16 14:10:25 最終変更日: 2024-01-16 14:10:25
コピー: 0 クリック数: 818
1
フォロー
1617
フォロワー

モメンタムトレンド同期戦略

概要

動態トレンド同期戦略は,相対動態指数 (RMI) と超トレンド指標の優位性を統合することによって,動態分析とトレンド判断の有効な組み合わせを実現する.この戦略は,価格変化の傾向と市場動力のレベルを同時に注目し,市場進路をより包括的な視点から判断する.

戦略原則

相対運動量指数 (RMI)

RMIは,相対強度指数 (RSI) の改良版である.これは,価格変化の方向性,幅度などの特性を統合し,市場動向をより正確に判断することができる.

RMI計算方法

RMIの計算方法は,ある周期間の平均上昇と平均低下を計算する.RSIとは異なり,RMIは,その日の終止価格と前日の終止価格の変化値を用いて,単純に正の上昇と負の上昇ではなく,平均上昇を平均低下で割って,再帰処理を行い,値が0-100の範囲に落下する.

動力判断

この戦略は,RMIとMFIの平均値を,予期された正動量減值と負動量減值と比較して,現在の市場動力のレベルを判断し,そのためにポジションと平仓の決定を行います.

超トレンド指標

超トレンド指標は,より高い時間周期の計算に基づいて,大トレンドの判断を提供することができる.それは,実際の波幅ATRの動的調整パラメータに基づいて,トレンドの転換点を効果的に識別することができる.
この戦略には,重要なトレンド転換を識別する能力をさらに強化するために,取引量重み平均線VWMAが追加されています.

取引方向の選択

この戦略は,多,空白,または双方向の取引の選択肢があります. これは,トレーダーが自分の市場観とリスクの好みに応じて柔軟に調整できるようにします.

戦略的優位分析

動力とトレンドを組み合わせた判断

動力指標またはトレンド指標を単体で使用する戦略と比較して,この戦略はRMIとスーパートレンド指標の統合の優位性によって,より正確な市場動向判断を実現します.

多時間周期分析

RMIと超トレンドの指標を異なる周期に適用することで,短期的および長期的トレンドの把握が得られます.

リアルタイム・ストップ・ローズ戦略

超トレンドに基づくリアルタイム・ストップ・メカニズムにより,単一損失を効果的に制御できます.

取引方向の柔軟性

多,空,双方向の取引の選択は,この戦略を異なる市場環境に適応させる.

リスク分析

パラメータを最適化するのは難しい

RMIや超トレンドなどのパラメータの最適化は複雑で,不適切な設定は戦略の効果に影響を与える可能性がある.

ストップがあまりにも近づいてしまうと,ストップがあまりにも多くなります.

小周期的な市場の波動に過度に敏感で,頻繁にストップ・ローズの問題が生じます.

解決方法: 適切な止損範囲の放寬,または他の振動型止損方法を採用する.

戦略最適化の方向性

多種適応の最適化

適用可能な品種の範囲を広げ,異なる品種のパラメータの最適化方向を識別する.戦略をより多くの市場で複製できるようにする.

動的ストップロス最適化

ダイナミック・ストップモードが追加され,ストップラインが現在の波段をよりよく追跡できるようにし,小振動による過度のストップダメージを減らす.

フィルタリング条件を追加

フィルタリング条件として,より多くの指標と判断を組み合わせて,明確な信号がない場合に倉庫を建てるのを避ける.

要約する

この戦略は,RMIと超トレンド指標の巧妙な組み合わせによって,市場の状態を正確に判断することを可能にします. リスク管理においても優れています. 深層の最適化により,多種種および多周期でのパフォーマンスはますます優れていると信じられています.

ストラテジーソースコード
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 3h
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/
// @ presentTrading

//@version=5
strategy("RMI Trend Sync - Strategy [presentTrading]", shorttitle = "RMI Sync [presentTrading]", overlay=true )

// ---> Inputs --------------
// Add Button for Trading Direction
tradeDirection = input.string("Both", "Select Trading Direction", options=["Long", "Short", "Both"])

// Relative Momentum Index (RMI) Settings
Length = input.int(21, "RMI Length", group = "RMI Settings")
pmom = input.int(70, "Positive Momentum Threshold", group = "RMI Settings")
nmom = input.int(30, "Negative Momentum Threshold", group = "RMI Settings")
bandLength = input.int(30, "Band Length", group = "Momentum Settings")
rwmaLength = input.int(20, "RWMA Length", group = "Momentum Settings")


// Super Trend Settings
len = input.int(10, "Super Trend Length", minval=1, group="Super Trend Settings")
higherTf1 = input.timeframe('480', "Higher Time Frame", group="Super Trend Settings")
factor = input.float(3.5, "Super Trend Factor", step=.1, group="Super Trend Settings")
maSrc = input.string("WMA", "MA Source", options=["SMA", "EMA", "WMA", "RMA", "VWMA"], group="Super Trend Settings")
atr = request.security(syminfo.tickerid, higherTf1, ta.atr(len))
TfClose1 = request.security(syminfo.tickerid, higherTf1, close)

// Visual Settings
filleshow = input.bool(true, "Display Range MA", group = "Visual Settings")
bull = input.color(#00bcd4, "Bullish Color", group = "Visual Settings")
bear = input.color(#ff5252, "Bearish Color", group = "Visual Settings")

// Calculation of Bar Range
barRange = high - low

// RMI and MFI Calculations
upChange = ta.rma(math.max(ta.change(close), 0), Length)
downChange = ta.rma(-math.min(ta.change(close), 0), Length)
rsi = downChange == 0 ? 100 : upChange == 0 ? 0 : 100 - (100 / (1 + upChange / downChange))
mf = ta.mfi(hlc3, Length)
rsiMfi = math.avg(rsi, mf)

// Momentum Conditions
positiveMomentum = rsiMfi[1] < pmom and rsiMfi > pmom and rsiMfi > nmom and ta.change(ta.ema(close,5)) > 0
negativeMomentum = rsiMfi < nmom and ta.change(ta.ema(close,5)) < 0

// Momentum Status
bool positive = positiveMomentum ? true : negativeMomentum ? false : na
bool negative = negativeMomentum ? true : positiveMomentum ? false : na

// Band Calculation
calculateBand(len) =>
    math.min(ta.atr(len) * 0.3, close * (0.3/100)) * 4 

band = calculateBand(bandLength)

// Range Weighted Moving Average (RWMA) Calculation
calculateRwma(range_, period) =>
    weight = range_ / math.sum(range_, period)
    sumWeightedClose = math.sum(close * weight, period)
    totalWeight = math.sum(weight, period)
    sumWeightedClose / totalWeight

rwma = calculateRwma(barRange, rwmaLength)
colour = positive ? bull : negative ? bear : na
rwmaAdjusted = positive ? rwma - band : negative ? rwma + band : na

max = rwma + band
min = rwma - band

longCondition       = positive and not positive[1]
shortCondition      = negative and not negative[1]

longExitCondition   = shortCondition
shortExitCondition  = longCondition

// Dynamic Trailing Stop Loss

vwma1 = switch maSrc
    "SMA"  => ta.sma(TfClose1*volume, len) / ta.sma(volume, len)
    "EMA"  => ta.ema(TfClose1*volume, len) / ta.ema(volume, len)
    "WMA"  => ta.wma(TfClose1*volume, len) / ta.wma(volume, len)

upperBand = vwma1 + factor * atr
lowerBand = vwma1 - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
float superTrend = na
int direction = na
superTrend := direction == -1 ? lowerBand : upperBand

longTrailingStop = superTrend - atr * factor
shortTrailingStop = superTrend + atr * factor

// Strategy Order Execution
if (tradeDirection == "Long" or tradeDirection == "Both")
    strategy.entry("Long", strategy.long, when = longCondition)
    strategy.exit("Exit Long", "Long", when=longExitCondition, stop = longTrailingStop)
if (tradeDirection == "Short" or tradeDirection == "Both")
    strategy.entry("Short", strategy.short, when =shortCondition)
    strategy.exit("Exit Short", "Short", when=shortExitCondition, stop = shortTrailingStop)