stkcontrol: Function for Stock Data Format Options

Description Usage Arguments Value Note Author(s) References

Description

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

Usage

1
2
3
4
5
6
stkcontrol(IncludeSaturdays = FALSE, IncludeHolidays = FALSE, DetrendMethod = 0,
ApplyStockSplitAdjustments = TRUE, ApplyStockDividendAdjustments = TRUE, PropStockAdjustments = FALSE,
PropStockVolumeAdjustments = FALSE, CloseOutOfRangeAdjustmentMethod = 0, RoundToTick = FALSE, 
UseTradeableTick = TRUE, CoverMutualFundHigh = TRUE, OnHolidaysUsePreviousData = 0, 
OnHolidaysUseCloseOnly = 0, 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).

ApplyStockSplitAdjustments

Controls whether to apply stock split adjustments.

ApplyStockDividendAdjustments

Controls whether to apply dividend and capital gains adjustments.

PropStockAdjustments

Controls whether to have stock price dividends and capital gains adjusted proportionally rather than additively.Slows processing.

PropStockVolumeAdjustments

Controls whether the volume should be proportionally adjusted for dividends and capital gains.Must have PropStockAdjustments set to TRUE for this to have any affect.

CoverMutualFundHigh

controls whether to automatically copy the close value of a mutual fund to the high value (high value is equal to NAV + Load). This hides fund loading information.

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.