getEconomicCalendar: Get the Economic Calender from Briefing.com or Yahoo.

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/getCalendar.R

Description

Download the Briefing.com economic calendar either directly from the briefing.com website, or via yahoo's website, and create a data.frame containing information about previous and/or scheduled releases of economic indicators. The returned data.frame will have a Time column that contains an intraday timestamp with a time zone of America/New_York.

Usage

1
2
3
4
5
6
7
8
9

Arguments

YW

Used with getEconomicCalendarYahoo, a six character string with the first 4 characters representing the year and the last 2 characters representing the week of the year. For example, “201217” would be the 17th week of 2012.

Date

used with getEconomicCalendarBriefing, a Date for which to retrieve the Economic Calendar.

from

Date that is in the earliest week to retrieve.

to

Date that is in the last week to retrieve.

Details

.getEconomicCalendarYahoo will retrieve the Economic Calendar from Yahoo for a single week. Use this function if you need to get the economic calendar of scheduled releases (i.e. have not yet occurred). The time of day is not always correct for historic releases. Therefore, if you are getting Dates from the past, it is recommended that you use .getEconomicCalendarBriefing or getEconomicCalendarBriefing

.getEconomicCalendarBriefing will retrieve the Economic Calendar from Briefing.com for a single day. This function does not support Dates that are in the future, but is more reliable for past Dates than the data obtained via yahoo. (Briefing provides the data to yahoo, so I'm not sure why there are discrepancies.)

getEconomicCalendarYahoo is a wrapper that accepts both a from and to argument. It will use getCalendarByWeek to make repeated calls to .getEconomicCalendarYahoo allowing for the retrieval of an Economic Calendar over a much longer timespan.

for getEconomicCalendarBriefing, from and to are the first and last dates that should be included in the returned data.frame. However, for getEconomicCalendarYahoo, from and to are used to pick the first and last week to download. If from is a Date that is a Wednesday, the first data will be from previous Monday. Likewise, if to is a Date that is a Wednesday, the last data will be the Friday of that week.

getEconomicCalendar is a wrapper that will call getEconomicCalendarYahoo if any of the requested Dates occur in the future; otherwise, it will call getEconomicCalendarBriefing.

Value

a data.frame containing the economic calendar for the time period specified by YW or Date, or for all time periods between and including from and to. It will have columns:

Time

POSIXct object with America/New_York time zone

Statistic

Description of the data being released

For

non-standard character string indicating the time period over which the Statistic was measured. Could be things like Mar, 05/26, Q1, April, etc.)

Actual

Actual observed value of the Statistic

Briefing.Forecast

the value that Briefing.com predicted the Statistic to be

Market.Expects

Consensus forecast

Prior

prior reading

Note

ALPHA CODE!!! Subject to change.

Author(s)

Garrett See

References

http://biz.yahoo.com/c/e.html, http://briefing.com/investor/calendars/economic/

See Also

getEarningsCalendar, getCalendarByWeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
.getEconomicCalendarBriefing()
.getEconomicCalendarBriefing('2012-06-01')

.getEconomicCalendarYahoo()
.getEconomicCalendarYahoo(201117)
.getEconomicCalendarYahoo("201117") #same

getEconomicCalendarYahoo(from='2012-06-04', to='2012-06-10') #only goes through Friday 2012-06-08
getEconomicCalendarYahoo(from='2012-06-04', to='2012-06-11') #goes through Friday 2012-06-15

getEconomicCalendarBriefing(from='2012-06-04', to='2012-06-12') #only goes to 'to' Date

getEconomicCalendar(from=Sys.Date()-5, to=Sys.Date() - 1) #uses Briefing.com because it's Dates from past
getEconomicCalendar(from=Sys.Date(), to=Sys.Date() + 5) #uses Yahoo because it's Dates from future

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.