quantmod adjustOHLC 函数 - 股息调整后的价格 [英] quantmod adjustOHLC function - dividend adjusted prices

查看:33
本文介绍了quantmod adjustOHLC 函数 - 股息调整后的价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助以使用 quantmod::adjustOHLC 解释股息调整后的价格差异.

I need help in explaining a discrepancy in dividend adjusted prices using quantmod::adjustOHLC.

获取已调整和未调整的 AAPL 价格:

Get adjusted and unadjusted prices for AAPL:

library(quantmod)
getSymbols("AAPL")
AAPL.adjusted <- adjustOHLC(AAPL, adjust=c("dividend"), symbol.name="AAPL")

AAPL 的最后一次股息是在 2016 年 8 月 4 日,为 0.57 美分.

Last dividend for AAPL was on 2016-08-04 for 0.57 cents.

div <- getDividends("AAPL", from = "1900-01-01")
tail(div)
#            [,1]
# 2015-05-07 0.52
# 2015-08-06 0.52
# 2015-11-05 0.52
# 2016-02-04 0.52
# 2016-05-05 0.57
# 2016-08-04 0.57

在 2016 年 5 月 5 日至 2016 年 8 月 3 日期间,当 adjustOHLC 被要求仅针对股息进行调整时,我的预期是从这些日期的 OHLC 价格中扣除 0.57 美分.

For the period 5/5/2016 through 8/3/2016, when adjustOHLC when called to adjust only for dividends my expectation is for it to deduct 0.57 cents from OHLC prices for these dates.

但是,我在计算时没有看到 0.57 美分的确切差异未调整和调整后收盘价之间的差异.

But, I don't see an exact difference of 0.57 cents when computing differences between unadjusted and adjusted closing prices.

div <- coredata(AAPL["2016-05-05/2016-08-03"][,"AAPL.Close"] -
       AAPL.adjusted["2016-05-05/2016-08-03"][,"AAPL.Close"])
hist(div)

在绘制的直方图中,大多数价格都没有接近 0.57.

In the plotted histogram, most prices are not close to 0.57.

查看adjustOHLC的代码,计算出的调整因子为感兴趣的日期范围相同

Looking into code of adjustOHLC, computed adjustment factors are identical for the interested date range

div <- getDividends("AAPL", from = "1900-01-01")
splits <- getSplits("AAPL", from = "1900-01-01")
div <- div * 1/adjRatios(splits=merge(splits, index(div)))[, 1]
ratios <- adjRatios(splits, div, Cl(AAPL))
length(ratios["2016-05-05/2016-08-03"][, "Div"])
# [1] 63
table(ratios["2016-05-05/2016-08-03"][, "Div"])
# 0.994611967155573
#                63

为什么未调整和调整后的收盘价差异如此之大?

Why there is so much variation in differences of unadjusted and adjusted closing prices?

推荐答案

quantmod::adjustOHLC 的计算是正确的.差异在于您的假设和期望.

The calculation by quantmod::adjustOHLC is correct. The discrepancy is in your assumptions and expectations.

没有理由期望未调整和调整后的收盘价之间的差值等于股息金额,除非在除息日以及与除息日收盘价相同的任何其他日期.

There is no reason to expect the difference between unadjusted and adjusted close prices to be equal to the dividend amount, except on the ex-dividend date and any other dates with an identical close price as the ex-dividend date.

您甚至注意到,计算的调整因素对于感兴趣的日期范围是相同的"(强调).调整系数将是相同的,直到有另一个股息或拆分.调整后的收盘价是通过乘以调整因子和未调整后的收盘价来计算的.

You even note that, "computed adjustment factors are identical for the interested date range" (emphasis added). The adjustment factor will be identical until there is another dividend or split. The adjusted close is calculated by multiplying the adjustment factor and the unadjusted close price.

如果你简单地从所有先前的收盘价中减去股息金额,你会改变回报,甚至可能导致收盘价变为负数!

If you simply subtracted the dividend amount from all prior close prices, you would change the returns and it could possibly even cause the close price to become negative!

这篇关于quantmod adjustOHLC 函数 - 股息调整后的价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆