iFuSiiOnzZ

Advanced Relative Strength Index

COINBASE:BTCUSD

This script is an enhanced version of the Relative Strength Index( RSI ).
  • Moving average ( EMA , SMA , RMA, VWMA )
  • Smoothness ( EMA , SMA , RMA, VWMA )
  • Divergences (regular and hidden)

RSI SETTINGS
This section contains the configuration of the RSI .
  • Length: Number of look-back bars to calculate the RSI
  • Source: Data used to calculate the RSI (close price, open price, etc)
  • Upper band: upper band value
  • Lower band: lower band value
  • Show upper band: show upper band, next to it you can select the color
  • Show lower band: show lower band, next to it can select the color
  • Show center line: show the 50 line, next to it can select the color
  • RSI line color: color of the RSI
  • Color interpolation: interpolate between the lower band color, RSI color and the upper band color

RSI SMOOTH
Smooth the RSI to making the indicator less twitchy.
  • Length: Number of look-back values for smoothing, value of 1 is not smoothing
  • Type: Moving average type used for smoothing

RSI MOVING AVERAGE
The moving average of the RSI .
  • Show moving average: show the moving average, next to it you can select the color
  • Length: Number of look-back values for calculate the moving average
  • Type: moving average type

RSI DIVERGENCES
Settings for calculating and plotting the divergences.
  • Bull price source: data used for finding bullish divergences (close price, open price, etc)
  • Bear price source: data used for finding bearish divergences (close price, open price, etc)
  • Divergence source: use the "price" or the "rsi" for finding lows/highs
  • Low/High left bars: number of left bars used to confirm a low/high
  • Low/High right bars: number of right bars used to confirm a low/high
  • Minimum lookback bars: minimal distance between bars to confirm a divergence
  • Maximum lookback bars: maximum distance between bars to confirm a divergence
  • Lookback lows/highs: number of lows/highs used to find divergences
  • Price threshold: higher value, more lines on the chart
  • RSI threshold: higher value, more lines on the chart
  • Show regular bull divergence: show regular bullish divergence , next to it can select the color
  • Show hidden bull divergence: show hidden bullish divergence , next to it can select the color
  • Show regular bear divergence: show regular bearish divergence, next to it can select the color
  • Show hidden bear divergence: show hidden bearish divergence, next to it can select the color
  • Show lows: show an arrow bellow the founded lows for the current settings, next to it can select the color and the offset distance
  • Show highs: show an arrow above the founded highs for the current settings, next to it can select the color and the offset distance

NOTE
The RSI used for calculate the divergences and the plotted on the chart are not the same. For the the divergences the RSI is calculated based on the bull/bear source selected on the "RSI DIVERGENCE" settings and once a divergence is spotted it will be plotted over the RSI on the chart which is based on the "RSI SETTINGS" section. Thus if low/high price is used for the RSI divergence the plotted lines may not be on the exact low/high pivots .

DISCLAIMER
This tool by it self is not made to trade. EMA can be used as support/resistance and the DIVERGENCES to spot possible price reversal, which doesn't mean it will happen. So if you want to improve you opportunities use it in combination with other technical analysis tool. The divergence system is lagging indicator, it depends on the number of right bars to confirm a low/high, so if there is any new forming divergence on the way it will be plotted with a dotted line.
Sürüm Notları: A small update with new feature and minor improvements, here's the summary of what has changed...

New features
  • Add Bollinger bands

Improvements
  • Remove the limitation of 15 lookback lows/highs (by default 26)
  • Remove the limitation of minimum 3 bars to confirm a low/high (set to 1)

Fixes
  • None

Impact
By default, all extra features are disabled, thus, only the RSI and the 50 line are shown.
Sürüm Notları: Update with new features and minor fixes, here's the summary of what has changed...

New features
  • Added possible support/resistance lines

Improvements
  • None

Fixes
  • Apply Bollinger bands to the RSI shown on the chart

Impact
The algorithm gets the last valid low/high (points from now on), make use of the lows and highs of the diverge system, afterwards it takes a look at the last N points and it generate the line from the last point to the current one. Once it has the line, it checks how many other points are around the line, with a margin of error. If any point is out of the line, goes above the margin error that line is invalidates and new line is generated using the the point the invalidated the line as new pivot.

Support/Resistance Lines options
Lookback lows/highs: Number of lows/highs used to find a trend line
Distance threshold: Threshold distance from the line to current low/high (error margin)
Line touch points: Number of lows/highs around the line to confirm it as support/resistance
Show support line: Self explanatory, line color next to it
Show resistance line: Self explanatory, line color next to it

Note
A better way to find a support/resistance lines would be to generate all possible lines and compare all points with all lines. The problem would be the quadratic complexity in addition to the fact that the pine script does not allow a complex data structure.
Sürüm Notları: Update with new features some improvements and minor fixes, here's the summary of what has changed...

New features
  • Histogram based on the difference between the current RSI value and a moving average
  • Bull and bear control zones

Improvements
  • Support/Resistance lines makes used of the lows/high of the RSI on the chart (allow a maximum of 50 lows/highs)
  • Minor source code changes and misspellings

Fixes
  • Bollinger bands UI label names
Sürüm Notları: Minor improvements on the way divergences are showing...

New features
  • None

Improvements
  • Add an option to show divergences as lines or labels
  • Offset of the current position for drawing the divergence lines or label

Fixes
  • None

Note
Possible forming divergences will still be drawn as lines.
Sürüm Notları: Experimental price prediction and some minor improvements and fixes...

New features
  • RSI price prediction

Improvements
  • EMA uptrend/downtrend color

Fixes
  • Remove function access to global variable

Note
The price prediction is experimental, therefore it may not show the approximate price value that corresponds to the given RSI.
Sürüm Notları: Changed to the price prediction algorithm

New features
  • None

Improvements
  • Price prediction algorithm

Fixes
  • None

Note
Price prediction algorithm is solving the RS and the RMA equations to get a more accurate value of the price to achieve the desired RSI value. On settings you can select if you want to use close candles or the current open one. For close candle price is no changing until the candle has close, which gives a more stable price value. Using the open candle, the prices predicted changes with any change in the current price which gives a more accurate price value.
Sürüm Notları: Added Cutler RSI, bull/bear control zones improvements

New features
  • Cutler RSI

Improvements
  • Added two new representation for displaying control zones
  • Remove redundant divergence settings

Fixes
  • None

Note
There are now several way to display control zones, "Static", "Dynamic" and "Confirmation". The "Static" representation shows to bands that represents the bull/bear zone. The "Dynamic" one fill the space under/above the RSI depending on the zone it is and the last one, "Confirmation", it will draw a box as bull/bear zone and it will not change as long as the RSI doesn't change zone.

On the divergence settings it has been removed the "Minimal lookback bars" and "lookback lows/highs". The number of highs used to find divergence are based on the "Maximum lookback bars". Set divergence source to "rsi" by default as it seems more accurate.
Sürüm Notları: Minor improvements and fixes...

New features
  • None

Improvements
  • Add option to change line thickness for RSI, EMA and Divergences

Fixes
  • Fix bug detecting the bull/bear confirmation zone
Sürüm Notları: A small update with new feature and minor improvements and bug fixes, here's the summary of what has changed...

New features
* Add Stochastic RSI
* Add Stochastic RSI, possible, price reversal pivot

Improvements
* Line line thickness and line type for support/resistance
* Remove transparency for most RSI plots

Fixes
* Apply smooth to the bull/bear RSI for divergences

Note
The price reversal pivot has to be backtested to see how accurate it can be.
Please remember that when you choose the color, at the bottom of the popup there is a slider that allows you to choose the transparency (that make the lines more or less visible to the eye).
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?