RicardoSantos

[RS]Fractal Levels V1

EXPERIMENTAL: update to previous version, added a average of the fractal levels and the ability to hide the diferent components.
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]Fractal Levels V1", shorttitle="[RS]FL.V1", overlay=true)
hidefractals = input(false)
hidelevels = input(false)
hideaverage = input(false)

topfractal = high < high[1] and high[1] < high[2] and high[2] > high[3] and high[3] > high[4]
botfractal = low > low[1] and low[1] > low[2] and low[2] < low[3] and low[3] < low[4]

plotchar(hidefractals ? na : topfractal, text="Fractal", location=location.abovebar, offset=-2)
plotchar(hidefractals ? na : botfractal, text="Fractal", location=location.belowbar, offset=-2)

topfractals = topfractal ? high[2] : topfractals[1]
botfractals = botfractal ? low[2] : botfractals[1]

topfcolor = topfractals != topfractals[1] ? na : black
botfcolor = botfractals != botfractals[1] ? na : black

plot(hidelevels ? na : topfractals, color=topfcolor)
plot(hidelevels ? na : botfractals, color=botfcolor)

fractalma = avg(topfractals, botfractals)
plot(hideaverage ? na : fractalma, color=blue, linewidth=2)
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out