モメント・プルバック・戦略

作者: リン・ハーンチャオチャン,日付: 2024-01-23 15:23:14
タグ:

img

概要

この戦略は,市場における潜在的な引き下げ機会を特定することを目的としています.長期移動平均 (MA1) と短期移動平均 (MA2) との2つの移動平均システムを採用しています.鍵となる目標は,閉値がMA1を下回るがMA2を超えると,全体的なトレンド内の潜在的な引き下げをシグナル化する.

戦略の論理

この戦略は,MA1 (長期) とMA2 (短期) の2つの移動平均を使用する.論理は,長期トレンドのサポートをテストするために価格が短期間引き下がる場合,それは長い機会を提示することがあります.特に,閉じる価格が長期サポート (MA1) の上にとどまる場合,主要トレンドは不動のままです.しかし,閉じる価格が短期MA (MA2) の下を突破しても,長期MA (MA1) の上を保持した場合,それは教科書引き戻しセットアップをシグナルします.ここでストップロスをして,価格がショートMAの上に戻ることを目指すことができます.

利点分析

この戦略の利点は以下の通りです.

  1. フレキシブルなパラメータ調節により,実行し理解しやすい
  2. 2つのMAを活用して主要なトレンドを特定し,反トレンド取引を回避する
  3. 異常な周期を避けるために調整可能な時間フィルター
  4. 異なるリスク優先順位に対応する調整可能なポジションサイズ
  5. ダウンリスクを制限するストップ・ロスのメカニズム

リスク分析

認識すべきリスク

  1. 価格が引き続き下落し,ストップロスは達成された場合,引き戻しは失敗します.
  2. 主要なサポートエリアが破られた場合,主要なトレンド逆転
  3. 変動する価格動向のウィップソーとディバージェンス
  4. 欠けている取引は,不適正な時間フィルターから

リスクを最適化・軽減するための方法:

  1. MA パラメータを最適化して信号品質を向上させる
  2. リスクを最小限に抑えながら利益を最大化するためにストップ・ロスのレベルを調整する
  3. 最良の取引期間に焦点を当てて時間フィルターを調整する
  4. 異なる楽器と市場環境におけるテスト

増進 の 機会

戦略の強化の方法:

  1. 最適な組み合わせを見つけるために MA パラメータを最適化
  2. トレーリングやチェンデリアストップのような異なるストップ・ロスのメカニズムをテストします
  3. ボリュームや不安定性などの追加のフィルターを追加します
  4. 金色の十字架の追加や死の十字架の削減など
  5. 自動的な利益を得るメカニズムを組み込む
  6. キーメトリックを分析しパラメータを最終化するためのバックテスト

結論

概要すると,これはシンプルな平均逆戻りプルバック戦略である.ダブルMAアプローチでプルバックセットアップを特定し,適応停止でリスクを管理する.戦略は柔軟なチューニングで理解し実行するのが簡単である.次のステップは,MAパラメータ,ストップ損失,フィルターなどの要素の周りのさらなる最適化である.


/*backtest
start: 2023-01-16 00:00:00
end: 2024-01-22 00:00:00
period: 1d
basePeriod: 1h
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/
// © ZenAndTheArtOfTrading / www.PineScriptMastery.com
// @version=5
strategy("Simple Pullback Strategy", 
     overlay=true, 
     initial_capital=50000,
     default_qty_type=strategy.percent_of_equity, 
     default_qty_value=100, // 100% of balance invested on each trade
     commission_type=strategy.commission.cash_per_contract, 
     commission_value=0.005) // Interactive Brokers rate

// Get user input
i_ma1           = input.int(title="MA 1 Length", defval=200, step=10, group="Strategy Parameters", tooltip="Long-term MA")
i_ma2           = input.int(title="MA 2 Length", defval=10, step=10, group="Strategy Parameters", tooltip="Short-term MA")
i_stopPercent   = input.float(title="Stop Loss Percent", defval=0.10, step=0.1, group="Strategy Parameters", tooltip="Failsafe Stop Loss Percent Decline")
i_lowerClose    = input.bool(title="Exit On Lower Close", defval=false, group="Strategy Parameters", tooltip="Wait for a lower-close before exiting above MA2")
i_startTime     = input(title="Start Filter", defval=timestamp("01 Jan 1995 13:30 +0000"), group="Time Filter", tooltip="Start date & time to begin searching for setups")
i_endTime       = input(title="End Filter", defval=timestamp("1 Jan 2099 19:30 +0000"), group="Time Filter", tooltip="End date & time to stop searching for setups")

// Get indicator values
ma1 = ta.sma(close, i_ma1)
ma2 = ta.sma(close, i_ma2)

// Check filter(s)
f_dateFilter =true

// Check buy/sell conditions
var float buyPrice = 0
buyCondition    = close > ma1 and close < ma2 and strategy.position_size == 0 and f_dateFilter
sellCondition   = close > ma2 and strategy.position_size > 0 and (not i_lowerClose or close < low[1])
stopDistance    = strategy.position_size > 0 ? ((buyPrice - close) / close) : na
stopPrice       = strategy.position_size > 0 ? buyPrice - (buyPrice * i_stopPercent) : na
stopCondition   = strategy.position_size > 0 and stopDistance > i_stopPercent

// Enter positions
if buyCondition
    strategy.entry(id="Long", direction=strategy.long)

if buyCondition[1]
    buyPrice := open

// Exit positions
if sellCondition or stopCondition
    strategy.close(id="Long", comment="Exit" + (stopCondition ? "SL=true" : ""))
    buyPrice := na

// Draw pretty colors
plot(buyPrice, color=color.lime, style=plot.style_linebr)
plot(stopPrice, color=color.red, style=plot.style_linebr, offset=-1)
plot(ma1, color=color.blue)
plot(ma2, color=color.orange)

もっと