TradingView
FriendOfTheTrend
25 mar 2022 05:42

Auto Fibonacci From Previous High & Low w/ Percentages & Alerts 

Bitcoin / United States DollarCoinbase

Beskrivning

AUTO FIBONACCI FROM PREVIOUS D/W/M/Q/Y HIGH & LOW WITH PERCENTAGES & ALERTS

This is an auto fibonacci level generating indicator that uses the high and low from the previous day, week, month, quarter or year. It also has a table with real time updates of how far away the nearest fibonacci levels are above and below the current price, represented in percentages. It includes alerts for each level as well if you want to be notified of price crossing fibonacci levels without watching the chart.

***HOW TO USE***
Fibonacci levels are also known as the golden ratio and are popular levels for traders to use as support and resistance levels. Expect price to bounce off of these levels regularly.

The previous high and low are marked as white lines. These are very important levels so make sure to pay attention when price reaches these lines.

Make sure to check out the higher timeframes for major levels.

Each fibonacci line retracement and extension up to the 3.272 level in each direction is displayed as red or green depending on whether price is above or below that level.

The retracement levels used are: previous high, .117, .236, .382, .5, .618, .786, .883, previous low, 1.272, 1.618, 2, 2.272, 2.618, 3 and 3.272.

The extension levels used are: .272, .618, 1, 1.272, 1.618, 2, 2.272, 2.618, 3 and 3.272.

In the indicator settings input tab you can quickly change the timeframe used, turn lines on/off, upper line colors, lower line colors, previous high and low line colors, line width, turn percentage table on/off, change the color of the percentage table and move the percentage table to a different location on the chart.

The indicator includes alerts for each fibonacci level as well, just set your fibonacci timeframe on your favorite ticker and turn on tradingview alerts for alert() calls.

***MARKETS***
This indicator can be used as a signal on all markets, including stocks, crypto, futures and forex.

***TIMEFRAMES***
This auto fibonacci indicator can be used on all timeframes.

***TIPS***
Try using numerous indicators of ours on your chart so you can instantly see the bullish or bearish trend of multiple indicators in real time without having to analyze the data. Some of our favorites are our Buy & Sell Pressure Colored Candles, Directional Movement Index + Fisher Transform, Volume Profile W/ Buy & Sell Pressure Labels, Auto Support And Resistance and Money Flow Index in combination with this Auto Fibonacci. They all have real time Bullish and Bearish labels or percentage gap info as well so you can immediately understand each indicator's trend and how far away major levels are in percentages.

Versionsinformation

Updated variable usage and changed a few text displays
Kommentarer
diLiviu
Hi
I edited your script with following:

_draw_label(price, txt, txtColor) =>
if not na(price)
x = bar_index
labelStyle = label.style_label_left
align = text.align_left
labelsAlignStrLeft = txt + '\n ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ \n'
labelsAlignStrRight = ' ' + txt + '\n ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ ‏ \n'
labelsAlignStr = labelsAlignStrRight
var id = label.new(x=x, y=price, text=labelsAlignStr, textcolor=txtColor, style=labelStyle, textalign=align, color=#00000000)
label.set_xy(id, x, price)
label.set_text(id, labelsAlignStr)
label.set_textcolor(id, txtColor)

//Calculate Fibonacci Levels
fib(level) =>
fibGap = tickerHigh - tickerLow
fibLevel = tickerHigh - (fibGap * level)
_draw_label(fibLevel, str.tostring(level), color.yellow)
fibLevel

fibext(extlevel) =>
fibExtGap = tickerLow - tickerHigh
fibExtLevel = tickerHigh - (fibExtGap * extlevel)
_draw_label(fibExtLevel, str.tostring(extlevel), color.yellow)
fibExtLevel

anyways , the labels are not perfectly aligned with the fibo lines :-)
FriendOfTheTrend
@diLiviu, Nice!
diLiviu
@FriendOfTheTrend, now labels are aligned :-)

_draw_label(price, txt, txtColor) =>
if not na(price)
var id = label.new(x=bar_index, y=price, text=txt, textcolor=txtColor, style=label.style_label_left, textalign=text.align_left, color=#00000000)
label.set_xy(id, bar_index, price)
label.set_text(id, txt)
label.set_textcolor(id, txtColor)
Poweredbystocks
Hi can u add option to hide previous days fibo lines , So that we can see fibo lines on current day
desousa2x
Hi, is it possible to remove the up/down line between sessions?
FriendOfTheTrend
@preqc99, Not that I'm aware of. Sorry. You can move the visual order of the indicator to the back so the lines aren't blocking anything though.
Mer