getPrices: Loads the prices data.

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

View source: R/package.r

Description

Returns the diary infomation about the prices and/or the transactioned volume of the shares.

Usage

1
2
3
getPrices(shares, info = "full")
getPrices(shares, info = "simplified")
getPrices(shares, info = "single", value = "Close", fill = NA)

Arguments

shares

The name of the shares and/or a combination of the options below:

shares, rights and receipts, real estate funds, private bonus, insolvensy (shares of the firms that in some moment between 1998 and now were in insolvency state), debentures (also in this class there are investment certificates and public debt titles), forward market, options, futures and fractionary.

Eg.: getPrices(shares = c("VALE3", "options", "futures"))

Be very careful, depending on the chosen values it could take a very long period.

info

full - returns a data.frame with the bovespa's quotation data.

simplified - returns a data.frame with the open, close, min, max, mean, bid and ask prices, transactioned volume of the day and other informations that changed between the specified shares.

single - returns a xts object with a single column specified in paramenter value.

value

only used if info = "single".

The setted argument is the "Close" column, but it can be changed at will.

fill

Some of the shares aren't negotiated every period, so this parameter set how must be treated the missing days. Notice that this paramenter will only used only if info = "single". The options are below:

last - uses the last negotiated day value to fill the gaps.

NA - fills with NAs.

drop - Drop the day out of the time serie.

Value

The function has two different outputs.

A data.frame with the share in the first collum and date as second for info setted as "full" or "simplified"

A xts with a collum (the one from value parameter) taken from the original data.frame for each share.

Author(s)

Michel Ricardo Meyer /emailmichel.ricardo.meyer@gmail.com

References

To the original information see:

Bovespa's Historical Data

See Also

getAdjPrices

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tests <- getPrices(c("PETR3", "VALE3", "WEGE3"))

# Notice that the output is a panel
head(tests)

# Lets try with info = "single"
tests <- getPrices(c("PETR3", "VALE3", "WEGE3"), info = "single")
# Now notice that the object tests is a xts and the missing values are shown as NA
head(tests)

# One more time, now with value = "Volume" and fill = "drop"
tests <- getPrices(c("PETR3", "VALE3", "WEGE3"), info = "single", value = "Volume", fill = "last")
head(tests)

MichelMeyer/package documentation built on June 4, 2020, 5:01 p.m.