Volatility Support Resistance Indicator
Forums › ProRealTime English forum › ProBuilder support › Volatility Support Resistance Indicator
- This topic has 16 replies, 7 voices, and was last updated 5 years ago by robertogozzi.
-
-
01/09/2018 at 2:43 PM #58619
Hello everyone here Ivan Donatiello,
I am studying Kirk Northington’s book “Volatility-Based Technical Analysis: Strategies for Trading the Invisible” 2009 USA.
I am intrigued about an indicator called N Bande, but the code is the owner of MetaStock.
However I created a variant that gives me good triggers using the Bollinger Bands. The indicator I want to create must do the following.
1. Create a horizontal line when today’s Bollinger + is lower than yesterday’s bolligenger +.
2. Create 3 liene that have the value of the 10-period ATR, subtracting from the value of point 1.The exact opposite for Bollinger -.
Each time a new condition is created, as in point 1, the line must be updated, while keeping the old values on the graph history. It should appear a broken leena the most important values are the most recent.
Below is an image to start with.
Thank you all
01/09/2018 at 2:58 PM #58622Remind me these topics:
https://www.prorealcode.com/topic/newbie-coding-request-bb-sr/
https://www.prorealcode.com/topic/bands-n-metastock/
Your version/interpretation of this indicator is easier to code.
So, each time the condition 1 is met, we update the whole lines calculation? right?
01/09/2018 at 3:10 PM #58627Yes Nicolas, whenever the condition occurs 1, we update the R1. The same thing for the S1 for the Bolloger –
Study the topics that you have link to me 🙂
01/09/2018 at 3:41 PM #58634Ok, so this is the indicator that plot the upper and lower bollinger bands as support/resistance lines when they quit the expansion phase (phase 2). Other lines are calculated with an ATR 10 periods. Sometimes lines are overlapping and it is a bit confusing IMO.
123456789101112131415161718192021//https://www.prorealcode.com/topic/volatility-support-resistance-indicator///Nicolas @ prorealcode.comupper = BollingerUp[20](close)lower = BollingerDown[20](close)atr = averagetruerange[10]if upper<upper[1] and upper[1]>upper[2] thenr1 = upperrr2 = upper - atrr3 = upper - 2*atrr4 = upper - 3*atrendifif lower>lower[1] and lower[1]<lower[2] thens1 = lowers2 = lower + atrs3 = lower + 2*atrs4 = lower + 3*atrendifreturn r1 coloured(200,200,0) style(line,2) as "r1", rr2 coloured(100,100,100) style(dottedline,1) as "r2", r3 coloured(100,100,100) style(dottedline,1) as "r3", r4 coloured(100,100,100) style(dottedline,1) as "r4", s1 coloured(200,200,0) style(line,2) as "s1", s2 coloured(100,100,100) style(dottedline,1) as "s2", s3 coloured(100,100,100) style(dottedline,1) as "s3", s4 coloured(100,100,100) style(dottedline,1) as "s4"01/09/2018 at 4:46 PM #58688Thanks Nicolas 🙂
Then the indicator worked well but it gave a delay period. In addition, the Bollinger caused the price to go out of the volatility bands too often, so I tried using bands built by linear regression. It seems that they work well. Below are the two codes and the screeshot.
Bands of volatility equal to the bollinger but with the measure of central tendency linear regression:
Linear Regression Band - Similar on Bollinger Band12345678910111213//https://www.prorealcode.com/topic/volatility-support-resistance-indicator///Ivan @ prorealcode.comperiod=10x1=LinearRegression[period](close)x2=2.5*STD[20](close)h1=x1+x2h2=x1-x2return h1,h2, x1Indicator of Nicolas with the correction of the delay period:
volatility-support-resistance-indicator123456789101112131415161718192021222324//https://www.prorealcode.com/topic/volatility-support-resistance-indicator///Nicolas @ prorealcode.comupper = LinearRegression[10](close)+2.5*std[20](close)lower = LinearRegression[10](close)-2.5*std[20](close)atr = averagetruerange[40]if upper<upper[1] and upper[1]>upper[2] thenr1 = upper[1]rr2 = upper[1] - atrr3 = upper[1] - 2*atrr4 = upper[1] - 3*atrendifif lower>lower[1] and lower[1]<lower[2] thens1 = lower[1]s2 = lower[1] + atrs3 = lower[1] + 2*atrs4 = lower[1] + 3*atrendifreturn r1 coloured(200,200,0) style(line,2) as "r1", rr2 coloured(100,100,100) style(dottedline,1) as "r2", r3 coloured(100,100,100) style(dottedline,1) as "r3", r4 coloured(100,100,100) style(dottedline,1) as "r4", s1 coloured(200,200,0) style(line,2) as "s1", s2 coloured(100,100,100) style(dottedline,1) as "s2", s3 coloured(100,100,100) style(dottedline,1) as "s3", s4 coloured(100,100,100) style(dottedline,1) as "s4"It would be nice to combine in a single indicator, but even so it’s more than good 🙂
Below is the screenshot. Note I put the invisible central blind.
Thanks Nicolas 🙂
01/09/2018 at 5:36 PM #58702Change the last line of your indicator by this one and you’ll have an “all-in-one” indi.
1return r1 coloured(200,200,0) style(line,2) as "r1", rr2 coloured(100,100,100) style(dottedline,1) as "r2", r3 coloured(100,100,100) style(dottedline,1) as "r3", r4 coloured(100,100,100) style(dottedline,1) as "r4", s1 coloured(200,200,0) style(line,2) as "s1", s2 coloured(100,100,100) style(dottedline,1) as "s2", s3 coloured(100,100,100) style(dottedline,1) as "s3", s4 coloured(100,100,100) style(dottedline,1) as "s4", upper, lower01/09/2018 at 6:31 PM #58718Non ho capito come fare ad unire i due indicatori, potete riscriverlo voi il codice finale?
01/09/2018 at 9:21 PM #58747This is my final version. I made some changes because I saw that volatility changes affect both the compressions and the expansions.
So the inidator treats supports and resistance on the expansion returns, in the same way supports and resistance on the beginning of volatility expansion.
It would be nice to be able to put the names to the supports and resistors, example above or to finaco to the line S1, S2, R1, R2 etc. but I do not know how to do it 🙂
Final Versione Whitout the text (S1,R1 ecc)1234567891011121314151617181920212223242526272829303132333435363738394041424344//https://www.prorealcode.com/topic/volatility-support-resistance-indicator///Nicolas @ prorealcode.comupper = LinearRegression[10](close)+2.5*std[20](close)lower = LinearRegression[10](close)-2.5*std[20](close)atr = averagetruerange[40]if upper<upper[1] and upper[1]>upper[2] thenr1 = upper[1]rr2 = upper[1] - atrendifif lower>lower[1] and lower[1]<lower[2] thens1 = lower[1]s2 = lower[1] + atrendifif upper>upper[1] and upper[1]<upper[2] thenr3 = upper[1]r4 = upper[1] - atrendifif lower<lower[1] and lower[1]>lower[2] thens3 = lower[1]s4 = lower[1] + atrendifperiod=10x1=LinearRegression[period](close)x2=2.5*STD[20](close)h1=x1+x2h2=x1-x2return r1 coloured(100,100,0) style(dottedline,1) as "r1", rr2 coloured(100,100,0) style(dottedline,1) as "r2", s1 coloured(100,100,0) style(dottedline,1) as "s1", s2 coloured(100,100,0) style(dottedline,1) as "s2", r3 coloured(100,100,100) style(dottedline,1) as "r3", r4 coloured(100,100,100) style(dottedline,1) as "r4", s3 coloured(100,100,100) style(dottedline,1) as "s3", s4 coloured(100,100,100) style(dottedline,1) as "s4", h1 coloured(255,140,0) style(line,2) as "h1", h2 coloured(255,140,0) style(line,2) as "h2", x101/09/2018 at 10:11 PM #5875901/09/2018 at 10:50 PM #58761Non ho capito come fare ad unire i due indicatori, potete riscriverlo voi il codice finale?
Nel forum in lingua Inglese si prega di usare l’inglese. Grazie.
1 user thanked author for this post.
01/10/2018 at 1:58 AM #58787A question, sorry for the in-experience. But if we program an indicator that is similar to an owner, as in this case, is it a violation of copyright?
Otherwise, delete everything immediately!
01/11/2018 at 9:07 AM #58956We are absolutely not violating copyright here, and as I said your code is not near to the original version. If we can’t plot lines on a chart based on standard deviation from a mean, because someone already did it in a book, well .. a lot of codes around here should de deleted also 🙂
01/11/2018 at 6:45 PM #5909001/13/2018 at 3:05 AM #59316The strategy is based on the mathematics of volatility. One method that you find in the book of the post above, is 500 pages of stuff difficult to answer so quickly.
02/05/2019 at 4:05 PM #90523anybody knows why Trading View does not accept this script ?
-
AuthorPosts
Find exclusive trading pro-tools on