FibonRSI / ErkOzi


This software is a technical analysis script written in the TradingView Pine language. The script creates a trading indicator based on Fibonacci retracement levels and the RSI indicator, providing information about price movements and asset volatility by using Bollinger Bands.

There are many different scripts in the market that draw RSI and Fibonacci retracement levels. However, this script was originally designed by me and shared publicly on TradingView.

***The indicator uses RSI (Relative Strength Index) and Bollinger Bands (BB) as the basis for the FibonRSI strategy. RSI measures the strength of a price movement, and BB measures the volatility of an asset. The FibonRSI strategy is based on the idea that the Fibonacci ratios and RSI can be used to predict a asset's price retracement levels.

***The script allows for various parameters to be adjusted. Users can specify the price source type and adjust the periods for RSI and Bollinger Bands. The standard deviation number for Bollinger Bands can also be customized.

***The script calculates the current RSI indicator position and the basic, upper, and lower levels of Bollinger Bands. It then calculates and draws the Fibonacci retracement levels. The color of the RSI line is determined by the upper and lower distribution levels of Bollinger Bands. Additionally, the color of the Fibonacci retracement levels can also be customized by the user.

***This script can be used to determine potential buy and sell signals using Fibonacci retracement levels and RSI. For example, when the RSI is oversold and the price is close to a Fibonacci retracement level, it can be interpreted as a buying opportunity. Similarly, when the RSI is overbought and the price is close to a Fibonacci retracement level, it can be interpreted as a selling opportunity.

***The script takes input parameters such as the price source used for calculation, the period for the RSI indicator, the period for the Moving Average in Bollinger Bands, and the number of standard deviations used in Bollinger Bands.

***The script's conditions include elements such as calculating the current position of the RSI indicator, calculating the upper and lower Bollinger Bands, calculating the dispersion factor, and calculating Fibonacci levels.

***The parameters in the code can be adjusted for calculation, including the price type used, the RSI period, the Moving Average period for BB, and the standard deviation count for BB. After this, the current position of the RSI, Moving Average, and standard deviation for BB are calculated. After calculating the upper and lower BB, the levels above and below the average are calculated using a specific dispersion constant.

current_rsi = ta.rsi(src, for_rsi) // Current position of the RSI indicator
basis = ta.ema(current_rsi, for_ma)
dev = for_mult * ta.stdev(current_rsi, for_ma)
upper = basis + dev
lower = basis - dev
dispersion = 1
disp_up = basis + (upper - lower) * dispersion
disp_down = basis - (upper - lower) * dispersion

// Fibonacci Levels
f100 = basis + (upper - lower) * 1.0
f78 = basis + (upper - lower) * 0.78
f65 = basis + (upper - lower) * 0.65
f50 = basis
f35 = basis - (upper - lower) * 0.65
f23 = basis - (upper - lower) * 0.78
f0 = basis - (upper - lower) * 1.0

***When calculating Fibonacci levels, the distance between the average of BB and the upper and lower BB is used. These levels are 0%, 23.6%, 35%, 50%, 65%, 78.6%, and 100%. Finally, the RSI line that changes color according to a specific RSI position, Fibonacci levels, and BB are visualized. Additionally, the levels of 70, 30, and 50 are also shown.

The script then sets the color of the RSI position according to the EMA and draws Bollinger Bands, RSI, Fibonacci levels, and the 70, 30, and 50 levels.

In conclusion, this script enables traders to analyze market trends and make informed decisions. It can also be customized to suit individual trading strategies.
This script analyzes the RSI indicator using Bollinger Bands and Fibonacci levels. The default settings are 14 periods for RSI, 233 periods and 2 standard deviations for BB. The MA period inside BB is selected as the BB period and is used when calculating Fibonacci levels.

***The reason for selecting these settings is to provide enough time for BB period to confirm a possible trend. Additionally, the MA period inside BB is matched with the BB period and used when calculating Fibonacci levels.

***Fibonacci levels are calculated from the distance between the upper and lower bands of BB and show how RSI movement is related to these levels. Better results can be achieved when RSI periods are set to Fibonacci numbers such as 21, 55, and 89. Therefore, the use of Fibonacci numbers is recommended when adjusting RSI periods. Fibonacci numbers are among the technical analysis tools that can capture the reflection of naturally occurring movements in the market. Therefore, the use of Fibonacci numbers often helps to better track fluctuations in the market.

Finally, the indicator also displays the 70 and 30 levels and the middle level (50) with Fibonacci levels drawn in circles. Changing these settings can help optimize the Fibonacci levels and further improve the indicator.

Thank you in advance for your suggestions and opinions......
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?