[R-SIG-Finance] data manipulation to for quantmod function

R. Michael Weylandt <michael.weylandt@gmail.com> michael.weylandt at gmail.com
Wed Jan 11 15:49:59 CET 2012


If you have tick/high(-ish) frequency data, you'll have to transform it to OHLC; there's no way to keep the frequency you have and to make an OHLC object out of it, since those metrics are by definition aggregates. The easiest way to do so is to read it in as an xts object then use one of the to.period() functions. 

Michael

On Jan 11, 2012, at 4:22 AM, julien cuisinier <j_cuisinier at hotmail.com> wrote:

> 
> Hi,
> 
> 
> Always nice to have a name on those email. 
> 
> quantmod "format" is xts format, you might try as.xts but i guess you will need to give it all the needed columns to fit the XTS object
> 
> OR use quantmod getSymbols function to download the data straight into the right format if possible
> 
> 
> HTH,
> Julien
> 
> 
> 
>> From: ktdservices01 at gmail.com
>> To: r-sig-finance at r-project.org
>> Date: Tue, 10 Jan 2012 22:30:33 -0600
>> Subject: [R-SIG-Finance] data manipulation to for quantmod function
>> 
>> I need some help with data manipulation so I can use quantmod.
>> 
>> I have a data frame with three columns: time, price, volume.  This  
>> data frame is all the trades of a product for about 15 days.  What I  
>> want to do is modify the data so that it is in a format that quantmod  
>> can read.  Quantmod needs data to be in columns: Open, High, Low,  
>> Close, and Volume.
>> 
>> I wanted to see if anyone had some suggestions to easily modify the  
>> data into the quantmod format.
>> 
>> Quantmod: http://www.quantmod.com/
>> Data (.csv, 21.67KB) can be downloaded at http://www.mediafire.com/?fyunce685ekuyo3
>>    [[alternative HTML version deleted]]
>> 
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.
>                         
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list