What is RSI indicator:- RSI is a momentum oscillator which measures the speed and change of price movements. RSI moves up and down (oscillates) between ZERO and 100. Generally RSI above 70 is considered overbought and below 30 is considered oversold. Some traders may use a setting of 20 and 80 for oversold and overbought conditions respectively. However this may reduce the number of signals. You can also use RSI to identify divergences, strength, reversals, general trend etc.
Calculation:- There are three basic components in the RSI - Avg Gain, Avg Loss & RS. Avg Gain = Average of Upward Price Change Avg Loss = Average of Downward Price Change RS = (Avg Gain)/(Avg Loss) RSI = [100 - (100/{1+ RS})]
First Calculation:- RSI calculation is based on default 14 periods. Average gain and Average loss are simple 14 period averages. Average Loss equals the sum of the losses divided by 14 for the first calculation. Average Gain equals the sum of the Gains divided by 14 for the first calculation. First Average Gain = Sum of Gains over the past 14 periods / 14. First Average Loss = Sum of Losses over the past 14 periods / 14. The formula uses a positive value for the average loss. RS values are smoothed after the first calculation.
Second Calculation:- Subsequent calculations multiply the prior value by 13, add the most recent value, and divide the total by 14. Average Gain = [(previous Avg Gain) x 13 + current Gain] / 14. Average Loss = [(previous Avg Loss) x 13 + current Loss] / 14.
if Average Loss = 0, RSI = 100 (means there were no losses to measure). Average Gain = 0, RSI = 0 (means there were no gains to measure).
Logic of this indicator:- RSI is an oscillator that fluctuates between zero and 100 which makes it easy to use for many traders. Its easy to identify extremes because RSI is range-bound. But remember that RSI works best in range bound market and is less trustworthy in trending markets. A new trader need to be cautious because during strong trends in the market/security, RSI may remain in overbought or oversold for extended periods.
Chart Timeframe:- RSI indicator works well on all timeframes. Timeframe depends on which strategy or settings are you using. Generally a lower timeframe like 1 min, 3 min, 5 min, 15 min, 30 min, 1 Hr etc is used for intraday trades or short duration trades and higher timeframes like 1 day, 1 week, 1 month are used for positional or long term trades.
//------------------------------------------------------------------------------------------------------------------- Strategy 1:- (Basis Strategy of Overbought and Oversold)
Overbought:(chart below) Usually an asset with RSI reading of 70 or above indicates a bullish and an overbought situation. overbought can be seen as trading at a higher price than it should. traders may expect a price correction or trend reversal and sell the security. but RSI indicator can stay in the overbought for a long time when the stock is in uptrend - This may trap an immature trader. an Immature trader will enter a sell position when RSI become overbought (70), whereas a mature trader will enter sell position when RSI line crosses below the overbought line (70).
Oversold:(charts below) An asset with RSI reading of 30 or below indicates a bearish and an oversold condition. oversold can be seen as trading at a lower price than it should. traders may expect a price correction or trend reversal and buy the security. but RSI indicator can stay in the oversold for a long time when the stock is in downtrend - This may trap an immature trader. an Immature trader will enter a buy position when RSI become oversold (30), whereas a mature trader will enter buy position when RSI line crosses above the oversold line (30).
Note: so its better to wait for reversal signal. traders may use 20 instead of 30 as oversold level and 80 instead of 70 as overbought level. new traders may learn to use the indicator as per the prevailing trend to get better results. false signals may be avoided by using bullish signals in bullish trend and bearish signals in bearish trend.
RSI crossing centreline 50 in the below chart showing strength and buy/sell signal. Centre line is at RSI 50. if RSI is above 50 its considered bullish trend. (increasing strength) if RSI is below 50 its considered bearish trend. (decreasing strength) RSI crossing centre line (50) upside may be a buy signal. RSI crossing centre line (50) downside may be a sell signal.
//------------------------------------------------------------------------------------------------------------------- Strategy 3:- (RSI 40 and RSI 60 Support and Resistance )
RSI 40 acting as support in the below chart In an uptrend RSI tends to remain in the 40 to 90 range with 40 as support (buying opportunity at support).
RSI 60 acting as resistance in the below chart In a downtrend RSI tends to remain in 10 to 60 range with 60 as resistance (selling opportunity at resistance).
Note: These ranges may change depending on RSI settings and change in the market trend.
Below chart shows a simple example of Bullish Divergence and Bearish Divergence. An RSI divergence occurs when price moves in the opposite direction of the RSI. A bullish divergence is when price is falling but RSI is rising. which means RSI making higher lows and price making lower lows (buy signal). A bearish divergence is when price is rising but RSI is falling. which means RSI making lower high and price making higher highs (sell signal). Divergences are more strong when appear in an overbought or oversold condition. There may be many false signals during a strong uptrend or strong downtrend. In a strong uptrend, RSI may show many false bearish divergences before finally reversing down. same way in a strong downtrend, RSI may show many false bullish divergences before finally reversing up.
//------------------------------------------------------------------------------------------------------------------- Strategy 5:- (RSI Swing Rejections or Double Top & Double Bottom)
Bullish swing rejection or Double Bottom: (buy signal) (see the chart below) RSI goes below oversold (30). RSI comes back above 30. RSI falls back again towards 30 without going below oversold (30). RSI comes up back again and breaks above recent high.
Bearish swing rejection or Double Top: (sell signal) (see the chart below) RSI goes above overbought (70). RSI comes back below 70. RSI rises back again towards 70 without going above overbought (70). RSI comes down again and breaks below recent low.
//------------------------------------------------------------------------------------------------------------------- Strategy 6:- (Trendline Support and Resistance)
Below chart shows RSI Trendline Resistance: Connect three or more points on the RSI line as it falls to draw a RSI downtrend line (RSI resistance trendline). Everytime it takes resistance from a RSI downtrend line its a selling opportunity.
Below chart shows RSI Trendline Support: Connect three or more points on the RSI line as it rises to draw a RSI uptrend line (RSI support trendline). Everytime it takes support on a RSI uptrend line its a buying opportunity.
//------------------------------------------------------------------------------------------------------------------- Strategy 7:- (Trendline Breakout and Breakdown)
Below chart shows RSI Trendline Breakout: Connect three or more points on the RSI line as it falls to draw a RSI downtrend line (RSI resistance trendline). Whenever it breakout above RSI resistance trendline its a buying opportunity.
Below chart shows RSI Trendline Breakdown: Connect three or more points on the RSI line as it rises to draw a RSI uptrend line (RSI support trendline). Whenever it breakdown below RSI support trendline its a selling opportunity.
Note: Correlate both the RSI and the closing price to ensure proper breakout or breakdown. Challenge is to correctly identify if a breakout or breakdown is sustainable or its a false signal.
//------------------------------------------------------------------------------------------------------------------- Strategy 8:- (RSI Crossover same timeframe)
RSI with two different RSI length crossing each other on same timeframe. when lower RSI length crossing above higher RSI length its a buy signal. when lower RSI length crossing below higher RSI length its a sell signal. for example RSI with length 7 & length 14 on 15 Minutes timeframe.
//------------------------------------------------------------------------------------------------------------------- Strategy 9:- (RSI Crossover Multi timeframe)
RSI with same RSI length but on two different timeframes crossing each. when lower timeframe RSI crossing above higher timeframe RSI its a buy signal. when lower timeframe RSI crossing below higher timeframe RSI its a sell signal. for example RSI with length 14 on 5 Minutes and 1 Hr timeframes.
when RSI crossing above EMA/WMA/SMA its a buy signal. when RSI crossing below EMA/WMA/SMA its a sell signal.
//------------------------------------------------------------------------------------------------------------------- Strategy 11:- (RSI with Bollinger bands)
Bollinger bands and RSI complimenting each other and giving a Buy signal in below chart:
Bollinger bands and RSI complimenting each other and giving a Sell signal in below chart:
if a security price reaches upper band of a Bollinger Band channel and also the RSI is above 70 (overbought), a trader can look for selling opportunities (reversal) (sell). but in case price reaches upper band of a Bollinger Band channel but RSI is not above 70 (overbought), there may be chance that security remains in an uptrend, so a trader may wait before entering a sell position. if a security price reaches lower band of a Bollinger Band channel and also the RSI is below 30 (oversold), a trader can look for buying opportunities (reversal) (buy). but in case price reaches lower band of a Bollinger Band channel but RSI is not below 30 (oversold), there may be chance that security remains in an downtrend, so a trader may wait before entering a buy position. so bollinger band with RSI can give a double confirmation on a reversal.
Note: In this way you may use stochRSI or RSI with MACD for better accuracy. RSI can be used with many other indicators to increase accuracy.
Limitations of the RSI:- RSI works best in range bound market and is less trustworthy in trending markets. So new traders may get trapped in an uptrend or a downtrend if they forget to see the overall long term trend of that security. Traders should set stop loss and take profit levels as per risk reward ratio.
Note: Don't confuse RSI and relative strength. RSI is changes in the price momentum of a security. whereas relative strength compares the price performance of two or more securities.
Like other technical indicators, RSI also is not a holy grail. It can only assist you in building a good strategy. You can only succeed with proper position sizing, risk management and following correct trading Psychology (No overtrade, No greed, No revenge trade etc).
ABOVE SHARED EXPLANATION AND STRATEGIES OF RSI ARE FOR EDUCATIONAL PURPOSE ONLY. YOU MAY PAPER TRADE TO GAIN CONFIDENCE AND BUILD FURTHER ON THESE.
Coding Note:- //you may do simple coding in tv to make an effective indicator with alerts using RSI/EMA/Bollinger Bands etc. //I feel Simple strategy or indicator is the best. //As per me Indicator's are not good or bad. Its the Risk reward where most of the traders fail. Position sizing and Risk Reward can make an indicator effective or ineffective upto an extent. //Below is a simple code in "version 5" which can be coded.
//Condition (Amend conditions as per your requirement). Buy= ta.crossover(rsi,X)//Exit Sellposition//X can be EMA, SMA, WMA etc (for example define ema as EMA=ta.ema(close,50))//X=EMA Sell= ta.crossunder(rsi,X)//Exit Buyposition//X can be EMA, SMA, WMA etc(for example define wma as WMA=ta.wma(close,50))//X=WMA or //if want to use different rsi length but same timeframe rsi1=ta.rsi(close,7)// RSI length 7 rsi2=ta.rsi(close,14)// RSI length 14 or //if want to use same length on different timeframes rsi1=request.security(syminfo.tickerid,'5',ta.rsi(close,14))// RSI length 14 on 5 min timeframe rsi2=request.security(syminfo.tickerid,'60',ta.rsi(close,14))// RSI length 14 on 1 hour timeframe
//For NonRepaint : //you may use previous candle closing. So that indication appears on next candle. for eg. may use close [1] instead of close . //Soon will be posting strategies on Supertrend, Bollinger Bands etc. which are simple and easy to code.
//Tc Happy Trading and Happy Coding. Hope you like it Happy trading :-)
บันทึกช่วยจำ
RSI = 100 – (100 / (1 +RS ))
บันทึกช่วยจำ
This is for educational purpose only. Please consult your financial advisor before investing. we are not SEBI registered.