Provided with futures contract front or equity price data from Bloomberg retrieved with pullit, construct market factor.

market_factor(data, return_frequency = "month", long = T)

# S4 method for FuturesTS
market_factor(data, return_frequency = "month", long = T)

# S4 method for EquityMarket
market_factor(data, return_frequency = "month", long = T)

Arguments

data

an S4 object of class FuturesTS or EquityMarket. FuturesTS and EquityMarket objects are returned by the BBG_futures_TS and BBG_equity_market functions from the pullit package respectively.

return_frequency

a scalar character vector. Specifies the frequency of the returns output. Must be one of 'year', 'semester', 'quarter', 'month', 'week' or 'day'. Defaults to 'day'.

long

a scalar logical vector. If TRUE long only, else short only. Default: TRUE.

Value

An S4 object of class AssetPricingFactor.