[R-SIG-Finance] Quotes every minute
Jeff Ryan
jeff.a.ryan at gmail.com
Thu Oct 23 19:02:08 CEST 2008
One quick note:
getQuote does _not_ return an xts object. At present that isn't
possible since the the timestamps/index values would be duplicates.
It is a data.frame. The original purpose of the function was less for
data, and more for seeing what is going on in the market without
picking my head up. :)
That said, the first column _is_ a POSIXct object.
> str(getQuote("MS")[1])
'data.frame': 1 obs. of 1 variable:
$ Trade Time: POSIXct, format: "2008-10-23 12:44:00"
It is quite extensible though. Take a look at ?yahooQF
As Brian said, there are quite a few places in recent R-sig-finance
history where you will find info on splitting POSIXct into and out of
a string.
Jeff
On Thu, Oct 23, 2008 at 11:56 AM, Brian G. Peterson <brian at braverock.com> wrote:
> Look at the documentation for the date class you are using as an index on
> the xts object. The date formats are all standard Posix style timestamps,
> and changing the format is as simple as changing the display.
>
> There have also been more than one thread on splitting the date and time
> into separate fields posted to this list in the past, so some searching
> should do the trick.
>
> - Brian
>
> SMS Chauhan wrote:
>> Ok. Let me be a little more specific. I do the following in R:
>>
>>> MS<-getQuote("MS")
>>> MS
>> Trade Time Last Change % Change Open High Low Volume
>> MS 2008-10-23 12:28:00 18.37 -0.96 -4.97% 19.21 19.75 17.6 17772846
>>> MS[1]
>> Trade Time
>> MS 2008-10-23 12:28:00
>>
>> As you can see, Trade Time comes in as a concatenated value of Date and
>> Time. Is there a possible way I could write this vector to a CSV with
>> Trade
>> Time split into different columns? Also could you please mention certain
>> functions using which I can convert this time specific for certain
>> timezones?
>>
>> TIA
>> SMS Chauhan
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list