TradingView
TJalam
19 Dis 2021 pukul 12.01

Support Resistance Zones using confluence & Std. Deviation 

Ethereum / TetherUSBinance

Huraian

Overview:
This indicator takes (interactive) input from the user for support and resistance levels and plots important zones considering the other confluence levels in the indicator.

Working of indicator:
This indicator takes six input of Support/resistance level form the user
It has following 32 confluence levels
a.4 Recent positive Divergence levels (DN1, DN2, DN3, DN4)
b.4 recent negative divergence levels (DP1, DP2, DP3, DP4)
d.5 Fibonacci levels (Fib0, Fib236, Fib5, Fib618, Fib786)
e. 7 Pivot levels (P, PR1, PR2, PR3, PS1, PS2, PS3)
f.4 EMAs (E20, E200, E100, E50)
g. ATH, ATL, Weekly High, Weekly Low, two days ago high, two days ago low, previous day high , previous day low

The code checks nearest ‘n’ CONFLUENCE for each level (“Number of confluences to check”) in the indicator, after getting the nearest confluence it calculates the standard deviation of those levels WITH RESPECT TO THE MANUAL INPUT LEVELS.
If the Std. Deviation is less than the input value (“Minimum standard deviation” option) then the zone is displayed on the chart.

How to use:
Add the indicator on the chart select your important support and resistance levels.
Set standard deviation, if the confluence is less than the input standard deviation then you will see those zones on the chart.

You can display all divergence levels; you can display all fib levels. All confluences can be displayed by using the setting of the indicator

How to read the indicator values:
The zone will show all the confluence it has in its zone,
Example:

Table details:
The table shows the maximum and minimum deviation out of all six levels .To see at least one zone you have to make sure that Input value Std. Deviation must be greater than Min Std. Deviation of the table


Sources & refences :
Big thank to pinecoders.com/faq_and_code/ and kodify.net/tradingview-programming-articles/

Standard deviation :
investopedia.com/terms/s/standarddeviation.asp

function to find 'k' closest elements :
techiedelight.com/find-k-closest-elements-to-given-value-array/

Interactive support resistance :
in.tradingview.com/script/irqbPJsI-Support-Resistance-Interactive/

Divergence for many indicators:
in.tradingview.com/script/n8AGnIZd-Divergence-for-Many-Indicators-v4/

Auto fib level by DGT:
tradingview.com/script/JLxGnBSq-Auto-Fib-Channels-by-DGT/
Komen
Trendoscope
Thanks for your efforts and contributions to the community :)
TJalam
@HeWhoMustNotBeNamed, Thank you very much :-)
Bobaleaux
I am completely new to Tradingview, it's my first day. I hate to ask a stupid question but, what am i doing wrong if this doesn't add to my chart?
TJalam
@Bob7027, Hi, you have to just search for the indicator name in the indicator search box , then select 6 levels on the chart (click on chart at least 6 times) . You will be able to see the important zones of your selected levels (zones with minimum standard deviation of the nearest confluences)
Bobaleaux
@BADSHAH.E.Alam, Thank you
TJalam
@Bob7027, My pleasure :-)
Da-sein
Tried to create a similar indicator, Key Confluence Levels, using PD OHLC, PM L/H, Current Day O/H/L, Pivot Points and Daily SMA 5 and 10 and quickly realized it was much tougher than it appeared. My thought was to combine with a dynamic supply/demand zone indicator and then chart the zones of overlap. Not surprised it is over 1300 lines of code. Thanks for your efforts. I will need to check it out. I like the user input idea, I had never contemplated that option. I believe the killer indicator is one that charts confluences and surprised there are only a few on TV. Yours appears to be the most complete.
TJalam
@Da-sein, Much appreciated. One potential approach could involve substituting manual input levels with the dynamic supply/demand zone indicator. This could offer an alternative solution.
Da-sein
@TJalam,
Yes, that was that thought but I am not a programmer and was using ChatGPT to help (I think I lost ten years of my life in the process). Was wondering if you could quickly create a simplified version of this with just levels and not so many other bells and whistles (I do like the Divergence for Many indicators which you took from Lonesomethe Blue) . My idea was to declutter the chart by just having confluence zones with acronyms and different color shades corresponding to the number of confluences (more saturated color the more confluences). I do this manually now, but it takes time and I'd rather be trading during the open rather than drawing confluence zones. Also not quite sure I understand how the standard deviation figures into this. I had a pretty simple mathematical formula for determining confluence within a certain tolerance level. I may try simplifying it myself and adding a couple of levels I find useful that are not in yours. I basically cut and paste indicators but it doesn't always work and ChatGPT is truly useless when it comes to helping code.
TriftyTrader
Thanks for Sharing, its says i should set the S/R Lines, but i cant see any field for the inputs, can someone help me, there is only a blue button, before the indicator dont show up.
Lebih