cReturns(ttrTests)
cReturns()所属R语言包:ttrTests
Return series conditioned on a TTR
返回系列空调在TTR
译者:生物统计家园网 机器人LoveR
描述----------Description----------
For a series x(t) and a given TTR, computes the return series r(t) = ln( x(t+1) / x(t) ) and the conditional return series, r(t)*s(t), where s(t) is the position indicated by the TTR i.e. s(t) = 1 for long, -1 for short, 0 for neutral
对于一个序列x(t)和一个给定的TTR,计算回报率序列r(t)= LN(X(T +1)/ X(T))和有条件的回报系列,R(T)* S(T) ,其中s(t)是由TTR即(吨)= 1表示的位置为-1长,短,0用于空档
用法----------Usage----------
cReturns(x, ttr = "macd4", params = 0, burn = 0, short = FALSE,
condition = NULL, TC = 0.001)
参数----------Arguments----------
参数:x
The data set
的数据集
参数:ttr
The TTR to be used. Can be a character string for built-in TTRs, or a user defined function whose output is a position series s(t). See 'defaults' for a list of built-in TTRs.
被使用的TTR。可以是一个字符串内置的纺织商登记方案,或用户定义的函数,其输出的位置是系列S(T)。内置的TTRS的列表,请参阅“默认”。
参数:params
Used to compute the TTR. Will be passed to a user defined function. Hence a user defined function should have at least 2 inputs, the data set and a vector or list of parameters
用于计算的TTR。将被传递到用户定义的函数。因此,一个用户定义的函数应该至少有2个输入端,该数据集和一个矢量或参数列表
参数:burn
When computing the position function s(t), values for t < burn will be forced to 0, i.e. no position held during the 'burn' period
当计算的位置函数S(T),T <烧伤值将被强制为0,即没有位置期间举行的“烧钱”期
参数:short
Logical. If false the position function s(t) will be forced to 0 when it would otherwise be -1, i.e. no short selling
逻辑。如果为false的位置函数s(t)将被强制为0时,将是-1,即不允许卖空
参数:condition
An extra opportunity to restrict the TTR so that position is forced to 0 under some condition. Must be a binary string of the same length as the data 'x'. See 'position' for more details.
限制TTR一个额外的机会,所以在一定条件下,该位置被强制为0。相同的长度的数据的“x”必须是一个二进制串。有关详细信息,请参阅“位置”。
参数:TC
Trading cost, as a percentage. Used to compute an adjusted average return.
交易成本,以百分比表示。用于计算调整后的平均回报。
值----------Value----------
<table summary="R valueblock"> <tr valign="top"><td>cReturns</td> <td> The conditional returns series</td></tr> <tr valign="top"><td>aReturns</td> <td> The mean one-period return, adjusted for trading costs</td></tr> <tr valign="top"><td>lReturns</td> <td> The conditional returns only during periods when long</td></tr> <tr valign="top"><td>sReturns</td> <td> The conditional returns only during periods when short</td></tr> <tr valign="top"><td>nReturns</td> <td> The conditional returns only during periods when neutral</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>cReturns </ TD> <TD>有条件的回报系列</ TD> </ TR> <TR VALIGN =“顶部“> <TD> aReturns </ TD> <TD>的平均单期收益率,交易成本作出调整</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <TD>的条件只返回期间时长</ TD> </ TR> <tr valign="top"> <TD> lReturns</ TD> <TD>的条件期间只返回时短</ TD> </ TR> <tr valign="top"> <TD> sReturns </ TD> <TD>的条件只返回期间中性</ TD> < / TR> </ TABLE>
注意----------Note----------
EXTREMELY IMPORTANT NOTE: The functions in this package evaluate past performance only. No warranty is made that the results of these tests should, or even can, be used to inform business decisions or make predictions of future events.
非常重要的注意:这个包中的功能评估过去的表现。这些测试的结果,甚至是可以被用来通知商业决策或做出对未来事件的预测,作出任何保证。
The author does not make any claim that any results will predict future performance. No such prediction is made, directly or implied, by the outputs of these function, and any attempt to use these function for such prediction is done solely at the risk of the end user.
作者并没有提出任何申索任何结果,预测未来的表现。没有这样的预测,直接或暗示,这些函数的输出,和使用这些功能,这样的预测的任何企图仅在最终用户的风险。
(作者)----------Author(s)----------
David St John
参考文献----------References----------
William Brock, Josef Lakonishok, and Blake LeBaron. Simple technical trading rules and the stochastic properties of stock returns. The Journal of Finance, 47(5):1731-1764, 1992.
实例----------Examples----------
## Is the mean conditional return higher than the mean unconditional return?[#的平均有条件回报高于平均无条件退货的吗?]
data(spData)
mean(diff(log(spData)))
cr <- cReturns(spData)
mean(cr[[1]])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|