[R-SIG-Finance] error in yang.zhang volatility{TTR}

J Toll jctoll at gmail.com
Wed May 30 17:16:39 CEST 2012


On Tue, May 29, 2012 at 10:08 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
>> Sorry, to get that to work, it should actually be:
>>
>>        s2o <- N * runVar(log(OHLC[, 1] / Cl1), n = n)
>>        s2c <- N * runVar(log(OHLC[, 4] / OHLC[, 1]), n = n)
>>
>> It needs to be "n = n", otherwise runVar confuses n for y.
>>
> Thank you for another very helpful patch.  From looking at the svn
> log, it looks like I got more things wrong than right with this
> calculation. :)
>
> I also added the ability for users to specify alpha via '...' (the
> default value is 1.34).
>
> Best,
> --
> Joshua Ulrich  |  FOSS Trading: www.fosstrading.com


Joshua,

Thanks for taking a look at that.  I know you were joking about
getting "more things wrong than right", but I think I partially melted
my brain thinking through the vectorization.  One stand-alone
calculation may be fairly easy, but then vectorizing the whole thing
can be tricky.

I think the patches all look good on r-forge.  Thanks again.

Best,

James



More information about the R-SIG-Finance mailing list