[R-SIG-Finance] intraday historical data
gsee000 at gmail.com
Tue Mar 12 15:04:52 CET 2013
This is extremely broad. You just want intraday data? Whose day? The
SGX provides free intraday data:
What asset class? TrueFX provides historical tick data for FX
(http://truefx.com/?page=downloads). There's a script called
download.TrueFX.R in the inst/parser directory of FinancialInstrument
that will download and parse that data.
Maybe you want stocks? Did you search the internet? I found this via
That link gives 6 sources. One of them is "stooq". They provide 5
days of 5 minute OHLC data for thousands of stocks around the world.
I once wrote a script to download and parse that data. I ran it on a
crontab for a couple weeks, then they put up a captcha. So, I guess
they don't want you downloading the data systematically -- I don't
know, I can't read Polish. If you're willing to manually download the
data at least once every 5 days, I'd be happy share my code that
Also, the methods that page gives for getting historical intraday data
from Google and Yahoo look promising if you're up to parsing it. I
think I have some scraps of code laying around somewhere where I
started working on that. Let me know if you'd like me to look.
I use Interactive Brokers for my personal intraday data needs.
They're really hard to beat since they provide a year's worth of data
for stocks, bonds, FX, options, futures, etc. for products all over
I use (a small adaptation of) twsInstrument:::update.data() to
download minutely OHLC data for BID, ASK, and TRADES, data for over
2000 stocks. Since you can only make 6 requests every minute, it
takes almost a full day to download 5 days of data. So, it runs 24
hours a day. (it's also helpful to get more than one log-in). There
is a cost for Interactive Brokers. It's about 10 or 20 bucks a month,
but if you spend that much money on commissions, they waive the fee.
I just get minutely data, because I want a lot of history for a lot of
symbols, but they also provide 1 second frequency historical data if
you are patient. Here's the reference for how much data you can get
per request (remember: 6 requests a minute)
If you're interested in realtime/near-realtime intraday data, you have
a few options.
This will give you a 15 minute delayed quote:
These will give you a real-time quote:
getQuote("SPY", src="IB") # if you have an Interactive Brokers account
getQuote("SPY", src="bats", what="bbo")
getQuote("SPY", src="bats", what="ladder")
getQuote("SPY", src="bats", what="depth")
getQuote("SPY", src="bats", what="trades")
# These come with plot methods too
I created a shiny app using the getQuote.bats stuff. If you run
qmao::shinyBATS() it will launch this shiny app:
You can wrap one of these getQuote calls in a while loop to retrieve a
"stream" of data
dat <- NULL
dat <- rbind(dat, getQuote("SPY", src="yahoo"))
(If you like shiny, here's a crude way to plot intraday data as it
comes in -- just replace the rnorm call with a getQuote call:
If you want real-time intraday fx quotes, see the TFX package
Recently, I've been excited about this new free API (requires a free
According to their forums, they're planning on rolling out historical
intraday data soon. Currently, you can get snapshots, or streaming
twsInstrument and qmao can be obtained via svn checkout from
I hope this helps, and I hope that if you write code to parse some
intraday historical data, that you share it with the list.
On Mon, Mar 11, 2013 at 6:15 PM, Bill Blount <bill at easterngrain.com> wrote:
> i just mean intraday historical quotes. any ideas where?
> On Mon, Mar 11, 2013 at 6:36 PM, Michael Weylandt <
> michael.weylandt at gmail.com> wrote:
>> What exactly do you mean by end of day intraday?
>> Regardless, I assume the answer is 'yes, many by subscription: some cheap:
>> few free.'
>> On Mar 11, 2013, at 22:26, Bill Blount <bill at easterngrain.com> wrote:
>> > is there a source for end of day intraday data (i am assuming that yahoo
>> > daily only)?
>> > Thanks. Bill
>> > [[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
> -- 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