parse_historical_csv: Parse csv file containing historical OHLCV data
Description
Helper function to parse a 'csv' file obtained from the
'PredictIt' website, containing historical 'OHLCV' (Open, High, Low, Close,
Volume) data, into an object of class xts.
Usage
parse_historical_csv(csv_path, filename = NA)
Value
A named list containing the following elements:
data
An S3 object of class xts. Time series
containing the 'close' price data for the contract provided.
contract
A character representing the contract
name, derived from the input file name. If a filename argument is
provided, the contract name will be assigned to that value.
Arguments
csv_path
Path to a 'csv' file containing historical 'OHLCV' data for a
specific contract. Expected format is the same schema as the 'csv' file
downloaded from the 'PredictIt' website.
filename
Optional name to give the 'csv' file when the filepath is
derived from a temporary directory.