複数移動平均モメンタムトレンドフォロー戦略

SMA RSI MA
作成日: 2024-11-12 15:05:09 最終変更日: 2024-11-12 15:05:09
コピー: 0 クリック数: 476
1
フォロー
1617
フォロワー

複数移動平均モメンタムトレンドフォロー戦略

概要

この戦略は,複数の平均線と動向指標に基づいたトレンド追跡取引システムである.この戦略は,20日,50日,150日,200日SMAのダイナミックな関係を主に利用し,交差量とRSIの指標を組み合わせて,日線レベルで強い上昇傾向を捕捉し,トレンドが弱くなったときにタイミングで平衡を保つ.この戦略は,複数の技術指標の組み合わせを使用して,偽信号を効果的にフィルターし,取引の正確性を向上させる.

戦略原則

戦略の核心的な論理には以下の重要な部分が含まれています.

  1. 均線システム: 20/50/150/200日均線を用いてトレンド判断システムを構築し,多均線が多頭並列であることを要求する.
  2. 動力の確認:RSI指数とその移動平均を用いて価格の動きを判断し,RSIが55以上またはRSISMAが50以上でRSIが上昇することを要求する.
  3. 取引量検証:取引量の20日平均線と最近の取引量との比較によって,買い売りシグナルの有効性を確認する.
  4. トレンドの継続性確認:過去40日間の取引のうち少なくとも25日間で50日平均線が上昇傾向にあることを確認する.
  5. ポジション確認:価格が150日平均線上には少なくとも20取引日以上安定する必要がある.

購入条件は以下の通りです.

  • 最近10日のうち4日以上は日光が照らされ,1日以上は放量された
  • RSIは動量条件を満たしている
  • 均線系は多頭並びで上昇しています.
  • 価格が150日平均線以上で安定している

販売条件は以下の通りです.

  • 価格が150日平均を下回った
  • 連続した放出量減少
  • 50日平均線は150日平均線から下がった.
  • 最近は陰線が多く,交差量が増加している.

戦略的優位性

  1. 複数の技術指標のクロス検証により,誤判率を低減
  2. トレンド持続性の要求は厳格で,短期的な変動をフィルタリングできます.
  3. 交差量分析を組み合わせ,信号の信頼性を向上させる
  4. 明確なストップ・ストップ条件とリスクの管理
  5. 中長期のトレンドを捉え,取引頻度を減らすのに適しています.
  6. 戦略ロジックは明確で、理解しやすく、実行しやすい

戦略リスク

  1. 平均線は後退し,トレンドの初期段階を逃す可能性があります.
  2. 厳格な入場条件により,一部の取引機会を逃す可能性があります.
  3. 不安定な市場では誤ったシグナルが頻繁に発生する可能性がある
  4. 市場逆転の認識には遅延がある
  5. 撤収には大きな資金が必要

リスク管理の提案:

  • 合理的なストップポジションを設定する
  • 資金管理は控えめで
  • トレンド確認の指標を増やすことを検討する
  • 市場環境によるパラメータの調整

戦略最適化の方向性

  1. 適応パラメータを追加する
  • 市場変動率の動向に合わせて平均線周期を調整する
  • RSI 値設定を最適化する
  1. 損失を抑える仕組みの改善
  • 追跡停止を追加する
  • 設定時間停止
  1. 市場環境分析を導入する
  • トレンド強度指数増加
  • 波動率の指標を考慮する
  1. 取引規模を最適化する
  • 動的ポジション管理を設計する
  • 信号の強度に応じて調整する

要約する

これは,複数の技術指標の配合による設計された厳格なトレンド追跡戦略であり,強力なトレンドの機会を効果的に捉えることができます. 戦略の主要な優点は,完全な信号確認機構と厳格なリスク管理システムにあります.

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

//@version=5
strategy("Micho's 150 (1D Time Frame Only)", overlay=true)

// Define the length for the SMAs and RSI
sma20Length = 20
sma50Length = 50
sma150Length = 150
sma200Length = 200
volumeMaLength = 20
rsiLength = 14
rsiSmaLength = 14
smaCheckLength = 40  // Check the last month of trading days (~20 days)
requiredRisingDays = 25  // Require SMA to rise in at least 16 of the past 20 days
sma150AboveSma200CheckDays = 1  // Require SMA150 > SMA200 for the last 10 days

// Calculate the SMAs for price
sma20 = ta.sma(close, sma20Length)
sma50 = ta.sma(close, sma50Length)
sma150 = ta.sma(close, sma150Length)
sma200 = ta.sma(close, sma200Length)

// Calculate the 20-period moving average of volume
volumeMA20 = ta.sma(volume, volumeMaLength)

// Calculate the 14-period RSI
rsi = ta.rsi(close, rsiLength)

// Calculate the 14-period SMA of RSI
rsiSMA = ta.sma(rsi, rsiSmaLength)

// Check if most of the last 5 days are buyer days (close > open)
buyerDays = 0
for i = 0 to 9
    if close[i] > open[i]
        buyerDays := buyerDays + 1

// Check if at least 1 day has volume higher than the 20-period volume MA
highVolumeDays = 0
for i = 0 to 9
    if close[i] > open[i] and volume[i] > volumeMA20
        highVolumeDays := highVolumeDays + 1

// Define the new RSI condition
rsiCondition = (rsi >= 55) or (rsiSMA > 50 and rsi > rsi[1])

// Check if the 50-day SMA has been rising on at least 16 of the last 20 trading days
risingDays = 0
for i = 1 to smaCheckLength
    if sma50[i] > sma50[i + 1]
        risingDays := risingDays + 1

// Check if the SMA has risen on at least 16 of the last 20 days
sma50Rising = risingDays >= requiredRisingDays

// Check if the price has been above the SMA150 for the last 20 trading days
priceAboveSma150 = true
for i = 1 to smaCheckLength
    if close[i] < sma150[i]
        priceAboveSma150 := false

// Check if the SMA150 has been above the SMA200 for the last 10 days
sma150AboveSma200 = true
for i = 1 to sma150AboveSma200CheckDays
    if sma150[i] < sma200[i]
        sma150AboveSma200 := false

// Define the conditions for the 150-day and 200-day SMAs being rising
sma150Rising = sma150 > sma150[1]
sma200Rising = sma200 > sma200[1]

// Check if most of the last 5 days are seller days (close < open)
sellerDays = 0
for i = 0 to 9
    if close[i] < open[i]
        sellerDays := sellerDays + 1

// Check if at least 1 day has seller volume higher than the 20-period volume MA
highSellerVolumeDays = 0
for i = 0 to 9
    if close[i] < open[i] and volume[i] > volumeMA20
        highSellerVolumeDays := highSellerVolumeDays + 1

// Check in the last N days the price below 150
priceBelowSma150 = true
for i = 0 to 0
    if close[i] > sma150[i]
        priceBelowSma150 := false

// Restrict the strategy to 1D time frame
if timeframe.isdaily
    // Buy condition:
    // - Most of the last 5 days are buyer days (buyerDays > 2)
    // - At least 1 of those days has high buyer volume (highVolumeDays >= 1)
    // - RSI SMA (14-period) between 45 and 50 with RSI >= 55, or RSI SMA > 50 and RSI rising
    // - 50-day SMA > 150-day SMA and 150-day SMA > 200-day SMA
    // - 50-day SMA has been rising on at least 16 of the last 20 trading days
    // - The price hasn't been below the 150-day SMA in the last 20 days
    // - 150-day SMA has been above the 200-day SMA for the last 10 days
    // - 150-day and 200-day SMAs are rising
    buyCondition = (close > sma150 and buyerDays > 4 and highVolumeDays >= 1 and rsiCondition  and sma50 > sma150 and sma50Rising and sma150Rising and sma200Rising and priceAboveSma150)

    // Sell condition:
    // - Price crossing below SMA 150
    // - Seller volume (current volume > volume MA 20)
    // - 150-day SMA crosses below 200-day SMA
    // - Most of the last 5 days are seller days (sellerDays > 2) and at least 1 day of higher seller volume (highSellerVolumeDays >= 1)
    sellCondition = (priceBelowSma150 and (sma50 < sma150 or (sellerDays >5 and highSellerVolumeDays >= 5)))

    // Execute buy when all conditions are met
    if (buyCondition)
        strategy.entry("Buy", strategy.long)

    // Execute sell when all conditions are met
    if (sellCondition)
        strategy.close("Buy")