futcontrol: Function for Futures Data Format Options

Description Usage Arguments Value Note Author(s) References

Description

This function enables the control of various aspects of the way futures data is formatted and manipulated before being returned to the user.

Usage

1
2
3
4
5
6
futcontrol(IncludeSaturdays = FALSE, IncludeHolidays = FALSE, DetrendMethod = 0,
FillInCashPrice = FALSE, ApplyCommodityAdjustments = TRUE, UseAlternateBackAdjuster = TRUE,
RaiseNegBackAdjustSeries = FALSE, NumDaysConfirmation = 2, CloseOutOfRangeAdjustmentMethod = 0,
RoundToTick = FALSE, UseTradeableTick = TRUE, OnHolidaysUsePreviousData = FALSE, 
OnHolidaysUseCloseOnly = FALSE, AggregateVolAs = 3, AggregateOiAs = 3, AggregateCashAs = 3, 
AggregateDateAsLastRecord = 1, AggregateDayOfWeekAs = 6)

Arguments

IncludeSaturdays

Controls whether to include Saturday data where available.

IncludeHolidays

If IncludeHolidays is set to FALSE, then all data records reflect actual trading. If it is set to TRUE, then weekdays on which there is not a record, inclusive of the date range of the result set, are recorded with a day of week value of 8 and no price information

DetrendMethod

Controls whether to detrend data being retrieved. Valid value are -1 (Detrend By Second Contract), 0 (Not Detrended) or 1 (Detrend by Second Day).

FillInCashPrice

Controls whether a second pass through the database should be done to determine a cash price for each retrieved data day.

ApplyCommodityAdjustments

Controls whether to apply commodity adjustments (for unit of contract specification changes).

UseAlternateBackAdjuster

Controls whether UA uses the standard or alternate back adjusters.

RaiseNegBackAdjustSeries

Controls whether UA automatically adds the smallest number of thousands of points to bring the back adjuster series into the non-negative domain.

NumDaysConfirmation

Unless an explicit date roll is requested, this parameter controls how many consecutive volume and/or open interest roll signals are required before the algorithm rolls.

CloseOutOfRangeAdjustmentMethod

Controls whether to adjust the close, high, or low to make them consistent when a series settles outside of the daily range. Valid values are 0 (LeaveAlone), 1 (CompromiseHighLow) or 2 (CompromiseClose).

RoundToTick

Controls whether to round values to the nearest tick.

UseTradeableTick

If the Tradeable Tick is set, then the numbers are rounded to the nearest tradeable tick (.1), otherwise the close is rounded to .05 while the open, high, and low are round to 0.1 .

OnHolidaysUsePreviousData

On holidays (non trading weekdays), records last valid price data into that date. Must have IncludeHolidays set to TRUE for this option to be useful.

OnHolidaysUseCloseOnly

In combination with IncludeHolidays, sets the price values to the previous close and the volumes to zero.

AggregateVolAs

Controls how volume is aggregated when choosing frequency. Valid values are 0 (As Largest), 1 (As Smallest), 2 (As Average), 3 (As Last) or 4 (As Total).

AggregateOiAs

Controls how Open Interest is aggregated when choosing frequency. Valid values are 0 (As Largest), 1 (As Smallest), 2 (As Average), 3 (As Last) or 4 (As Total).

AggregateCashAs

Controls how Cash is aggregated when choosing frequency. Valid values are 0 (As Largest), 1 (As Smallest), 2 (As Average) or 3 (As Last).

AggregateDateAsLastRecord

.

AggregateDayOfWeekAs

Controls on which day of the week to aggregate data. Valid values are 1 (Sunday), 2 (Monday), 3 (Tuesday), 4 (Wednesday), 5 (Thursday), 6 (Friday) or 7 (Saturday).

Value

Returns a list with the above items which is passed to the database when requesting data.

Note

Detrend
Detrending a Nearest Futures Contract has no useful purpose. Detending takes two prices, the first close (of the earliest date) in the series and a pivot price. The pivot price may either be the close of the last day for the second-to-the-last contract or the close of the second-to-the-last day on file. All days within the range have an amount added so that afterward the first close in the series matches the pivot price.

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.