
이 전략은 무작위 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)