backadjspec: Future for BackAdjusted Contract Specification

Description Usage Arguments Value Note Author(s) References

Description

The function creates a BackAdjusted futures contract specification which is passed onto the futureseries function for data extraction.

Usage

1
2
3
backadjspec(rollLogicType = -1, rollWhen = 1, DayOfMonthToRoll = 1, MonthsPriorToRoll = 0, 
accumulationMethod = 0, rollDeltaType = 0, valid.months = "VVVVVVVVVVVV", GenerateForward = 0,
rollNDays = 5, ProportionalAdjustment = 1)

Arguments

rollLogicType

The logic to be used in deciding when to ignore a near contract. Valid values are -1 (RollOnOpenInterest), -2 (RollOnVolume), -3 (RollOnOpenInterestOrVolume),-4 (RollOnOpenInterestAndVolume), -5 (RollOnDayRelativeToStartOfMonth) or -6 (RollOnDayRelativeToEndOfMonth).

rollWhen

Controls how the time delay between when the days prices are published and when the day's volume and open interest are published is handled (there is almost always a one-day delay). Valid values are 0 (RollWhen Reported), 1 (RollWhe Known), 2 (RollWhen Anticipated) or 3 (RollWhen Lagged2).

DayOfMonthToRoll

The day of the month to roll (31 for expiration).

MonthsPriorToRoll

The number of months before the contract month to roll (0 for expiration month).

accumulationMethod

Controls how the adjustments are to take cumulative effect. Requires ProportionalAdjustment to be TRUE (see note).

rollDeltaType

Controls which contract values are used to measure the carrying charges for which the data is being adjusted. Valid values are -1 (OpenToOpen), 0 (CloseToClose), 1 (CloseToOpen), 2 (CloseToOpenOldGap) or 3 (CloseToOpenNewGap).

valid.months

This is a string of 12 characters. Each of those characters is either an “I” for inactive, “V” for active (valid), or “S” for switching (currently low volume.) During retrieval, the condition is “V” to retrieve and not “V” to ignore. If the active months have changed historically, it is up to the users to convert “S” to “V” to build representative contracts. Of course 12 “V” (“VVVVVVVVVVVV”) retrieves every contract ever traded (see note).

GenerateForward

Controls whether to begin with the earliest data and step day-by-day to the current, or begin with the current contract and prepend earlier data.

rollNDays

Controls the rolling days before expiration (see note).

ProportionalAdjustment

Controls whether the adjustments are to take cumulative effect. Used in conjunction with accumulationMethod.

Value

Returns an object of class uaSpec

Note

accumulationMethod
Valid values are 0 (Back) and 1 (Forward). Back adds adjustments to bring historical data to the current day contract level. This option can result in negative price readings into the past (see RaiseNegBackAdjustSeries in futcontrol function). Forward subtracts adjustments to bring historical data to the earliest contract level. Because of the effects of inflation, by using this option, prices are less likely to move negative into the future.
valid.months
The user may find it useful to first call the marketprofile which returns the active months. rollNDays
The effects of this depend greatly on the GenerateForward option. If the UseAlternateBackAdjuster is FALSE then GenerateFoward will have no effect. If you are generating forward (TRUE), then the alternate back adjuster is applied. This back adjuster begins with the first day of data and steps forward backing roll decisions based on the data as it becomes available. The rollNDays argument causes a roll to happen if necessary to avoid getting too close to expiration. If you are not generating forward (FALSE), then the standard back adjuster is applied. If the rollNDays is greater than zero, then the rollLogicType is overridden so that rolls happen based only on expiration (Like a roll relative to month end).

Author(s)

Alexios Ghalanos

References

Commodity Systems Incorporated, UNFAIR ADVANTAGE API (API2) FUNCTIONAL SPECIFICATION, 2006.


RCSI documentation built on May 2, 2019, 4:50 p.m.