複数の移動平均線RSI戦略


作成日: 2023-09-14 16:28:04 最終変更日: 2023-09-14 16:28:04
コピー: 0 クリック数: 655
1
フォロー
1617
フォロワー

戦略原則

この戦略は,複数の移動平均とRSIの指数を使用し,配合取引を行います. 速いEMAを下にゆっくりとしたEMAを突破し,RSIが超売りを示したときに空白; 価格が平均線を再び突破したときに平仓.

具体的には,

  1. 9日,26日,100日,55日の平均など,4つの周期の指数移動平均を計算する

  2. 9日のEMAが26日のEMAを突破すると空白信号を考慮してください.

  3. 同時に,RSI指標が値以下であるとき (例えば40) ショートダウンシグナルを起動して,超売り反発を避ける

  4. 入場後空白後,価格が55日または100日EMAを超えると空白

  5. 異なる均線周期組合せを設定し,最適化パラメータ

この戦略は,多平均線判断のトレンドを充分活用し,RSI指標を補助して偽信号をフィルターし,超売りポイントで空白する.

戦略的優位性

  • 多平均線配列判断の正確性向上

  • RSIは反発の危険を回避する

  • 短い平均線は戦略,長い平均線はストップ損失,撤回制御

戦略リスク

  • 適切なパラメータを決定するために繰り返しテストする必要があります.

  • RSIパラメータの設定は慎重に評価する必要があります

  • “空白策”で多くのチャンスを逃す

要約する

この戦略は,多均線の優位性を総合的に利用し,RSI指標のフィルター信号を補強する.パラメータ最適化と止損設定は,戦略の効果に不可欠である.しかし,空白取引だけでは大きな制限でもある.

ストラテジーソースコード
/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 3h
basePeriod: 15m
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/
// © YukalMoon

//@version=5
strategy(title="EMA SCALPEUR", overlay=true, initial_capital = 1000)


//// input controls

EMA_L = input.int (title = "EMA_L", defval = 9, minval = 1, maxval = 100, step =1)
EMA_L2 = input.int (title = "EMA_L2", defval = 26, minval = 1, maxval = 100, step =1)
EMA_S = input.int (title = "EMA_S", defval = 100, minval = 1, maxval = 100, step =1)
EMA_S2 = input.int (title = "EMA_S2", defval = 55, minval = 1, maxval = 100, step =1)
RSI1 = input.int (title = "RSI", defval = 5, minval = 1, maxval = 20 , step = 1)

/// mise en place de ema

RSI = ta.rsi(close, RSI1)

shortest = ta.ema(close, 9)
short = ta.ema(close, 26)
longer = ta.ema(close, 100)
longest = ta.ema(close, 55)

plot(shortest, color = color.red)
plot(short, color = color.orange)
plot(longer, color = color.aqua)
plot(longest, color = color.yellow)

plot(close)

//// trading indicators

EMA1 = ta.ema (close,EMA_L)
EMA2 = ta.ema (close,EMA_L2)
EMA3 = ta.ema (close, EMA_S)
EMA4 = ta.ema (close, EMA_S2)


//buy = ta.crossover(EMA1, EMA2) and RSI > 60 and RSI <70
sell = ta.crossunder(EMA1, EMA2) and RSI > 40

//buyexit = ta.crossunder(EMA3, EMA4)
sellexit = ta.crossover(EMA3, EMA4)

/////strategy


strategy.entry ("short", strategy.short, when = sell, comment = "ENTER-SHORT")


///// market exit


strategy.close ("short",  when = sellexit, comment = "EXIT-SHORT")