TS_factor-methods: Term structure factor

Description Usage Arguments Value References

Description

Provided with futures contract front price data from Bloomberg retrieved with pullit, construct term structure factor. The futures term structure factor \insertCiteszymanowska_anatomy_2014,fuertes_commodity_2015factorem is concerned with the shape (steepness) of the futures term structure and sorts on roll yield.

Usage

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

## S4 method for signature 'FuturesTS'
TS_factor(
  data,
  update_frequency = "month",
  return_frequency = "day",
  front = 1L,
  back = 2L,
  ranking_period = 1L,
  long_threshold = 0.5,
  short_threshold = 0.5,
  weighted = F
)

Arguments

data

an S4 object of class FuturesTS. FuturesTS objects are returned by the BBG_futures_TS 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'.

front

a scalar integer vector. Specifies the term structure position to use as front contract in roll yield (sort variable) calculation. Defaults to 1.

back

a scalar integer vector. Specifies the term structure position to use as back contract in roll yield (sort variable) calculation. Defaults to 2.

ranking_period

a scalar integer vector. Specifies number of periods in term of update_frequency looking backward for average roll yield 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 AssetPricingFactor.

References

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