ダブル移動平均価格ジャンプ戦略


作成日: 2023-11-21 14:28:35 最終変更日: 2023-11-21 14:28:35
コピー: 0 クリック数: 586
1
フォロー
1617
フォロワー

ダブル移動平均価格ジャンプ戦略

概要

この戦略は,RSI指数で超買いと超売りを判断し,快線,中線,慢線を組み合わせたトレンド判断システムで,価格が飛躍する時にポジションを空調にする機会を判断する.

戦略原則

  1. RSIで 超買いと超売りを判断する
  • RSIパラメータは14周期に設定されています.
  • 超売れ線は30で 超買い線は70です
  1. 3つの異なる周期のSMA平均線を用いたトレンド判断
  • 9サイクルSMAの快線は短期トレンドを表しています.
  • 中央線は50サイクルSMAで,中期トレンドを表しています.
  • 慢線は200サイクルSMAで,長期トレンドを表しています.
  1. RSIがオーバーセールしているときに,オフラインで中線を横切る.

  2. 線が中線を突破し,RSIがオーバーバイを示しているときに空白に入ります.

  3. 入場価格の4%に設定されたストップ・ロズ

  4. 利益を得る方法は,先ず20%を止めて,次に価格が上昇すると15%を止めて,順番にポジションを外すというものです.

優位分析

  1. 3つの異なる周期のSMA平均線を使用して,異なる時間帯のトレンドの変化を判断できます.
  2. RSIの利用は,超買超売の無い地域での取引を避けるために
  3. 配当の停止により,戦略的ポジション周期が増加し,平均ポジション収益も増加しました.

リスク分析

  1. 三つの均線が誤信号を発する確率
  2. の分批が完了しないリスクがある
  3. 価格変動が大きい株に適した株の種類を選択する

戦略最適化の方向性

  1. 平均線とRSIのパラメータをテストして変更し,入場と出場のチャンスを最適化できます.
  2. 戦略の正確性を高めるために,他の指標,例えば,フィルターキャンドルの形状を追加できます.
  3. ダイナミック・トラッキング・ストップ・ローズにより,リスクをさらにコントロールできます.

要約する

この戦略は,均線指標と超買い超売り指標RSIを組み合わせて,価格変化のトレンドを捉えながら同時に,買い売りの機会を判断する.これは,より一般的なトレンド追跡戦略の1つです.パラメータテストと他の補助判断指標を追加することで,戦略の勝利率をさらに最適化し,向上させることができます.

ストラテジーソースコード
/*backtest
start: 2023-11-13 00:00:00
end: 2023-11-20 00:00:00
period: 1m
basePeriod: 1m
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/
// © syfuslokust

//@version=4
strategy(shorttitle='CoinruleCombinedCryptoStrat',title='CoinruleCombinedCryptoStrat', overlay=true)


// RSI inputs and calculations
lengthRSI = 14
RSI = rsi(close, lengthRSI)
//Normal
oversold = input(30)
overbought =  input(70)
//ALGO
//oversold= input(26)
//overbought= input(80)

//sell pct
SellPct = input(20)
ExitPct = input(15)

//MA inputs and calculations
movingaverage_signal = sma(close, input(9))
movingaverage_fast = sma(close, input(50))
movingaverage_slow = sma(close, input(200))
movingaverage_mid= sma(close, input(100))

//Look Back
inp_lkb = input(12, title='Lookback Long Period')
inp_lkb_2 = input(2, title='Lookback Short Period')
 
perc_change(lkb) =>
    overall_change = ((close[0] - close[lkb]) / close[lkb]) * 100

//Entry 

//MA
bullish = crossover(movingaverage_signal, movingaverage_fast)
//Execute buy
strategy.entry(id="long", long = true, when = (RSI < oversold and movingaverage_fast < movingaverage_mid))

//when = crossover(close, movingaverage_signal) and movingaverage_signal < movingaverage_slow and RSI < oversold)

//Exit

//RSI
Stop_loss= ((input (4))/100)
longStopPrice  = strategy.position_avg_price * (1 - Stop_loss)
//MA
bearish = crossunder(movingaverage_signal, movingaverage_fast)
//Execute sell
strategy.close("long", qty_percent = SellPct, when = RSI > overbought and movingaverage_fast > movingaverage_mid)
//when = (crossunder(low, movingaverage_signal) and movingaverage_fast > movingaverage_slow and RSI > overbought) or (movingaverage_signal < movingaverage_fast and crossunder(low, movingaverage_fast)) or (low < longStopPrice))


//PLOT
plot(movingaverage_signal, color=color.black, linewidth=2, title="signal")
plot(movingaverage_fast, color=color.orange, linewidth=2, title="fast")
plot(movingaverage_slow, color=color.purple, linewidth=2, title="slow")
plot(movingaverage_mid, color=color.blue, linewidth=2, title="mid")