Description Usage Arguments Details Value
Consecutive tow days' discount rate will be compared and returned the result.
1 2 | zslTwoDayDiff(date, ch, changed.only = FALSE, scale = 0,
mark.label = NULL)
|
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 |
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
.
The compared result data.frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.