TradingView
twingall
17 Feb 2023 pukul 00.38

Price Legs & Fib Projections: Fibonacci Confluence 

E-mini S&P 500 FuturesCME

Deskripsi

-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:

Catatan Rilis

-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:

Catatan Rilis

-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:

Catatan Rilis

-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:
Komentar
CashAthletes
this is amazing i like this one
nw9
Excellent appreciated ty
SonicTheHedgeTrader
Thank you kindly!
ukmpits
@twingall Is there any future update Sir? Thanks mate
Raviwadhwani
Repaint???????
asd895004906
@Raviwadhwani, 确实重画了
abdelli007
Hi @twingall, impressive work, thanks for sharing, I have found a clustering algorithm from @CryptoGearBox in his "Mean Shift Pivot Clustering" indicator, and mentioned your indicator to apply the same algorithm and achieve similar results to Steve Norman eWavesHarmonics clustering feature on MetaTrader, the challenge is the same for you, if you can do it please ? Thanks in advance.
twingall
@abdelli007, Updated to do similar to this, though using Arrays, rounded levels and three degrees of statistical MODE. Works better on some assets than others, tweaking decimal places depending on the asset is key. Also fixed some other issues..
abdelli007
@twingall, Thanks for the update, brilliant idea, I noticed that projecting above and below is affecting statistical calculation so I did the following for all fib levels:
if showFibsUp
array.push(fibArr, roundingFxn(dLegFib1ProjUp1[lb1]))
if showFibsDown
array.push(fibArr, roundingFxn(dLegFib1ProjDown1[lb1]))

Now I toggle off projection below to look for confluence above and vice versa.

You did half of the work of my previous request (fibArr), so I tried to implement the clustering algorithm but something went wrong, I can't figure it out :(
twingall
@abdelli007, good idea, will update to include that option when i get time. I looked into the clustering algorithm, couldn't figure out implementation either. DM me if you figure it out and want to share, All best, T
Lebih lanjut