TradingView
KioseffTrading
Feb 26, 2022 6:00 AM

RSI Failure Swings & AO Divergences 

Microsoft CorporationNASDAQ

Description

Hello!

The script identifies RSI divergences, similar to other public scripts; however, RSI failure swings are also distinguished. When a failure swing is identified, the script calculates the highest RSI measurement (bottom failure swing) or the lowest RSI measurement (top failure swing) between the two RSI pivot points. A continually updating line is plotted at the "fail point" until it is penetrated for two sessions! In addition, the script displays the RSI fail point measurement. RSI bearish divergences are only distinguished when both RSI peaks form above 70. bullish divergences are only distinguished when both RSI troughs form below 30. Top failure swings require the initial RSI peak be above 70, the second RSI peak can form at any measurement. Bottom failure swings require the initial RSI trough be below 30, the second RSI trough can form at any measurement.

Included are Awesome Oscillator divergences. The indicator is a bit tricky; the oscillator does not incorporate an upper or lower extremity. Consequently, the script uses interpolated percentiles to characterize relatively high measurements and relatively low measurements. Bearish divergences that form within the 90th - 99th percentile are distinguished, and bullish divergences that form within the 1 - 10th percentile are distinguished. This can CERTAINLY be changed should you copy the source code and think of something better! For AO, white columns reflect a difference measurement >= 0; black bars reflect a difference measurement < 0
Comments
WinnerCYI
Thank you very much for your talent donation. I really like the indicator, can I hear the recommended way to use it?
KioseffTrading
@WinnerCYI, Thank you for the support Winner!

I'm sorry I'm not seeing this comment until now! I usually have eyes like a hawk lol.

Well, because this script doesn't run performance tests we don't have any test data to make decisions with.

I'd recommend converting this into a strategy script and backtesting various systems based on the divergence signals!
RLB512
Great content as always! Thanks so much!
Pratik_4Clover
This is nice work, little surprised by lack of popularity there, but keep up man!
Jeetl
great job
KioseffTrading
@gele5453, Thank you for the positive feedback gele!
AugustusAsir
Could you please help me how I can setup alert when bullish and bearish divergence get formed
astrothtrader
@AugustusAsir, I couldn’t figure the exact failure alert, but believe I did one better. From what I am seeing, if using a failure only alert the move would already start, so I set an alert on the first (default) PLOT for when it EXITING CHANNEL of upper bound 70 and lower bound 30. This way it alerts in advance and can prepare for the move if/when a failure occurs. Thanks for the indicator @KioseffTrading!
astrothtrader
@AugustusAsir, if you want to not wait and want to be sure you see the divergence indication first, then set this alert to ENTERING CHANNEL, so when you are alerted you will see if the bullish and bearish divergence has already been formed.
More