TSF2TSFs_byfactor: TSF2TSFs_byfactor

Description Usage Arguments Author(s) Examples

Description

split a TSF or a TSFR into TSFs or TSFRs by factor,such as size,vol...

Usage

1
2
3
TSF2TSFs_byfactor(TSF, ftype = c("size", "self", "vol", "amt", "sector",
  "indexcomp", "date", "findate"), N = 5, freq = "year",
  includeTSF = TRUE, sectorAttr = defaultSectorAttr())

Arguments

ftype

support size,trading volume,trading amount,industry,important index's component(000300.SH,000905.SH,000852.SH) and date.

N

split into N group,default value is 5.

includeTSF

whether add raw TSF to TSFs list,default value is TRUE.

Author(s)

Andrew Dow

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#####split by size into 3 group####
TSFs <- TSF2TSFs_byfactor(tsf,N=3)

#####split by itself into 3 group####
TSFs <- TSF2TSFs_byfactor(tsf,ftype='self',N=3)

#####split by trading volumn of last 20 days ####
TSFRs <- TSF2TSFs_byfactor(tsfr,ftype='vol')

#####split by sector ####
TSFRs <- TSF2TSFs_byfactor(tsfr,ftype='sector')
TSFRs <- TSF2TSFs_byfactor(tsfr,ftype='sector',sectorAttr=defaultSectorAttr('fct')) #self defined sector

#####split by date ####
TSFRs <- TSF2TSFs_byfactor(tsfr,ftype='date',freq='2 years')

raphael210/QDataGet documentation built on May 26, 2019, 11:02 p.m.