UDAY_C_Santhakumar

Historical Volatility based Standard Deviation

This Plots the Standard Deviation Price Band based on the Historical Volatility. SD 1, 2, 3.

List of All my Indicators - www.tradingview.com/p/stocks/?sort=recen...

Uday C Santhakumar
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
//Created by UCSgears
//Plots Standard deviation on pricechart based on Historical Volatility. 
//This Code will be revised when Implied Volatility is available in trading view.

study(title="UCS_Standard Deviation-Historical Volatility", shorttitle="UCS_StdDev(HV)", overlay = true)

length = input(10, minval=1)
DaystoExpire = input (30, minval=1) 
stddev1=input(true,title="Standard Deviation 1")
stddev2=input(true,title="Standard Deviation 2")
stddev3=input(true,title="Standard Deviation 3")

annual = 365
per = isintraday or isdaily and interval == 1 ? 1 : 7
hv = stdev(log(close / close[1]), length) * sqrt(annual / per)
stdhv1 = close*hv*sqrt(DaystoExpire/365)
stdhv2 = stdhv1*1.3971
stdhv3 = stdhv1*1.4675

Stdhv1u = plot(stddev1 ? (close+stdhv1):na, color = red, title = "1st Standard Deviation Upperband")
Stdhv1d = plot(stddev1 ? (close-stdhv1):na, color = red, title = "1st Standard Deviation Lowerband")
Stdhv2u = plot(stddev2 ? (close+stdhv2):na, color = blue, title = "2nd Standard Deviation Upperband")
Stdhv2d = plot(stddev2 ? (close-stdhv2):na, color = blue, title = "2nd Standard Deviation Lowerband")
Stdhv3u = plot(stddev3 ? (close+stdhv3):na, color = black, title = "3rd Standard Deviation Upperband")
Stdhv3d = plot(stddev3 ? (close-stdhv3):na, color = black, title = "3rd Standard Deviation Lowerband")

fill (Stdhv1u,Stdhv3u, color = red)
fill (Stdhv1d,Stdhv3d, color = green)