Price Legs & Fib Projections: Fibonacci Confluence

twingall Uppdaterad   
-Plots price legs based on two user input lookback numbers. Smaller number for small legs, larger number for large legs.
-Plots Fib projections of these price legs, above and below; User can input four independent fib levels or standard deviation levels

## User Inputs ##
~Show visible chart only; Show price leg labels (time and price); show small legs (fibs and/or boxes); show large legs (fibs and/or boxes)
~Input 4 Fibonacci levels or measured move levels. Toggle each level on/off
~toggle on/off Fib levels ABOVE or fib levels BELOW
~extend Fib levels 'X' bars to the right, or toggle on/off 'Full Extend' to the right

## Tips & Notes ##
-use 'Full Extend' together with 'visible chart only' if searching for multiple confluence of Fib levels.
-can quickly get very cluttered, but the aim in writing this was to try to find area of confluence at a glance amongst a mess of levels, then hide the indicator and study/note that area.
-if lines don't print toward the left hand side of the chart you've likely reached the max line limit set by Tradingview.
-Fib level input of 1.0 represents zero % extension above the high or below the low of the leg; 2.0 represents 100% extension.

1hr S&P: Visible chart only; large legs only; 50%, 100%, 150%, 200% Fib extensions; Above only; lines extended fully to the right:

Usage notes; 15m S&P: Small & Large price legs; partial extend; all fib levels above/below:
-added 'MODE' confluence lines: three lines based on 1st, 2nd and 3rd MODE values of the array of Fibs. (1st most occurrences of rounded level confluence >> to 3rd most occurrences of rounded level confluence). Affected by decimal places rounding precision user input. Idea is to automatically plot levels of confluence. Works better on some assets than others.
-fixed bug where occasional price legs cut through pivots.
-Removed single candle price legs
-re-formatted the dialog box; added tooltips.
-If you run into 'Array slice out of bounds' error, try adjusting decimal places.
~Shown here on XRP/USDT 5min chart with Decimal places set to 3, lookback 400 bars, and based on both large and small leg Fibs:
-update to use three manually coded versions of 'statistical mode'. This improves behaviour and allows user can see the frequency of rounded confluent levels. The 1st, 2nd and 3rd highest frequency levels are plotted and displayed in a table.
-included a modified rounding function to allow for both positive and negative decimal places: I.e. for large dollar value assets, negative decimal places of '-1' or '-2' would represent rounding to nearest 10 dollars or 100 dollars respectively.
~Example chart showing Btc/Usd 5min with 500 bar lookback and decimal places set to '-1'; seeing a nice rejection from the '#1 confluence' level:
-added option to select up or down legs only (or both) for fib confluence calculations; thanks @abdelli007 for the suggestion.
-added condition to prevent confluence level printing when frequency is less than 2
settings demo:

You can buy me a coffee here...

BTC: 3JrhUwNRnKyqhaa1n1AXKeAubNeEFoch6S
ETH erc20: 0x4b0400B1c18503529ab69611e82a934DDe4Ab038
ETH bep20: 0x1F0f03F184079bb1085F8C9dF3a8191C9f5869B3
Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?