I’m not sure if it is a significant enough new version for a new library post so I will just post it here and add a link to the original indicators comments (unless Nicolas thinks it should be in the library?)
This new version allows you to plot the support and resistance lines (and averages of them) that are based on the last three high and last three low points on to an indicator rather than onto price. Just change the indicator in line 18 to the indicator of your choice. In the example here it is a fast average of RSI but if you want a different indicator then change it to MyIndicator = Stochastic[5,10] for example.
Breakout of support and resistance lines by an indicator can indicate a change of direction or the start of a new trend. The slope of the lines can be used to spot divergence between an indicator and price. Hopefully this new version of my indicator will be useful to someone.
RETURNnexthi12coloured(0,128,0,cr12)style(line,1)as"Resistance12",nextlo12coloured(128,0,0,cs12)style(line,1)as"Support12",nexthi13coloured(0,128,0,cr13)style(line,1)as"Resistance13",nextlo13coloured(128,0,0,cs13)style(line,1)as"Support13",nexthi23coloured(0,128,0,cr23)style(line,1)as"Resistance23",nextlo23coloured(128,0,0,cs23)style(line,1)as"Support23",nexthiave3coloured(0,128,0,crave3)style(line,1)as"Resistance Average 1-2-3",nextloave3coloured(128,0,0,csave3)style(line,1)as"Support Average 1-2-3",nexthiave2coloured(0,128,0,crave2)style(line,1)as"Resistance Average 1-2",nextloave2coloured(128,0,0,csave2)style(line,1)as"Support Average 1-2",ave123midcoloured(0,0,255,cave3mid)style(line,1)as"Average Mid 1-2-3",ave12midcoloured(0,0,255,cave2mid)style(line,1)as"Average Mid 1-2",MyIndicatorstyle(line,2)as"My Indicator"
Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.