
この戦略は,ランダムなRSIとEMAを組み合わせて,トレンドを検出し,取引信号を検証する.価格がEMA20の上部でEMA9とEMA14の間の回調をすると,ランダムなRSIが超売りレベルを下回ると,複数のシグナルが発生し,価格がEMA20下部でEMA9とEMA14の間の回調をすると,ランダムなRSIが超買いレベルを超えると,空きシグナルが発生する.
この戦略の核心思想は,主動トレンド (EMA20によって表される) の中の反転が適切な超買超売領域に達したかどうかを判断するために,ランダムなRSIを使用することであり,同時に,急速EMAと中速EMAを使用して反転の強さを検証することであり,価格が急速EMAと中速EMAを突破した場合,反転は終了し,トレンドは逆転し,この時点で入場は不適し,価格がEMA9とEMA14の間に反転したときにのみ順調入場を考慮することである.この多重条件検証方法は,信号の質を効果的に高め,誤判を減らすことができる.
この戦略は,ランダムなRSIとEMAの組み合わせで多条件検証を採用し,トレンドの逆転を把握しながら,リスクを効果的に制御し,全体的な考え方は簡単で分かりやすく,初心者の学習使用に適しています. しかし,戦略自体にもいくつかの限界があります. 震動市場に対する不良なパフォーマンス,トレンドの状況把握不足など,現実の状況に応じてパラメータを柔軟に調整する必要があります.
/*backtest
start: 2023-03-02 00:00:00
end: 2024-03-07 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Crypto-EMA_Pullback=-", overlay=true,initial_capital = 10000000,default_qty_type=strategy.percent_of_equity, default_qty_value=10.0, pyramiding = 10)
// Inputs
lengthRsi = input(14, title="RSI Length")
k = input(3, title="Stoch %K")
d = input(3, title="Stoch %D")
lengthStoch = input(14, title="Stochastic RSI Length")
overSold = input(25, title="Oversold Level")
overBought = input(85, title="Overbought Level")
emaFastLength = input(9, title="Fast EMA Length")
emaMediumLength = input(14, title="Medium EMA Length")
emaSlowLength = input(20, title="Slow EMA Length")
// Calculating EMAs
emaFast = ta.ema(close, emaFastLength)
emaMedium = ta.ema(close, emaMediumLength)
emaSlow = ta.ema(close, emaSlowLength)
// Calculating the RSI and Stoch RSI
rsi = ta.rsi(close, lengthRsi)
stochRsiK = ta.sma(ta.stoch(rsi, rsi, rsi, lengthStoch), k)
stochRsiD = ta.sma(stochRsiK, d)
// Entry Conditions
bullishCondition = close > emaSlow and close < emaFast and close < emaMedium and stochRsiK < overSold
bearishCondition = close < emaSlow and close > emaFast and close > emaMedium and stochRsiK > overBought
// Strategy Execution
if (bullishCondition)
strategy.entry("Long", strategy.long)
if (bearishCondition)
strategy.entry("Short", strategy.short)
// Plotting
plot(emaFast, color=color.blue, title="Fast EMA")
plot(emaMedium, color=color.orange, title="Medium EMA")
plot(emaSlow, color=color.red, title="Slow EMA")
hline(overSold, "Oversold", color=color.green)
hline(overBought, "Overbought", color=color.red)