LazyBear

Indicators: 6 RSI variations

As we all know, as published by Wilder, RSI makes use of "CLOSE" values. You probably have experimented changing the input to hl2 or hlc3 . I have included many other RSI variations in this chart. Refer to the developers section below to learn how you can use this code in your scripts.

1) RSI with Volume
---------------------------------------------
Suggested by Morris, this idea adds volume to the RSI indicator. Because volume offers one means of determining whether money is entering or leaving a market, this would provide additional information with which to make trading decisions.


2) RSI using last Open
---------------------------------------------
This is RSI with yesterday's open, This basically compares two full days of price action and in the process produces a smoother RSI line.

RSI of today's close is used as a signal (blue line).


3) RSI using SMA
---------------------------------------------
Wilder used his own MA for calculating RSI (check my post on Wilders MA here - -- This closely resembles EMA). One of Morris's suggestion is to try out SMA.

Compared to normal RSI, you will see more squiggles here.


4) RSI using EMA
---------------------------------------------
Same idea as above, but using EMA.


5) RSI with Fibs
---------------------------------------------
How much does RSI retrace? This makes it easy to determine that :)


6) RSI of MACD
---------------------------------------------
As I mentioned earlier, RSI is a pluggable formula. You can substitute "close" with any data series to derive an index out of it.

This shows RSI of MACD. Note that this is range bound.


More info on RSI variations:
drive.google.co...HJFWHJ2aW8/edit?usp=sharin...

For Pinescript developers:
---------------------------------------------
You can substitute your favorite indicator in the RSI function. I have made the RSI calculation a separate function in all the indicators above.

Following are the reusable functions (simply copy to your script and call with proper arguments):
* WiMA(src, length)
* calc_rsi(fv, length): This is equivalent to stock rsi() in TV.
* calc_rsi_volume(fv, length)
* calc_rsi_sma(fv, length)
* calc_rsi_ema(fv, length)
* calc_rsi_lastopen(fv, length)
* calc_macd(src, fast, slow)

You can also pick up fibs drawing code and put in on any indicator.


List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//
// @author LazyBear
// 
// If you use this code in its original/modified form, do drop me a note. 
//
study("RSI + Volume [LazyBear]", shorttitle="RSIVolume_LB")
length=input(14)
ob=input(80, title="Overbought")
os=input(20, title="Oversold")

WiMA(src, length) => 
    MA_s=(src + nz(MA_s[1] * (length-1)))/length
    MA_s

calc_rsi_volume(fv, length) =>	
	up=iff(fv>fv[1],abs(fv-fv[1])*volume,0)
	dn=iff(fv<fv[1],abs(fv-fv[1])*volume,0)
	upt=WiMA(up,length)
	dnt=WiMA(dn,length)
	100*(upt/(upt+dnt))

rsi_v = calc_rsi_volume(close, length)

u=plot(ob)
l=plot(os)
fill(u,l,red)
plot(50)
plot(rsi_v, color=red, linewidth=1)