# Weight of Evidence BF

807 3
**For Stocks (requires volume data) **
The premise of this indicator is that the wisdom of many is greater than one. The idea is you can throw out most of your indicators and simply adopt the Weight of the Evidence instead.

Eight indicators and five periods combine to give forty separate readings on a stock. These are all checked against a threshold to give a pass or fail score. The total is taken and a score is given out of 100 in increments of 2.5.

Four indicators are momentum-based: EMA , RSI , PercentRank, Lower Donchian Channel
Three are price-volume based:On Balance Volume , Price Volume Trend , Accumulation/Distribution
One is volatility-based: (Simplified) Volatility Stop

I have tried to make things simple with the entered periods being applied to all indicators. For some like on balance volume its actually a look back period for comparison of values. For the volatility stop I use the 3rd period for lookback and combine with 1 to 5 times ATR.

As this is a stepped function which can react rapidly it makes sense to smooth it with something like a 3-bar EMA , which is included by default.

Play around with the periods and different bar lengths to find something you like. I actually chose the default values with daily bars in mind but it seems to work well on weeklies! If you have other preferred indicators you could edit this script and substitute your own, although it is easiest to stick with the built-in functions as I have done.

Let me know how you get on with this and good trading to all!
```//Weight of the Evidence Indicator
//by BlindFreddy
//Blog: http://blindfreddy.postagon.com
//This script gives a score out of 100 in increments of 2.5,
//based on the 5 periods entered and the following eight indicator tests:
//1.Close>=EMA(x)   2. RSI(x)>=50   3. OBV>=OBV[x periods ago]    4. PVT>=PVT[x periods ago]
//5.Percentrank(x)>=50   6.Lower donchian channel(x period) is rising
//7. Accumulation/distribution>=A/D[x periods ago]
//8. Volatility stop : Close>=Highest(L3 periods)-n.ATR where n =1,2,3,4,5
//..where x equals L1,L2,L3,L4 and L5
//Requires Volume data ! ie intended for stocks
study(title="Weight of Evidence BF", overlay = false)
l1 = input(3,'Length 1',minval=1)
l2 = input(5,'Length 2',minval=1)
l3 = input(10,'Length 3',minval=1)
l4 = input(20,'Length 4',minval=1)
l5 = input(50,'Length 5',minval=1)
ls= input(3,'Smoothing',minval=1)
src=close
//ema
w1=src>=ema(src,l1)? 1 : 0
w2=src>=ema(src,l2)? 1 : 0
w3=src>=ema(src,l3)? 1 : 0
w4=src>=ema(src,l4)? 1 : 0
w5=src>=ema(src,l5)? 1 : 0
//rsi
w6= rsi(src,l1)>=50? 1 : 0
w7= rsi(src,l2)>=50? 1 : 0
w8= rsi(src,l3)>=50? 1 : 0
w9= rsi(src,l4)>=50? 1 : 0
w10= rsi(src,l5)>=50? 1 : 0
//on balance volume
obv=src>src[1]? nz(obv[1])+volume: nz(obv[1])-volume
w11=obv>=obv[l1]?1:0
w12=obv>=obv[l2]?1:0
w13=obv>=obv[l3]?1:0
w14=obv>=obv[l4]?1:0
w15=obv>=obv[l5]?1:0
//price volume trend
pvt=volume*(src/src[1]-1)+nz(pvt[1])
w16=pvt>=pvt[l1]?1:0
w17=pvt>=pvt[l2]?1:0
w18=pvt>=pvt[l3]?1:0
w19=pvt>=pvt[l4]?1:0
w20=pvt>=pvt[l5]?1:0
//percentrank
w21=percentrank(src,l1)>=50?1:0
w22=percentrank(src,l2)>=50?1:0
w23=percentrank(src,l3)>=50?1:0
w24=percentrank(src,l4)>=50?1:0
w25=percentrank(src,l5)>=50?1:0
//lower donchian
//accumulation/distribution
w31=accdist>=accdist[l1]?1:0
w32=accdist>=accdist[l2]?1:0
w33=accdist>=accdist[l3]?1:0
w34=accdist>=accdist[l4]?1:0
w35=accdist>=accdist[l5]?1:0
//volatility stop
w36=src>highest(l3)-atr(l3)
w37=src>highest(l3)-2*atr(l3)
w38=src>highest(l3)-3*atr(l3)
w39=src>highest(l3)-4*atr(l3)
w40=src>highest(l3)-5*atr(l3)

wtot = w1+w2+w3+w4+w5+w6+w7+w8+w9+w10+w11+w12+w13+w14+w15+w16+w17+w18+w19+w20
wtotal=wtot+w21+w22+w23+w24+w25+w26+w27+w28+w29+w30+w31+w32+w33+w34+w35+w36+w37+w38+w39+w40
woe=100*wtotal/40
smwoe=ema(woe,ls)
hline(0,title='Zero', color=gray,linestyle=dotted, linewidth=1)
hline(50,title='Fifty', color=gray,linestyle=dotted, linewidth=1)
hline(100,title='Hundred', color=gray,linestyle=dotted, linewidth=1)
plot(woe,title='WoE',color=orange,style=columns)
plot(smwoe,title='Smoothing',style=line)```
Nice!

This reminds me of Insync Index (still pending in my to-publish queue :( )..need to go through that blog link you have mentioned yet, so may be wrong.
Great addition to the library! Nice concept, very smart. Love it.
coondawg71
Thanks for the kind words coondawg. I'm not that smart or original, the concept is described in Investing with the Trend http://www.amazon.com/Investing-Trend-Rules-based-Management-Bloomberg-ebook/dp/B00HSJGMNK/ref=cm_cr_pr_product_top?ie=UTF8
The author doesn't give all the details he uses; you can construct such an indicator in an infinite variety of ways and I have merely given one of them.
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter