月間トレンドブレイク戦略

作者: リン・ハーンチャオチャン開催日:2023年10月24日 16:08:33
タグ:

img

概要

月間トレンドブレークアウト戦略は,パインスクリプトベースのトレードビュー指標である.適応型移動平均値,トレンドラインブレークアウトとRSI指標を組み合わせて,月に1回ロングエントリーシグナルを決定する.RSIが過買い状態を示したときにアウトアウトが発生する.

戦略の論理

  1. 変数 lastEntryMonth を定義して,最後の入力月を追跡します. currentMonth は現在の月になります.

  2. TRAMA アダプティブ MA パラメータの長さ=99を設定して価格を平滑させ,トレンドを決定します.

  3. 長さ_トレンド=14を設定し,ピボット・ハイをベースにトレンドライン上部をグラフ化します.価格がトレンドライン上部を突破したときの長さです.

  4. rsiLength=14 の RSI インディケーターを計算し,買い過ぎ/売過ぎを決定します.

  5. 入場論理: 閉じる場合,ロング > TRAMA,前月入場がない場合,上向きトレンドラインの上位を閉じる.

  6. エクジットロジック: RSI > 70 (過買い) の場合,ロングを閉じる.

  7. TRAMA線とRSIが70値を超えた

この戦略は3つの主要な技術指標を組み合わせて,低リスクのロングエントリを月に1回見つけます.エントリはトレンドブレイクに限定され,範囲のウィップサウを避けます.

利点

  1. 多数の指標を組み合わせて 堅牢な市場分析とより高い精度を実現します

  2. 取引を月間限定し,過剰取引を避ける.

  3. アダプティブ・MAは 傾向の変化に迅速に適応します

  4. 過剰販売のRSIは 市場のトップで購入を避け リスクをコントロールします

  5. シンプルな入国/出入国規則は 簡単に実行できます

  6. カスタマイズ可能なパラメータは戦略の最適化を可能にします

リスク

  1. ストップ損失は価格がトレンドラインを下回る場合です

  2. タイミングが悪ければ 登頂の近くまで

  3. 悪い指標パラメータが 誤った信号を 引き起こします

  4. ブレイクアウトは,最近の市場変動を反映する可能性があります.適応停止/ポジションサイズを検討してください.

  5. リスク/リターンを監視する. 引き戻しだけ取引するか,他の確認フィルターを追加することを検討する.

  6. 複数のタイムフレームで指標を検証する.トレンドを特定するためにより高いタイムフレームを使用し,エントリーのために低値を使用します.

  7. 異なる市場条件に対するバックテスト 戦略と市場タイプを合わせるパラメータを最適化します

最適化

  1. 低音量で誤ったブレイクを避けるために音量指示器を追加します.

  2. 部分的なポジションを維持して,RSIの過剰買い出口で部分的な利益を取ると考える.

  3. MAパラメータを最適化し,傾向の変化により適した状態にする.

  4. ブレイクポイント前の/後のゾーンを追加して,逆転時に右買いを避ける.

  5. より高い精度のために 波動性があります

  6. 新しいレジスタンスのレベルで追加的なブレイクでスケールします.

結論

月間トレンドブレイクストラテジーは,トレンド,モメンタム,極端を分析する.月間タイムフレームでトレンドを決定するが,より短いタイムフレームのブレイクに入る.RSIはリスク管理を監督する.シンプルな論理は最適化された月間長いエントリを識別する.トレンドフォローとリスク制御をバランスする.パラメータ最適化は異なる市場状況に適応する.全体として,これは使いやすさと効果的なリスク管理を組み合わせたシンプルで堅牢な戦略である.


/*backtest
start: 2022-10-17 00:00:00
end: 2023-10-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('Bannos Strategy', shorttitle='Bannos', overlay=true)

//The provided script is an indicator for TradingView written in Pine Script version 5. The indicator is used to determine entry and exit points for a trading strategy. Here's a detailed breakdown of what the script does:

// Strategy Definition:

// Bannos Strategy is the full name, with a short title Bannos.
// The overlay=true option indicates that the strategy will be overlayed on the price chart.
// Tracking Entry Month:

// A variable lastEntryMonth is set up to track the month of the last entry.
// currentMonth identifies the current month.
// Trend Regularity Adaptive Moving Average (TRAMA):

// It takes an input of length 99 as default.
// It uses adaptive calculations to track trend changes.
// Trendlines with Breaks:

// Identifies local peaks over a given period (in this case, 14) and calculates a slope based on these peaks.
// Relative Strength Index (RSI):

// Uses a length of 14 (default) to calculate the RSI.
// RSI is an oscillation indicator that indicates overbought or oversold conditions.
// Strategy Logic for Long Entry:

// A long position is opened if:
// The close price is above the TRAMA.
// There's a crossover of the close price and the upper trendline.
// The position is taken only once per month.
// Strategy Logic for Long Exit:

// The long position is closed if the RSI exceeds 70, indicating an overbought condition.
// Plotting:

// The TRAMA is plotted in red on the chart.
// A horizontal line is also drawn at 70 to indicate the RSI's overbought zone.
// In summary, this strategy aims to enter a long position when certain trend and crossover conditions are met, and close the position when the market is considered overbought as per the RSI. Additionally, it ensures entries only occur once a month.
//



// Variable pour suivre le mois de la dernière entrée
var float lastEntryMonth = na
currentMonth = month(time)

// Parameters for Trend Regularity Adaptive Moving Average (TRAMA)
length_trama = input(99)
src_trama = close
ama = 0.
hh = math.max(math.sign(ta.change(ta.highest(length_trama))), 0)
ll = math.max(math.sign(ta.change(ta.lowest(length_trama)) * -1), 0)
tc = math.pow(ta.sma(hh or ll ? 1 : 0, length_trama), 2)
ama := nz(ama[1] + tc * (src_trama - ama[1]), src_trama)

// Parameters for Trendlines with Breaks
length_trend = 14
mult = 1.0
ph = ta.pivothigh(length_trend, length_trend)
upper = 0.
slope_ph = 0.
slope_ph := ph ? mult : slope_ph
upper := ph ? ph : upper - slope_ph

// Parameters for RSI
rsiLength = 14
up = ta.rma(math.max(ta.change(close), 0), rsiLength)
down = ta.rma(-math.min(ta.change(close), 0), rsiLength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

// Strategy Logic for Long Entry
longCondition = close > ama and ta.crossover(close, upper) and (na(lastEntryMonth) or lastEntryMonth != currentMonth)
if (longCondition)
    lastEntryMonth := currentMonth
    strategy.entry('Long', strategy.long)

// Strategy Logic for Long Exit
exitCondition = rsi > 70
if (exitCondition)
    strategy.close('Long')

// Plotting
plot(ama, 'TRAMA', color=color.red)
hline(70, 'Overbought', color=color.red)


もっと