OI_aggregate_factor-methods: Construct futures open interest growth (OI) aggregate factor

Description Usage Arguments Value References

Description

Provided with futures contract front price and aggregate open interest data from Bloomberg retrieved with pullit, construct aggregate open interest growth (OI) factor. The open interest factor relates to futures market liquidity and is popular in the literature, in particular in the context of commodity markets research \insertCitehong_what_2012factorem. The aggregate open interest factor \insertCitebasu_financiallization_2018factorem is concerned with liquidity over the whole futures term strucutre and sorts on open interest aggregated (summed up) over the futures term structure.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
OI_aggregate_factor(
  price_data,
  aggregate_data,
  update_frequency = "month",
  return_frequency = "day",
  ranking_period = 1L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F
)

## S4 method for signature 'FuturesTS,FuturesAggregate'
OI_aggregate_factor(
  price_data,
  aggregate_data,
  update_frequency = "month",
  return_frequency = "day",
  ranking_period = 1L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F
)

Arguments

price_data

an S4 object of class FuturesTS. FuturesTS objects are returned by the BBG_futures_TS function from the pullit package.

aggregate_data

an S4 object of class FuturesAggregate. FuturesAggregate objects are returned by the BBG_futures_aggregate function from the pullit package.

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 aggregate open interest average growth calculation. Defaults to 1 where sort is done on last observation only.

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

Value

An S4 object of class OIFactor.

References

\insertAllCited
bautheac/factorem documentation built on June 7, 2021, 12:11 p.m.