13

计算 VaR 的 VBA 代码和 Excel 模板

 3 years ago
source link: https://zhiqiang.org/risk-manage/var-excel-vba-code.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

计算 VaR 的 VBA 代码和 Excel 模板

作者: 张志强

, 发表于 2012-01-07

, 共 266 字 , 共阅读 467 次

系列:VaR Primer

查看该系列所有文章

这个 Excel 模板使用参数法和历史法计算资产组合的VaR,两个函数分别是 ParaVaR 和 HistVaR ,是以前写的VaR Primer的一个实现。具体使用方法可参考模板以及 VBA 的代码注释。

由于没有估值模块,该函数和模板只适用于股票和指数等价格序列。债券也可以勉强用用,会有些许误差。但不适用于期权等衍生品。

模板里的价格信息是从别的地方导出。如果想自动获取价格的话,Yahoo Finance是一个彭博和 WIND 以外的备选方案。但需要注意,它提供的股票除权信息不完整,导致在除权日的收益率不准确。

下载模板

Q. E. D.

avatar-0.jpg

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK