This study utilizes simple parameters, the length of the analysis period and check boxes to display only the bull vector, the bear vector, or both of them.
When the vector crosses over the zero line, the stock is in the bull side, if it reaches levels above 80% it enters to the Overbought area, which means the price can go higher until a reversal takes it below the Zero Line to the Bear side, where if it reaches -80% it is said to be at the Oversold level until a reversal or a momentum divergence pattern flags a return to the Bull side.
// Madrid : 01/Mar/2015 :12:00 : Madrid Vector : 1.0 // The vector is calculated as a ratio between (Cn-Ref)/(Hn-L1) for a given // period of time study(title="Madrid Vector", shorttitle="MVx", precision=0 ) src = close vectorLen=input(34) dispBull = input(false) dispBear = input(false) dispBullvsBear = input(true) OS = -76.4, OB = 76.4 lowerBand = 10 PI= 3.14159265358979 ssFilter( price, lowerBand ) => angle = sqrt(2)*PI/lowerBand a1= exp(-angle) b1 = 2*a1*cos(angle) c2 = b1 c3 = -a1*a1 c1 = 1 - c2 -c3 filt = c1*(price + nz(price))/2 + c2*nz(filt) + c3*nz(filt) highestRef= highest(src, vectorLen) lowestRef = lowest(src, vectorLen) // Bull Vector bullVector = (src-lowestRef)*100/(highestRef-lowestRef) ssBullVector = ssFilter(bullVector, lowerBand) bullVectorColor = change(ssBullVector)>=0?lime:green plot(dispBull?ssBullVector*2-100:na, color=bullVectorColor, linewidth=2) // Bear Vector bearVector = (highestRef-src)*100/(highestRef-lowestRef) ssBearVector = ssFilter(bearVector, lowerBand) bearVectorColor = change(ssBearVector)>=0?red:maroon plot(dispBear?ssBearVector*2-100:na, color=bearVectorColor,linewidth=2) bullVSbear = bullVector - bearVector ssBullVSBear = ssFilter(bullVSbear, lowerBand) bullVSBearHist = change(ssBullVSBear,1) plot(dispBullvsBear?ssBullVSBear:na, linewidth=2, color=bullVSBearHist>=0?green:red) top = hline(110, color=red, linestyle=dotted) bottom = hline(-110, color=lime, linestyle=dotted) obLvl = hline(OB, color=red, linestyle=dotted) hline(0, color=gray, linestyle=dotted) osLvl = hline(OS, color=lime, linestyle=dotted) fill(obLvl, top, color=red, transp=80) fill(osLvl, bottom, color=lime, transp=80)
On the other hand, look at the information the indicator provides you:
As soon as it has data to process it shows an uptrend in the bull side (Above the Zero line) it reaches a peak and starts to decrease (change of color), which means it has reached a resistance level and it's gone through a retracement. When this happens the indicator may exit the overbought area, but as long as it doesn't leave the Bull side it means this is doing a bull flag and the price will retest the resistance level.
As soon as the peak rises, you can see that the indicator doesn't reach a level higher level than the previous peak, so it means that it is entering the OB area with a negative momentum divergence, it is warning in advance that the peak it is forming can ignite a downtrend, which is confirmed by the red bar right after the peak.
You can see that the Bear vector is doing one of the patterns I show in my example, that looks like a slanted "W", when either vector does the W pattern it means you'll have a reversal.
As soon as the indicator starts to decrease you know it is very likely this is a downtrend.
You have a trend when the values of the vector are at the extremes. When the values approach zero and are around the Zero line it means indecision, It remained there for four months according to your chart and when it resumed the trend it went down, which is shown when the Bull vector crosses down the Zero and approaches the Oversold area line and the Bear vector goes to Overbought.
What the indicator tells you now is that the bull vector has remained at the Oversold level and is consolidating, there are no signs of reversal so far.
I like your indicator overall. This was the only issue I immediately found. It seems your calculation creates signals which are similar to the Stochastic, which also overreacts at the same time on the monthly chart:
Maybe if you change your formula to be similar to momentum you would not get this kind of extreme value overshoot and instead a signal which is more similar to actual price action: