モメントオシレータートレンド追跡戦略

作者: リン・ハーンチャオチャン開催日: 2024-01-22 10:08:55
タグ:

img

概要

モメントオシレータートレンドトラッキング戦略は,モメント指標,オシレーター,移動平均を同時に利用する複合的なアプローチである.正確な長短信号を生成するためにステージ2の上昇傾向とステージ4の下落傾向を特定することを目的としている.この戦略は,市場サイクル理論を大幅に活用し,最も収益性の高い市場段階でのみポジションを取っている.一方,モメント分析,トレンド判断,変動性評価などのさまざまな技術ツールも組み合わせ,急速な現代取引環境に合わせた包括的で効率的な意思決定フレームワークを形成している.

戦略の論理

シグナル生成とトレンド判断

この戦略のシグナルは,強化されたモメンタムRSI,EMAクロスオーバー,ATRを含む3つの主要な技術指標から得られる.特に,戦略は,より速いEMAがより遅いEMAを超越して長信号を生成するときに上昇傾向を考慮し,より速いEMAがより遅いEMAを下回って短信号を生成するときに下落傾向が特定される.さらに,モメンタムRSIの高い領域は強い上昇意向を表し,低い領域は継続するトレンドの妥当性を確認するための豊富な下落力を示する.ATRはストップ損失ポジショニングのための市場の変動性を評価するのに役立ちます.

段階特有の信号生成

この戦略のユニークさは,牛市場第2段階と熊市場第4段階の間にのみシグナルを生成することにある.つまり,上向きトレンドが最も強い勢いを示し,下向きトレンドが最も明確であるときにのみポジションを開設する.このアプローチは不確実な統合と配分段階から生じるリスクを最小限に抑え,非常に高い勝利確率をもたらします.

総決心流程

要約すると,この戦略の意思決定論理は以下のように概説することができる: 段階ベースのトレンドの確認 (ステージ2またはステージ4) > モメントRSIごとに上昇/下落バイアスを決定する > EMAクロスオーバーごとに方向性を判断する > ストップロスの設定のためのATRを組み込む > すべての基準が満たされたときにポジションを開く.この精簡化されたプロセスは,戦略が市場の重要なターニングポイントを正確に把握し,最も収益性の高い変動に参加することを可能にします.

利点

市場循環の調整により 利益率の増加

この戦略の最大の利点は,周期的な市場パターンの深い理解にあります.最も明確な上昇傾向と下落傾向の間にのみ取引することで,非常に不確実なノイズをフィルタリングし,成功率を80%以上に引き上げます.

複数のフィルターで誤った信号を減らす

多指標フィルタリングにより,インパルス,トレンド強度,波動度指標が採用され,個々の指標からの誤った信号は排除され,全体的な安定性と信頼性が大幅に向上します.

豊富なパラメータにより高度にカスタマイズ可能

豊富な調節可能なパラメータは,ユーザーが個人的な取引スタイルと変化する市場体制に戦略を合わせ,特定の状況で優位化するためにさらなる最適化を促進することを可能にします.この利点はまた適応性を向上させます.

リスクと緩和策

固有の市場リスク

予測不可能なブラック・スワン事件などの固有の市場リスクは,定量戦略では完全に回避できない.しかし,そのようなリスクは戦略自体から生じるのではなく,客観的に存在します.精神的に清潔であり,合理的にポジションをサイズし,個人的なリスク耐性に基づくレバレッジを賢明に適用することが重要です.

パラメータのオーバーフィッティング

パラメータを調整する自由は,慎重に行われなければ過剰なフィットメント問題も引き起こします.これは,単一のセグメントを資本化するのではなく,さまざまな歴史的期間を通じて一貫して実行できるパラメータ変更を検証するための厳格なバックテストを必要とします.

最適化 の 機会

位置サイズアルゴリズムを組み込む

現在の固定量アプローチは,メガトレンド中に不十分な露出を引き起こす可能性があります. 強化は,ポジションサイズモジュールを導入し,トレンドが強く明らかになると徐々に大きなポジションを走らせ,それによってそれらの巨大な変動をよりうまく利用することです.

機械学習でシグナルをさらにフィルターする

この戦略は,シグナル品質をスコアし,劣劣なシグナルをフィルタリングするための訓練されたモデルを構築することで,機械学習技術とインターフェースができ,その結果,全体的なパフォーマンスを次のレベルに引き上げることができます.この統合は,探求に値する重要な最適化方向です.

結論

モメントオシレータートレンドトラッキング戦略は,高度な知的でパラメータ化されたアプローチである.周期的な市場パターンを利用することで信号品質を向上させ,マルチインジケータークロス検証を通じて信頼性のある実行可能なエントリを生成する.一方,豊富な調節可能なノブはユーザーに大きな柔軟性を提供します.結論として,それは超効率的な現代市場で繁栄し,一貫したアルファを提供するための実用的な利点を示す信頼性と推奨される高度な複合戦略です.


/*backtest
start: 2023-01-15 00:00:00
end: 2024-01-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © JS_TechTrading

//@version=5
strategy('The Flash-Strategy (Momentum-RSI, EMA-crossover, ATR)', shorttitle='The Flash-Strategy (Momentum-RSI, EMA-crossover, ATR)', overlay=true,initial_capital = 1000)
//// author -  JS-TechTrading

// MOM Rsi indicator 
group_mom_rsi = "Rsi Of Momentum "
len = input.int(10, minval=1, title="Length Mom-Rsi", group =group_mom_rsi ,tooltip = 'This ind calculate Rsi value of Momentum we use this ind to determine power of trend')
src2 = close
mom = src2 - src2[len]
rsi_mom = ta.rsi(mom, len)
mom_rsi_val = input.int(60, minval=1, title="Mom-Rsi Limit Val", group =group_mom_rsi, tooltip = "When our Mom-Rsi value more then this we open LONG or Short, with help of this indicator we we determine the status of the trend")

// Super Trend Ind
group_supertrend = "SuperTrend indicator"
atrPeriod = input(10, "ATR Length SuperTrend", group = group_supertrend)
factor = input.float(3.0, "Factor SuperTrend", step = 0.01, group = group_supertrend)

[supertrend, direction] = ta.supertrend(factor, atrPeriod)

// Ema Indicator
group_most = "Ema indicator"
src = input(close, 'Source Ema Ind',group = group_most)
AP2 = input.int(defval=12, title='Length Ema Ind', minval=1,group = group_most)
Trail1 = ta.ema(src, AP2) //Ema func
AF2 = input.float(defval=1, title='Percent Ema Ind', minval=0.1,group = group_most) / 100
SL2 = Trail1 * AF2  // Stoploss Ema
Trail2 = 0.0
iff_1 = Trail1 > nz(Trail2[1], 0) ? Trail1 - SL2 : Trail1 + SL2
iff_2 = Trail1 < nz(Trail2[1], 0) and Trail1[1] < nz(Trail2[1], 0) ? math.min(nz(Trail2[1], 0), Trail1 + SL2) : iff_1
Trail2 := Trail1 > nz(Trail2[1], 0) and Trail1[1] > nz(Trail2[1], 0) ? math.max(nz(Trail2[1], 0), Trail1 - SL2) : iff_2

//EMA50/150/200
group_50_150_200="EMA50/150/200"
show_emas=input.bool(defval = true, title = "SHOW EMAS", group = group_50_150_200)
ema50= ta.ema(src, 50)
ema150 = ta.ema(src, 150)
ema200 = ta.ema(src, 200)
ema50_color=input.color(defval = color.purple, title = "EMA50 COLOR",group = group_50_150_200)
ema50_linewidth=input.int(defval = 2, title = "EMA50 LINEWIDTH", group = group_50_150_200)
ema150_color=input.color(defval = color.blue, title = "EMA150 COLOR", group = group_50_150_200)
ema150_linewidth=input.int(defval = 2, title = "EMA150 LINEWIDTH", group = group_50_150_200)
ema200_color=input.color(defval = color.black, title = "EMA200 COLOR", group = group_50_150_200)
ema200_linewidth=input.int(defval = 2, title = "EMA200 LINEWIDTH", group = group_50_150_200)
plot(show_emas ? ema50 : na, color = ema50_color, linewidth = ema50_linewidth)
plot(show_emas ? ema150 : na, color=ema150_color, linewidth = ema150_linewidth)
plot(show_emas ? ema200 : na, color = ema200_color, linewidth = ema200_linewidth)

//Bull = ta.barssince(Trail1 > Trail2 and close > Trail2 and low > Trail2) < ta.barssince(Trail2 > Trail1 and close < Trail2 and high < Trail2)

//TS1 = plot(Trail1, 'ExMov', style=plot.style_line, color=Trail1 > Trail2 ? color.rgb(33, 149, 243, 100) : color.rgb(255, 235, 59, 100), linewidth=2)
//TS2 = plot(Trail2, 'ema', style=plot.style_line, color=Trail1 > Trail2 ? color.rgb(76, 175, 79, 30) : color.rgb(255, 82, 82, 30), linewidth=2)
//fill(TS1, TS2, Bull  ? color.green : color.red, transp=90)


// Strategy Sett
group_strategy = "Settings of Strategy"
Start_Time = input(defval=timestamp('01 January 2000 13:30 +0000'), title='Start Time of BackTest', group =group_strategy)
End_Time = input(defval=timestamp('30 April 2030 19:30 +0000'), title='End Time of BackTest', group =group_strategy)
dollar = input.float(title='Dollar Cost Per Position* ', defval=50000, group =group_strategy)
trade_direction = input.string(title='Trade_direction', group =group_strategy, options=['LONG', 'SHORT', 'BOTH'], defval='BOTH')
v1 = input(true, title="Version 1 - Uses SL/TP Dynamically ", group =group_strategy ,tooltip = 'With this settings our stoploss price increase or decrease with price to get better PNL score')

v2 = input(false, title="Version 2 -  Uses SL/TP Statically", group =group_strategy)
v2stoploss_input = input.float(5, title='Static Stop.Loss % Val', minval=0.01, group =group_strategy)/100
v2takeprofit_input = input.float(10, title='Static Take.Prof % Val', minval=0.01, group =group_strategy)/100

v2stoploss_level_long = strategy.position_avg_price * (1 - v2stoploss_input)
v2takeprofit_level_long = strategy.position_avg_price * (1 + v2takeprofit_input)

v2stoploss_level_short = strategy.position_avg_price * (1 + v2stoploss_input)
v2takeprofit_level_short = strategy.position_avg_price * (1 - v2takeprofit_input)

group_line = "Line Settings"
show_sl_tp = input.bool(title='  Show StopLoss - TakeProf Lines',inline = "1", defval=true, group =group_line)
show_trend_line = input.bool(title='  Show Trend Line',inline = '3' ,defval=true, group =group_line)
stoploss_colour = input.color(title='StopLoss Line Colour',inline = '2' ,defval=color.rgb(255, 255, 0), group =group_line)
up_trend_line_colour = input.color(title='Up Trend line Colour',inline = '4' ,defval=color.rgb(0, 255, 0, 30), group =group_line)
down_trend_line_colour = input.color(title='Down Trend line Colour',inline = '4' ,defval=color.rgb(255, 0, 0, 30), group =group_line)

//plot(supertrend ,color = strategy.position_size > 0 and show_sl_tp ? color.rgb(255, 0, 0) :show_sl_tp ? color.rgb(0, 255, 0) : na , style = plot.style_steplinebr,linewidth = 2)
// plot(supertrend ,color = show_sl_tp and v1 ? stoploss_colour : na , style = plot.style_steplinebr,linewidth = 2)

// plot(v2stoploss_level_long ,color = strategy.position_size > 0 and show_sl_tp and v2 ? stoploss_colour : na , style = plot.style_steplinebr,linewidth = 2)
// plot(v2stoploss_level_short ,color = strategy.position_size < 0 and show_sl_tp and v2 ? stoploss_colour : na , style = plot.style_steplinebr,linewidth = 2)
// plot(v2takeprofit_level_long  ,color = strategy.position_size > 0 and show_sl_tp and v2 ? up_trend_line_colour : na , style = plot.style_steplinebr,linewidth = 2)
// plot(v2takeprofit_level_short ,color = strategy.position_size < 0 and show_sl_tp and v2 ? up_trend_line_colour : na , style = plot.style_steplinebr,linewidth = 2)


TS2 = plot(Trail2, 'Ema Strategy', style=plot.style_line, color=show_trend_line and Trail1 < Trail2 ? down_trend_line_colour : show_trend_line ? up_trend_line_colour  : na, linewidth=2)

// bgcolor(buy_signal ? color.rgb(0, 230, 119, 80) : na)
// bgcolor(sell_signal ? color.rgb(255, 82, 82, 80) : na)

Time_interval = true
buy_signal = Trail1 > Trail2 and direction < 0 and rsi_mom > mom_rsi_val and Time_interval
sell_signal =Trail1 < Trail2 and direction > 0 and rsi_mom > mom_rsi_val and Time_interval


// Strategy entries 
stop_long = (close < supertrend and v1) or (v2 and strategy.position_size > 0)
stop_short = (close > supertrend and v1) or (v2 and strategy.position_size < 0)
long_cond = ((close > ema150 ) and (ema50 > ema150) and (ema150 > ema200))
short_cond = ((close < ema150) and (ema50 < ema150) and (ema150 < ema200))
if (not stop_long) and (not short_cond) and long_cond and strategy.opentrades == 0 and (trade_direction == 'LONG' or trade_direction == 'BOTH') and buy_signal
    strategy.entry('Long_0', strategy.long, qty=dollar / close)

if (not stop_short) and (not long_cond) and short_cond and strategy.opentrades == 0 and (trade_direction == 'SHORT' or trade_direction == 'BOTH') and sell_signal
    strategy.entry('Short_0', strategy.short, qty=dollar / close)


if close < supertrend and v1
    strategy.exit('Long_Close',from_entry = "Long_0", stop=supertrend, qty_percent=100)
if  v2 and strategy.position_size > 0
    strategy.exit('Long_Close',from_entry = "Long_0", stop=v2stoploss_level_long,limit= v2takeprofit_level_long  , qty_percent=100)
    
if close > supertrend and v1
    strategy.exit('Short_Close',from_entry = "Short_0", stop=supertrend, qty_percent=100)
if  v2 and strategy.position_size < 0
    strategy.exit('Short_Close',from_entry = "Short_0", stop=v2stoploss_level_short,limit= v2takeprofit_level_short ,qty_percent=100)

もっと