Provided with futures contract front or equity price data from Bloomberg retrieved with pullit, construct momentum factor. The momentum factor sorts on prior asset returns and is popular in the equity (Carhart 1997; Fama and French 2012) as well as commodity futures (Miffre and Rallis 2007) asset pricing literature.

momentum_factor(
  data,
  update_frequency = "week",
  return_frequency = "day",
  ranking_period = 4L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F,
  risk_adjusted = F
)

# S4 method for FuturesTS
momentum_factor(
  data,
  update_frequency = "week",
  return_frequency = "day",
  ranking_period = 4L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F,
  risk_adjusted = F
)

# S4 method for EquityMarket
momentum_factor(
  data,
  update_frequency = "week",
  return_frequency = "day",
  ranking_period = 4L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F,
  risk_adjusted = F
)

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.

update_frequency

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

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'.

ranking_period

a scalar integer vector. Specifies number of periods in term of update_frequency looking backward for average price return calculation. Defaults to 1 where sort is done on last observed return.

long_threshold

a scalar numeric vector. Specifies the threshold for short positions. Default: 0.5.

short_threshold

a scalar numeric vector. Specifies the threshold for long positions. Default: 0.5.

weighted

a scalar logical vector. If 'TRUE' adjusts portoflio weights with respect to sorting variable values, else equal weights are used. Defaults to 'FALSE'.

risk_adjusted

a scalar logical vector. If 'TRUE' returns a reward/risk mometum factor, else returns a classic momentum factor. Defaults to 'FALSE'.

Value

An S4 object of class MomentumFactor.

References

Carhart MM (1997). “On persistence in mutual fund performance.” The Journal of finance, 52(1), 57--82. doi: 10.1111/j.1540-6261.1997.tb03808.x , https://doi.org/10.1111/j.1540-6261.1997.tb03808.x.

Fama EF, French KR (2012). “Size, value, and momentum in international stock returns.” Journal of financial economics, 105(3), 457--472. doi: 10.1016/j.jfineco.2012.05.011 , https://doi.org/10.1016/j.jfineco.2012.05.011.

Miffre J, Rallis G (2007). “Momentum strategies in commodity futures markets.” Journal of Banking \& Finance, 31(6), 1863--1886. doi: 10.1016/j.jbankfin.2006.12.005 , https://doi.org/10.1016/j.jbankfin.2006.12.005.