HPotter

DAPD - Strategy

It will be buy when high above previos DAPD high and sell if low below previos DAPD low
This indicator is similar to Bollinger Bands. It based on DAPD - Daily
Average Price Delta. DAPD is based upon a summation for each of the
highs (hod) for the 21 days prior to today minus the summation for
each of the lows (lod) for the last 21 days prior to today. The result
of this calculation would then be divided by 21.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 04/07/2014
// This indicator is similar to Bollinger Bands. It based on DAPD - Daily
// Average Price Delta. DAPD is based upon a summation for each of the
// highs (hod) for the 21 days prior to today minus the summation for
// each of the lows (lod) for the last 21 days prior to today. The result
// of this calculation would then be divided by 21.
// It will be buy when high above previos DAPD high and sell if low below previos DAPD low
////////////////////////////////////////////////////////////
study(title="DAPD - Strategy", shorttitle="DAPD - Strategy", overlay = true)
Length = input(21, minval=1)
xHighSMA = sma(high, Length)
xLowSMA = sma(low, Length)        
nDAPD = xHighSMA - xLowSMA
nTop = high + nDAPD
nBottom = low - nDAPD
pos = iff(high > nTop[1], 1,
	    iff(low < nBottom[1], -1, nz(pos[1], 0))) 
barcolor(pos == -1 ? red: pos == 1 ? green : blue)
plot(nTop, color=blue, title="Top DAPD")
plot(nBottom, color=blue, title="Bottom DAPD")