Automatic Support, Resistance, Fibonacci Levels

This indicator plots absolute high and low values for up to five completely adjustable time periods (in months, weeks, days, hours, minutes) and optionally calculates the Fibonacci levels on the pair of absolutes of your choice, ascending or descending, and mimics the shading available in the built-in Fib charting tools (e.g. retracement).

Here are a few screenshots of the same chart with various options selected.

3-Month , 4-Week, and 5-Day absolutes with 3-Monthly Fib plotted:

The same chart with 4-Weekly Fib:

The same chart with 5-Daily Fib:

5-Day, 12-Hour, 90-Minute absolutes with 12-Hourly Fib:

Zoomed in, on a 30-minute interval, with 90-minute Fib:

With descending ("inverted") 90-minute Fib:

I started putting this together for Vazzyb, who was looking for a way to automate plotting horizontal support and resistance levels for monthly, weekly, and daily extremes, and then I added additional features as they occurred to me. Special thanks to Paaax, who suggested I add Fib levels.

I am leaving the code open, so you may feel free to grab snippets you like and use them for your own purposes. Of particular interest may be my custom "calc_fib()" function, which accepts any series pair, as well as a Boolean indicating whether to invert, and returns an array with each of the major Fibonacci levels: .

If anyone likes this enough to feel generous, please feel free:

P.S. If you want the time lengths to be as close to accurate as possible, don't forget to change the number of days per week when using for cryptocurrency!
Notes de version: Added the option to hold monthly, weekly, and daily S/R levels constant throughout each day, changing only at the start of each new trading session, by request.
Added the option to turn all lines gray...as a bonus.
Remember, Fibonacci levels can be turned off by selecting "None."
Notes de version: Removed all-grey option; added configurable zigzag indicator. Note that the TV built-in zigzag will usually be better, since that indicator redraws its past--something that a script cannot do. Depth and sensitivity are options, though.
Notes de version: Made more sensible color choices; added option to connect support/resist lines with a line and disabled this option by default; enabled "Keep Lines Straight All Day" by default; set default zigzag depth to 50.

Example of 1-week (red), 2-day (blue) levels plotted with no Fib:
Notes de version: Fixed an error in the zigzag logic. Shown in the preview image alongside my Support/Resistance (Daily Bars) indicator.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?