サポートとレジスタンスのトレンドフォロー戦略


作成日: 2024-02-27 15:11:04 最終変更日: 2024-02-27 15:11:04
コピー: 1 クリック数: 609
1
フォロー
1617
フォロワー

サポートとレジスタンスのトレンドフォロー戦略

概要

この戦略は,サポート,レジスタンス,トレンドラインの3つの技術指標を活用して,自動的に入場と止まりをします.戦略は,まず,重要なサポートとレジスタンス点を識別し,次にトレンドの方向と組み合わせて入場のタイミングを判断します.

戦略原則

  1. 重要なサポートとレジスタンス点を識別する.
  2. トレンドラインを使って市場のトレンド方向を判断する.昨日の閉盤価格より価格が高くなった場合,上昇傾向として定義され,そうでなければ下降傾向として定義される.
  3. 価格がサポートレベルに近づき,上昇傾向にあるときに,買入シグナルを発する.
  4. 価格がレジスタンスレベルに近づいて下落傾向にあるとき,セールシグナルを発信する.
  5. ストップ目標 リスク・リターン比率に基づいて計算され,ストップ・ロスはサポート位の近くに設定されます.
  6. ローキングストップを選択して利益をロックします.

優位分析

  1. サポート,レジスタンス,トレンドの3つの強力な指標の利点を最大限に活用してください.
  2. 自動で判断して,主観的な間違いを避ける.
  3. リスクはコントロール可能で,ストップ・ロスはキー・サポートの近くで制御されます.
  4. ストップ・ロスを選択して利益を固定し,利益の転移を回避します.

リスク分析

  1. 破綻のリスク. 価格がサポートまたはレジスタンス値を破ると,再び戻り,化を引き起こす可能性があります.
  2. トレンド判断の失敗リスク。 トレンドラインを使ってトレンド判断の方向は誤りがあるかもしれない。
  3. ストップダメージが破られるリスク。 ストップダメージは支柱から遠くないが,激しい波動では直接突破される可能性がある。

どう対処するか?

  1. 適正に緩解したサポート抵抗の判定幅.
  2. 複数の指標を用いてトレンドを検証する.
  3. 障害の範囲を停止するか,時間通りに人工介入するか.

最適化の方向

  1. さらに多くの指標の認証入場信号を追加し,正確性を向上させる.例えば,量値指標,移動平均など.
  2. サポートレジスタンス位とストップダメージ位の設定を最適化します. 異なるパラメータが結果に与える影響をテストできます.
  3. マシン・ラーニングでパラメータを自動的に最適化してみましょう.

要約する

この戦略は,複数の技術指標の優位性を統合し,合理的なパラメータ設定の前提で,よりよいリターンリスク比を得ることができる.パラメータ設定と入場順序の最適化が鍵である.全体的に,この戦略の枠組みは合理的で,大きな改善の余地がある.

ストラテジーソースコード
/*backtest
start: 2024-01-27 00:00:00
end: 2024-02-26 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Support Resistance Trend Strategy", overlay=true)

// Input parameters
supportLevel = input(100, title="Support Level")
resistanceLevel = input(200, title="Resistance Level")
riskRewardRatio = input(2, title="Risk-Reward Ratio")
trailStopLoss = input(true, title="Use Trailing Stop Loss")

// Calculate trend direction based on trend lines
trendUp = close > request.security(syminfo.tickerid, "D", close[1])
trendDown = close < request.security(syminfo.tickerid, "D", close[1])

// Buy signal condition
buySignal = close < supportLevel and trendUp

// Sell signal condition
sellSignal = close > resistanceLevel and trendDown

// Entry point and exit conditions
strategy.entry("Buy", strategy.long, when=buySignal)
strategy.entry("Sell", strategy.short, when=sellSignal)

// Calculate targets and stop-loss levels
targetPrice = close + (close - supportLevel) * riskRewardRatio
stopLossLevel = supportLevel

// Plot support and resistance levels
plot(supportLevel, color=color.green, linewidth=2, title="Support Level")
plot(resistanceLevel, color=color.red, linewidth=2, title="Resistance Level")

// Plot targets and stop-loss levels
plot(targetPrice, color=color.blue, linewidth=2, title="Target Price")
plot(stopLossLevel, color=color.orange, linewidth=2, title="Stop Loss Level")

// Trailing stop-loss
strategy.exit("Take Profit/Stop Loss", from_entry="Buy", loss=stopLossLevel, profit=targetPrice)
strategy.exit("Take Profit/Stop Loss", from_entry="Sell", loss=targetPrice, profit=stopLossLevel)

// Plot trail stop loss
if (trailStopLoss)
    strategy.exit("Trailing Stop Loss", from_entry="Buy", loss=stopLossLevel)
    strategy.exit("Trailing Stop Loss", from_entry="Sell", loss=stopLossLevel)