OPEN-SOURCE SCRIPT
@tk ยท fractal rsi levels

โ โOVERVIEW
This script is an indicator that helps traders to identify the RSI Levels for multiple fractals wherever the current timeframe is. This script was based on RSI Levels, 20-30 & 70-80 by abdomi indicator, that calculates the Relative Strenght Index levels based on the asset's price and plots it into the chart, creating a "wave" style indicator. The core feature of this indicator is the fractal rays, so trader can visualize each of the oversold and overbought levels of multiple timeframe on the current timeframe that he is on. The indicator will plots multiple rays after the chart bars. indicating where is the oversold and overbought levels for others fractals.
โ โMOTIVATION
Since the RSI Levels, 20-30 & 70-80 by abdomi indicator helps a lot to identify the possible price levels when the asset is oversold or overbought, I saw myself drawing multiple horizontal lines on these levels in lower timeframes so, in an uptrend or downtrend, I can try to get a pullback of these trends when the asset reaches oversold or overboght levels. So, I get the idea to make those lines visible in multiple timeframes so I don't need to draw it myself manually anymore.
โ โCONCEPT
The trading concept to use this indicator is the concept to make entries on uptrend or downtrend pullbacks when the asset price reaches oversold or overbought levels. But this strategy don't works alone. It needs to be aligned together with others indicators like Exponential Moving Averages, Chart Patterns, Support and Resistance, and so on... Even more confluences that you have, bigger are your chances to increase the probability for a successful trade. So, don't use this indicator alone. Compose a trading strategy and use it to improve your analysis.
โ โCUSTOMIZATION
This indicator allows the trader to customize the following settings:
GENERAL
Text size
โโChanges the font size of the labels to improve accessibility.
โโType: string
โโOptions: `tiny`, `small`, `normal`, `large`.
โโDefault: `small`
RSI LEVELS ยท SETTINGS
Pre-oversold Level
โโChanges the RSI Level to calculate the "pre-oversold" price level on the chart.
โโType: int
โโMin: 1
โโMax: 49
โโDefault: 33
Pre-overbought Level
โโChanges the RSI Level to calculate the "pre-overbought" price level on the chart.
โโType: int
โโMin: 51
โโMax: 100
โโDefault: 67
Show "Pre-over" Levels
โโEnables / Disables the pre-oversold and pre-overbought levels on the chart.
โโType: bool
โโDefault: true
FRACTAL RAYS ยท SETTINGS
Length
โโChanges the base length for the RSI calculation.
โโType: int
โโMin: 1
โโDefault: 14
Source
โโChanges the base source for the RSI calculation.
โโType: float
โโDefault: close
FRACTAL RAYS ยท STYLE
Ray Color
โโChanges the color of all fractal rays and its label.
โโType: color
โโDefault: color.rgb(187, 74, 207)
Ray Style
โโChanges the style of all fractal rays.
โโType: string
โโOptions: `line.style_solid`, `line.style_dashed`, `line.style_dotted`
โโDefault: line.style_dotted
Ray Length
โโChanges the length of all fractal rays.
โโType: int
โโDefault: 15
FRACTAL RAYS ยท OVERSOLD
Oversold Level
โโChanges the base RSI Level for fractal rays calculation.
โโType: int
โโMin: 1
โโDefault: 30
Oversold Prefix
โโCustomizes the fractal ray label with a prefix text.
โโType: string
โโDefault: ๐
Oversold Suffix
โโCustomizes the fractal ray label with a suffix text.
โโType: string
โโDefault: (empty)
FRACTAL RAYS ยท OVERBOUGHT
Overbought Level
โโChanges the base RSI Level for fractal rays calculation.
โโType: int
โโMin: 1
โโDefault: 70
Overbought Prefix
โโCustomizes the fractal ray label with a prefix text.
โโType: string
โโDefault: ๐ป
Overbought Suffix
โโCustomizes the fractal ray label with a suffix text.
โโType: string
โโDefault: (empty)
FRACTAL RAYS ยท VISIBILITY RULES
These rules are applied for each of fractal rays so, the traders can choose what timeframes they wants to show the fractal rays for each of it. The rule will be applied as the following condition: `if timeframe != CURRENT_TIMEFRAME and timeframe <= CHOSEN_OPTION`. Actually, the fractal rays are on the chart but, isn't visible because it was applied a transparent color, so it is visually not on the chart to prevent chart's over polution.
LABELS
Show Labels on Price Scale
โโShows labels on price scale.
โโType: bool
โโDefault: false
Show Price on Fractal Rays
โโShows the RSI Level price on each of fractal rays respectively.
โโType: bool
โโDefault: false
โ โEXTERNAL LIBRARIES
This script uses the `tk` library to calculate RSI Levels. It is a library that contains various functions that helps pine script developers to calculate RSI Levels.
โ โFUNCTIONS
The library contains the following functions:
fn_fractalVisibilityRule(string visibilityRule)
โโConverts the fractal rays timeframe visibility rule label to timestamp int.
โโParameters:
โโโโvisibilityRule: (string) Fractal ray visibility rule label.
โโReturns: (int) Fractal ray visibility rule timestamp.
fn_requestFractal(string period, expression)
โโConverts the fractal rays timeframe visibility rule label to timestamp int.
โโParameters:
โโโโperiod: (string) Timeframe period for the desired fractal.
โโโโexpression: (mixed) Security expression that will be applied for calculation.
โโReturns: (mixed) A result determined by expression.
fn_plotRay(float y, string label, color color, int length)
โโPlots ray after chart bars for the current time.
โโParameters:
โโโโperiod: (string) Timeframe period for the desired fractal.
โโโโexpression: (mixed) Security expression that will be applied for calculation.
โโReturns: (void) This function only plots the elements into the chart
fn_plotRsiLevelRay(simple string period, simple int level, color color)
โโPlots RSI Levels ray after chart bars for the current time.
โโParameters:
โโโโperiod: (simple string) Timeframe period.
โโโโlevel: (simple int) Relative Strength Index level.
โโโโcolor: (color) The color of both, ray and label text.
โโReturns: (void) This function only plots the elements into the chart
This script is an indicator that helps traders to identify the RSI Levels for multiple fractals wherever the current timeframe is. This script was based on RSI Levels, 20-30 & 70-80 by abdomi indicator, that calculates the Relative Strenght Index levels based on the asset's price and plots it into the chart, creating a "wave" style indicator. The core feature of this indicator is the fractal rays, so trader can visualize each of the oversold and overbought levels of multiple timeframe on the current timeframe that he is on. The indicator will plots multiple rays after the chart bars. indicating where is the oversold and overbought levels for others fractals.
โ โMOTIVATION
Since the RSI Levels, 20-30 & 70-80 by abdomi indicator helps a lot to identify the possible price levels when the asset is oversold or overbought, I saw myself drawing multiple horizontal lines on these levels in lower timeframes so, in an uptrend or downtrend, I can try to get a pullback of these trends when the asset reaches oversold or overboght levels. So, I get the idea to make those lines visible in multiple timeframes so I don't need to draw it myself manually anymore.
โ โCONCEPT
The trading concept to use this indicator is the concept to make entries on uptrend or downtrend pullbacks when the asset price reaches oversold or overbought levels. But this strategy don't works alone. It needs to be aligned together with others indicators like Exponential Moving Averages, Chart Patterns, Support and Resistance, and so on... Even more confluences that you have, bigger are your chances to increase the probability for a successful trade. So, don't use this indicator alone. Compose a trading strategy and use it to improve your analysis.
โ โCUSTOMIZATION
This indicator allows the trader to customize the following settings:
GENERAL
Text size
โโChanges the font size of the labels to improve accessibility.
โโType: string
โโOptions: `tiny`, `small`, `normal`, `large`.
โโDefault: `small`
RSI LEVELS ยท SETTINGS
Pre-oversold Level
โโChanges the RSI Level to calculate the "pre-oversold" price level on the chart.
โโType: int
โโMin: 1
โโMax: 49
โโDefault: 33
Pre-overbought Level
โโChanges the RSI Level to calculate the "pre-overbought" price level on the chart.
โโType: int
โโMin: 51
โโMax: 100
โโDefault: 67
Show "Pre-over" Levels
โโEnables / Disables the pre-oversold and pre-overbought levels on the chart.
โโType: bool
โโDefault: true
FRACTAL RAYS ยท SETTINGS
Length
โโChanges the base length for the RSI calculation.
โโType: int
โโMin: 1
โโDefault: 14
Source
โโChanges the base source for the RSI calculation.
โโType: float
โโDefault: close
FRACTAL RAYS ยท STYLE
Ray Color
โโChanges the color of all fractal rays and its label.
โโType: color
โโDefault: color.rgb(187, 74, 207)
Ray Style
โโChanges the style of all fractal rays.
โโType: string
โโOptions: `line.style_solid`, `line.style_dashed`, `line.style_dotted`
โโDefault: line.style_dotted
Ray Length
โโChanges the length of all fractal rays.
โโType: int
โโDefault: 15
FRACTAL RAYS ยท OVERSOLD
Oversold Level
โโChanges the base RSI Level for fractal rays calculation.
โโType: int
โโMin: 1
โโDefault: 30
Oversold Prefix
โโCustomizes the fractal ray label with a prefix text.
โโType: string
โโDefault: ๐
Oversold Suffix
โโCustomizes the fractal ray label with a suffix text.
โโType: string
โโDefault: (empty)
FRACTAL RAYS ยท OVERBOUGHT
Overbought Level
โโChanges the base RSI Level for fractal rays calculation.
โโType: int
โโMin: 1
โโDefault: 70
Overbought Prefix
โโCustomizes the fractal ray label with a prefix text.
โโType: string
โโDefault: ๐ป
Overbought Suffix
โโCustomizes the fractal ray label with a suffix text.
โโType: string
โโDefault: (empty)
FRACTAL RAYS ยท VISIBILITY RULES
These rules are applied for each of fractal rays so, the traders can choose what timeframes they wants to show the fractal rays for each of it. The rule will be applied as the following condition: `if timeframe != CURRENT_TIMEFRAME and timeframe <= CHOSEN_OPTION`. Actually, the fractal rays are on the chart but, isn't visible because it was applied a transparent color, so it is visually not on the chart to prevent chart's over polution.
LABELS
Show Labels on Price Scale
โโShows labels on price scale.
โโType: bool
โโDefault: false
Show Price on Fractal Rays
โโShows the RSI Level price on each of fractal rays respectively.
โโType: bool
โโDefault: false
โ โEXTERNAL LIBRARIES
This script uses the `tk` library to calculate RSI Levels. It is a library that contains various functions that helps pine script developers to calculate RSI Levels.
โ โFUNCTIONS
The library contains the following functions:
fn_fractalVisibilityRule(string visibilityRule)
โโConverts the fractal rays timeframe visibility rule label to timestamp int.
โโParameters:
โโโโvisibilityRule: (string) Fractal ray visibility rule label.
โโReturns: (int) Fractal ray visibility rule timestamp.
fn_requestFractal(string period, expression)
โโConverts the fractal rays timeframe visibility rule label to timestamp int.
โโParameters:
โโโโperiod: (string) Timeframe period for the desired fractal.
โโโโexpression: (mixed) Security expression that will be applied for calculation.
โโReturns: (mixed) A result determined by expression.
fn_plotRay(float y, string label, color color, int length)
โโPlots ray after chart bars for the current time.
โโParameters:
โโโโperiod: (string) Timeframe period for the desired fractal.
โโโโexpression: (mixed) Security expression that will be applied for calculation.
โโReturns: (void) This function only plots the elements into the chart
fn_plotRsiLevelRay(simple string period, simple int level, color color)
โโPlots RSI Levels ray after chart bars for the current time.
โโParameters:
โโโโperiod: (simple string) Timeframe period.
โโโโlevel: (simple int) Relative Strength Index level.
โโโโcolor: (color) The color of both, ray and label text.
โโReturns: (void) This function only plots the elements into the chart
Skrip sumber terbuka
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Penafian
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.
Skrip sumber terbuka
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Penafian
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.