OPEN-SOURCE SCRIPT

@tk ยท fractal rsi levels

4โ€ฏ360
โ–ˆ โ€ƒ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

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.