1. DataStruct 增加add_funcx 函数, 用于apply一些单索引的(single Index)的函数
python
data= QA.QA_fetch_future_min('RBL8','2019-01-01','2019-07-01','15min')
def myfunc(x):
return x.resample('30min').apply(............)
data.add_funcx(myfunc)
2. 优化期货的resample_min 重采样函数
> 函数原型: QA.QAData.data_resample.QA_data_futuremin_resample
QA_data_futuremin_resample(data, type_='30min', exchange_id=QA.EXCHANGE_ID.SHFE)
> 快速使用: QADataStruct.resample
python
data= QA.QA_fetch_future_min('RBL8','2019-01-01','2019-07-01','15min')
data.resample('30min')
或者
data.min30
多品种
data = QA.QA_fetch_future_min_adv(['RBL8','JL8'],'2018-01-01','2019-07-30','5min')
data.min30
速度大概在 5万个bar 20ms
python
In [2]: import QUANTAXIS as QA
In [3]: data = QA.QA_fetch_future_min_adv(['RBL8','JL8'],'2018-01-01','2019-07-30','5min')
In [4]: %timeit -n 1 -r 1 data.min30