OPEN-SOURCE SCRIPT
Standard Deviation Volatility Indicator

Standard Deviation Volatility Indicator
This indicator is constructed using the logarithmic returns of a price series and computing its standard deviation to estimate volatility. It then uses this volatility estimate to produce levels above and below the current price. It concludes by calculating the stochastic value based on these volatility levels.
Settings and Inputs:
SD Settings:
Standard Deviation Source: Defines the price series for which volatility is being calculated, default is the closing price.
Standard Deviation Period: A factor used to adjust the standard deviation.
Standard Deviation Length: Defines the number of periods over which the standard deviation is calculated.
Enable Smoothing?: Option to activate a smoothing function for the final output of the indicator.
MA Smoothing Length: Defines the number of periods for the moving average used to smooth the final output.
Indicator Logic:
Logarithmic Returns: Calculates the natural logarithm of the ratio of consecutive price values to determine returns.
Standard Deviation: Computes the standard deviation of these returns over a specified length n.
Historical Volatility (Hv): Uses the previously computed standard deviation as a proxy for historical volatility.
Levels Calculation: Uses the historical volatility to derive multiple levels above (SD1, SD2, SD3) and below (SD1_, SD2_, SD3_) the current price. An average for both sets of levels is then computed (SDM and SDM_).
Stochastic Value: The indicator calculates a stochastic value using the third level of the above and below computed values (SD3 and SD3_).
Smoothing: If smoothing is enabled, the stochastic value is smoothed using an exponential moving average of a specified length.
Output:
If the smoothing option is selected, the final output is the smoothed stochastic value.
Otherwise, the raw stochastic value is given.
This indicator is constructed using the logarithmic returns of a price series and computing its standard deviation to estimate volatility. It then uses this volatility estimate to produce levels above and below the current price. It concludes by calculating the stochastic value based on these volatility levels.
Settings and Inputs:
SD Settings:
Standard Deviation Source: Defines the price series for which volatility is being calculated, default is the closing price.
Standard Deviation Period: A factor used to adjust the standard deviation.
Standard Deviation Length: Defines the number of periods over which the standard deviation is calculated.
Enable Smoothing?: Option to activate a smoothing function for the final output of the indicator.
MA Smoothing Length: Defines the number of periods for the moving average used to smooth the final output.
Indicator Logic:
Logarithmic Returns: Calculates the natural logarithm of the ratio of consecutive price values to determine returns.
Standard Deviation: Computes the standard deviation of these returns over a specified length n.
Historical Volatility (Hv): Uses the previously computed standard deviation as a proxy for historical volatility.
Levels Calculation: Uses the historical volatility to derive multiple levels above (SD1, SD2, SD3) and below (SD1_, SD2_, SD3_) the current price. An average for both sets of levels is then computed (SDM and SDM_).
Stochastic Value: The indicator calculates a stochastic value using the third level of the above and below computed values (SD3 and SD3_).
Smoothing: If smoothing is enabled, the stochastic value is smoothed using an exponential moving average of a specified length.
Output:
If the smoothing option is selected, the final output is the smoothed stochastic value.
Otherwise, the raw stochastic value is given.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน