JSterz

Realized Volatility

JSterz 已更新   
Realized / Historical Volatility
Calculates historical, i.e. realized volatility of any underlying. If frequency is not the daily, but for example 6h, 30min, weeks or months, it scales the initial setting to be suitable for the different time frame.

Examples with default settings (30 day volatility, 365 days per year):

A) Frequency = Daily:
Returns 30 day historical volatility, under the assumption that there are 365 trading days in a year.

B) Frequency = 6h:
Still returns 30 day historical volatility, under the assumption that there are 365 trading days in a year. However, since 6h granularity fits 4 times in 24 hours, it rescales the look back period to rather 30*4 = 120 units to still reflect 30 day historical volatility.
版本注释:
- there is originally by TradingView a mean adjustment in the stdev function (normal mean adjusted std deviation), now we use absolute variance
- now it is possible to use EWMA vol, which introduces a decay factor, this reduces the weight of price jumps in the past
版本注释:
Changed color and chart
版本注释:
Implemented multiple design and default changes. In particular now it selects basis = 365 automatically if the underlying is "crypto" and else uses a basis of 255. Please let me know if you want any other changes.
版本注释:
Minor bugfix
版本注释:
Changed default plot and added a tooltop.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?