zdmre의 RSI

저자:차오장, 날짜: 2022-05-13 16:34:43
태그:RMA

전통적 해석 및 RSI 사용은 70 이상의 값이 증권이 과잉 매입되거나 과대 평가되는 것을 암시하며 트렌드 역전 또는 교정 가격 인하에 대비 될 수 있다고 주장합니다. RSI 30 또는 그 이하의 판독은 과대 판매 또는 과대 평가 된 상태를 나타냅니다.

30 = 과잉 판매 70 = 과잉 구매

제안에 감사합니다 @DieGobelMonte

백테스트

img


/*backtest
start: 2022-04-12 00:00:00
end: 2022-05-11 23:59:00
period: 5m
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/
// © zdmre

//@version=5
indicator("RSI by zdmre", overlay=false)

len = input.int(14, minval=1, title='Length')
src = input(close, 'Source')
up = ta.rma(math.max(ta.change(src), 0), len)
down = ta.rma(-math.min(ta.change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
plot(rsi, 'RSI', color=color.new(#7E57C2, 0))
band1 = hline(70, "Upper Band", color=#787B86)
bandm = hline(50, "Middle Band", color=color.new(#787B86, 50))
band0 = hline(30, "Lower Band", color=#787B86)
fill(band1, band0, color=color.rgb(126, 87, 194, 90), title="Background")

ob= ta.cross(rsi, 70) == 1 and rsi >= 70
os = ta.cross(rsi, 30) == 1 and rsi <= 30

plot(ob ? rsi : na ,title='Overbought', style=plot.style_circles, color=color.new(color.red, 0), linewidth=5)
plot(os ? rsi : na ,title='Oversold ', style=plot.style_circles, color=color.new(color.green, 0), linewidth=5)

if ob
    strategy.entry("Enter Long", strategy.long)
else if os
    strategy.entry("Enter Short", strategy.short)

관련

더 많은