get_symbol: Load and Manage Historical Data from Casablanca Stock...

Description Usage Arguments Value Examples

Description

Function to load and manage historical data of a Symbol listed in Casablanca Stock Exchange. Current available symbol types are "stock" and "index". For stocks, the returned object includes: Date, Open, High, Low, Close, Adjusted, Quantity, Volume, and Capitalisation. For indexes, the returned object includes: Date and Value columns.

Usage

1
get_symbol(symbol, from, to, type, format.as.xts = TRUE)

Arguments

symbol

a character vector specifying the name of the symbol to be loaded. Use listed_symbols function to get all available symbol names.

from

a character vector specifying the start date. Should be formatted according to ISO8601 ("yyyy-mm-dd")

to

a character vector specifying the end date. Should be formatted according to ISO8601 ("yyyy-mm-dd")

type

a character vector specifying the symbol type. Current supported types are "stock" and "index"

format.as.xts

a boolean value. Set to FALSE in order to return a dataframe instead of an xts object

Value

an xts object or a dataframe

Examples

1
2
3
## Not run: get_symbol('COSUMAR', '2017-01-01', '2017-12-31')
## Not run: get_symbol('COSUMAR', '2017-01-01', '2017-06-30', format.as.xts = TRUE)
## Not run: get_symbol('MASI', '2017-01-01', '2017-12-31', type = 'index')

blnash508/CSE documentation built on May 3, 2019, 11:52 p.m.