RicardoSantos

[RS]Historic Average Standard Price Deviation V0

EXPERIMENTAL:
based on average cumulative price.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title='[RS]Historic Average Standard Price Deviation V0', shorttitle='HASPD', overlay=true)
tf = input(title='Timeframe to pool data:', type=string, defval='M', confirm=false)
f_casp(_deviation)=> (cum(close)+(_deviation*close)) / (n+1-_deviation)

plot(title='D +100', series=security(tickerid, tf, f_casp(100)), color=black, offset=100)
plot(title='D +90', series=security(tickerid, tf, f_casp(90)), color=black, offset=90)
plot(title='D +80', series=security(tickerid, tf, f_casp(80)), color=black, offset=80)
plot(title='D +70', series=security(tickerid, tf, f_casp(70)), color=black, offset=70)
plot(title='D +60', series=security(tickerid, tf, f_casp(60)), color=black, offset=60)
plot(title='D +50', series=security(tickerid, tf, f_casp(50)), color=black, offset=50)
plot(title='D +40', series=security(tickerid, tf, f_casp(40)), color=black, offset=40)
plot(title='D +30', series=security(tickerid, tf, f_casp(30)), color=black, offset=30)
plot(title='D +20', series=security(tickerid, tf, f_casp(20)), color=black, offset=20)
plot(title='D +10', series=security(tickerid, tf, f_casp(10)), color=black, offset=10)
plot(title='D 0', series=security(tickerid, tf, f_casp(0)), color=black, offset=0)
plot(title='D -10', series=security(tickerid, tf, f_casp(-10)), color=black, offset=10)
plot(title='D -20', series=security(tickerid, tf, f_casp(-20)), color=black, offset=20)
plot(title='D -30', series=security(tickerid, tf, f_casp(-30)), color=black, offset=30)
plot(title='D -40', series=security(tickerid, tf, f_casp(-40)), color=black, offset=40)
plot(title='D -50', series=security(tickerid, tf, f_casp(-50)), color=black, offset=50)
plot(title='D -60', series=security(tickerid, tf, f_casp(-60)), color=black, offset=60)
plot(title='D -70', series=security(tickerid, tf, f_casp(-70)), color=black, offset=70)
plot(title='D -80', series=security(tickerid, tf, f_casp(-80)), color=black, offset=80)
plot(title='D -90', series=security(tickerid, tf, f_casp(-90)), color=black, offset=90)
plot(title='D -100', series=security(tickerid, tf, f_casp(-100)), color=black, offset=100)
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Help Center Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out