zslTwoDayDiff: Compare Two Days' Difference of zsl Data

Description Usage Arguments Details Value

Description

Consecutive tow days' discount rate will be compared and returned the result.

Usage

1
2
zslTwoDayDiff(date, ch, changed.only = FALSE, scale = 0,
  mark.label = NULL)

Arguments

date

the later date of compared two days, the previous day can be detected automatically

ch

RODBC connection object

changed.only

logical, default is FALSE, if TRUE "NEW" and "STOP" records will be igored in the result

scale

the scale of the change, default is 0, that's meaning it does not work, see the details

mark.label

charater, can only be ”, 'NEW' or 'STOP', used to filter the mark column, see the details

Details

The param date is the later day of compared two days, if missed, then the function will automatically find the latest two days. First, the function will query the "last day" from the database, that is the day which appears most in the lastest annoncement. Then, the function uses the trading day series to find the previous day, which is used to make the comparison.

For the comparison, the records only exist in the "old" will be marked as "STOP", and the records only exist in the "new" will be marked as "New". The records exist in two will be computed the change. The result data.frame contains only the "NEW", "STOP" and which changes are not equal to 0. Of course, "NEW" and "STOP" records can also be igored in the result with the param.

There are two params can be used to filter the result. If scale is set to a number other than 0, the records change bigger than the "scale" will be reserved, others are deleted, but this has no effect on "NEW" and "STOP" records. Pay attention, according to the convention, here we use Xbp concept which is prevailing in the bond market. For example, if scale is set to 5, meaning all the records change bigger than 0.05 see in the result data.frame. However, you see 0.05 or bigger change in the data.frame, and, of course, -0.05 or smaller, that is to say, scale is an absolute scale.

The other filtering param is mark.label. Param scale just has effect on the records other than "NEW" and "STOP", so you can filter them with mark.label.

Value

The compared result data.frame.


baixueyuan/zsl documentation built on May 11, 2019, 5:27 p.m.