为什么读取的业绩快报数据只到2018年三季度的?


(w890912y) #1
克隆策略
In [15]:
DataSource('mt').read(instruments=['300136.SZA'],start_date='2019-08-01',end_date='2019-08-08',fields=['trade_val','sec_vol','fin_val']).head()
Out[15]:
date instrument trade_val fin_val sec_vol
130013 2019-08-01 300136.SZA 1.724404e+09 1.715421e+09 308700.0
131660 2019-08-05 300136.SZA 1.782256e+09 1.773620e+09 310300.0
133330 2019-08-06 300136.SZA 1.811847e+09 1.795887e+09 561000.0
In [14]:
fields = ['pe_ttm_0']
start_date = '2019-08-09'
end_date = '2019-08-09'
instruments = D.instruments(start_date, end_date)
pe = D.features(instruments, start_date, end_date, fields=fields)['pe_ttm_0']
In [15]:
print('均值:',pe.mean())
print('标准差:',pe.std())
pe.describe()
均值: -153.69676208496094
标准差: 10865.6259765625
Out[15]:
count      3652.000000
mean       -153.696762
std       10865.625977
min     -650327.250000
25%          12.474411
50%          25.424008
75%          47.741865
max       26075.064453
Name: pe_ttm_0, dtype: float64
In [8]:
fields = ['pe_ttm_0']
start_date = '2017-04-21'
end_date = '2017-04-21'
instruments = D.instruments(start_date, end_date)
roe = D.features(instruments, start_date, end_date, fields=fields)['fs_roe_0']
In [ ]:
 
In [9]:
print('均值:',roe.mean())
print('标准差:',roe.std())
roe.describe()
均值: 6.318794955342129
标准差: 21.524061060590586
Out[9]:
count    2782.000000
mean        6.318795
std        21.524061
min      -190.077896
25%         1.918450
50%         5.625300
75%        10.413725
max       949.800476
Name: fs_roe_0, dtype: float64
In [17]:
pe.hist(bins = 200)
Out[17]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f6a97a78be0>
In [19]:
pe[pe >= pe.quantile(0.99)] = pe.quantile(0.99)
pe[pe <= pe.quantile(0.01)] = pe.quantile(0.01)
print('均值:',pe.mean())
print('标准差:',pe.std())
roe.hist(bins=1000)
均值: 40.43071746826172
标准差: 88.52278137207031
Out[19]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f6a86786128>
In [59]:
import pandas as pd
data = DataSource('mt').read(start_date='2019-06-01',end_date='2019-08-11').set_index(['instrument'])
data
data2 = data.loc[['600789.SHA','300033.SZA']]
data2.groupby('instrument')
Out[59]:
<pandas.core.groupby.DataFrameGroupBy object at 0x7fd99dde2550>
In [62]:
data2.reset_index(inplace=True)
data2.set_index(['date']).sort_index().tail(50)
Out[62]:
level_0 index instrument sec_refund_vol sec_net_sell_vol sec_sell_vol sec_val sec_vol fin_refund_val fin_net_buy_val fin_buy_val trade_val trade_diff_val fin_val
date
2019-07-02 64 64 300033.SZA 17900.0 1900.0 19800.0 26594878.0 266215.0 179607863.0 23284089.0 202891952.0 1.966175e+09 1.912985e+09 1.939580e+09
2019-07-02 20 20 600789.SHA 40000.0 -33500.0 6500.0 1998651.2 290080.0 34377678.0 1818627.0 36196305.0 6.358010e+08 6.318037e+08 6.338024e+08
2019-07-03 21 21 600789.SHA 96500.0 -84500.0 12000.0 1397944.0 205580.0 16594047.0 -698576.0 15895471.0 6.345017e+08 6.317058e+08 6.331038e+08
2019-07-03 65 65 300033.SZA 13900.0 1455.0 15355.0 25872982.0 267670.0 164771629.0 2795453.0 167567082.0 1.968248e+09 1.916502e+09 1.942375e+09
2019-07-04 22 22 600789.SHA 27100.0 458078.0 485178.0 4546057.3 663658.0 18755282.0 351321.0 19106603.0 6.380012e+08 6.289090e+08 6.334551e+08
2019-07-04 66 66 300033.SZA 21555.0 4545.0 26100.0 25909423.0 272215.0 146663654.0 19348639.0 166012293.0 1.987633e+09 1.935815e+09 1.961724e+09
2019-07-05 23 23 600789.SHA 528578.0 -477578.0 51000.0 1274648.0 186080.0 19870983.0 -1461212.0 18409771.0 6.332685e+08 6.307192e+08 6.319939e+08
2019-07-09 67 67 300033.SZA 22700.0 19670.0 42370.0 25484357.0 276403.0 151445750.0 -18963008.0 132482742.0 1.917299e+09 1.866330e+09 1.891815e+09
2019-07-09 24 24 600789.SHA 93820.0 -93820.0 0.0 1056456.0 157680.0 18502206.0 -7290201.0 11212005.0 6.329086e+08 6.307957e+08 6.318521e+08
2019-07-10 68 68 300033.SZA 22726.0 -4661.0 18065.0 24396997.0 271742.0 100984876.0 16949310.0 117934186.0 1.933161e+09 1.884367e+09 1.908764e+09
2019-07-10 25 25 600789.SHA 23600.0 497100.0 520700.0 4465599.6 654780.0 23100279.0 3075484.0 26175763.0 6.393932e+08 6.304620e+08 6.349276e+08
2019-07-11 69 69 300033.SZA 21365.0 6818.0 28183.0 25098256.0 278560.0 137531340.0 -23949024.0 113582316.0 1.909913e+09 1.859717e+09 1.884815e+09
2019-07-11 26 26 600789.SHA 472800.0 -472800.0 0.0 1219266.0 181980.0 15759105.0 477254.0 16236359.0 6.366241e+08 6.341856e+08 6.354049e+08
2019-07-12 27 27 600789.SHA 0.0 0.0 0.0 1210167.0 181980.0 16480600.0 -5638828.0 10841772.0 6.309762e+08 6.285559e+08 6.297660e+08
2019-07-15 28 28 600789.SHA 81900.0 -68900.0 13000.0 756505.2 113080.0 14608507.0 219784.0 14828291.0 6.307423e+08 6.292293e+08 6.299858e+08
2019-07-15 70 70 300033.SZA 28300.0 12100.0 40400.0 26593043.0 282394.0 213481113.0 -1832720.0 211648393.0 1.940749e+09 1.887563e+09 1.914156e+09
2019-07-16 71 71 300033.SZA 26300.0 -8016.0 18284.0 25533617.0 274378.0 95741805.0 -9703163.0 86038642.0 1.929986e+09 1.878919e+09 1.904453e+09
2019-07-16 29 29 600789.SHA 26000.0 513410.0 539410.0 4278926.7 626490.0 22482842.0 11757012.0 34239854.0 6.460218e+08 6.374639e+08 6.417428e+08
2019-07-17 72 72 300033.SZA 18184.0 -3884.0 14300.0 25207336.0 270494.0 183198241.0 -42112067.0 141086174.0 1.887548e+09 1.837133e+09 1.862341e+09
2019-07-17 30 30 600789.SHA 398410.0 -398410.0 0.0 1539540.0 228080.0 15513888.0 -4343218.0 11170670.0 6.389392e+08 6.358601e+08 6.373996e+08
2019-07-18 73 73 300033.SZA 23600.0 2716.0 26316.0 24802004.0 273210.0 123459052.0 -24930832.0 98528220.0 1.862212e+09 1.812608e+09 1.837410e+09
2019-07-18 31 31 600789.SHA 58500.0 370200.0 428700.0 4122149.2 598280.0 49596953.0 7301162.0 56898115.0 6.488229e+08 6.405786e+08 6.447008e+08
2019-07-19 32 32 600789.SHA 198200.0 -198200.0 0.0 2736547.2 400080.0 27088269.0 3369351.0 30457620.0 6.508067e+08 6.453336e+08 6.480701e+08
2019-07-22 74 74 300033.SZA 30100.0 -9900.0 20200.0 23873539.0 262693.0 112733128.0 -19325231.0 93407897.0 1.835968e+09 1.788221e+09 1.812094e+09
2019-07-22 33 33 600789.SHA 147000.0 -85600.0 61400.0 2037830.4 314480.0 39755210.0 -18397473.0 21357737.0 6.317105e+08 6.276348e+08 6.296727e+08
2019-07-23 75 75 300033.SZA 43400.0 -29073.0 14327.0 21483695.0 233620.0 97489628.0 -37047541.0 60442087.0 1.796530e+09 1.753563e+09 1.775047e+09
2019-07-23 34 34 600789.SHA 139400.0 -139400.0 0.0 1148524.8 175080.0 9188820.0 267337.0 9456157.0 6.310885e+08 6.287915e+08 6.299400e+08
2019-07-24 35 35 600789.SHA 25000.0 -25000.0 0.0 989027.2 150080.0 21222025.0 -5673755.0 15548270.0 6.252553e+08 6.232772e+08 6.242662e+08
2019-07-24 76 76 300033.SZA 28104.0 3296.0 31400.0 22142169.0 236916.0 129587053.0 42036795.0 171623848.0 1.839226e+09 1.794941e+09 1.817083e+09
2019-07-25 77 77 300033.SZA 25753.0 53271.0 79024.0 27277578.0 290187.0 116517338.0 -13588912.0 102928426.0 1.830772e+09 1.776217e+09 1.803495e+09
2019-07-25 36 36 600789.SHA 52000.0 99000.0 151000.0 1668836.0 249080.0 24555603.0 -8570758.0 15984845.0 6.173643e+08 6.140266e+08 6.156955e+08
2019-07-26 37 37 600789.SHA 104000.0 -91500.0 12500.0 1058937.6 157580.0 17167272.0 -2853952.0 14313320.0 6.139005e+08 6.117826e+08 6.128415e+08
2019-07-29 78 78 300033.SZA 56971.0 -48771.0 8200.0 21322957.0 234061.0 68514333.0 2242991.0 70757324.0 1.829720e+09 1.787074e+09 1.808397e+09
2019-07-29 38 38 600789.SHA 75080.0 -75080.0 0.0 546150.0 82500.0 11255501.0 948192.0 12203693.0 6.143359e+08 6.132436e+08 6.137897e+08
2019-07-30 79 79 300033.SZA 34100.0 36536.0 70636.0 24997751.0 270597.0 129453361.0 6459892.0 135913253.0 1.839854e+09 1.789859e+09 1.814856e+09
2019-07-30 39 39 600789.SHA 0.0 114000.0 114000.0 1322445.0 196500.0 13106518.0 4483585.0 17590103.0 6.195958e+08 6.169509e+08 6.182733e+08
2019-07-31 80 80 300033.SZA 71436.0 -63694.0 7742.0 18929556.0 206903.0 82947521.0 -9695758.0 73251763.0 1.824090e+09 1.786231e+09 1.805161e+09
2019-07-31 40 40 600789.SHA 45500.0 -44700.0 800.0 1003398.0 151800.0 11638521.0 -3224719.0 8413802.0 6.160520e+08 6.140452e+08 6.150486e+08
2019-08-01 81 81 300033.SZA 46241.0 -18894.0 27347.0 16980973.0 188009.0 88053540.0 -18300110.0 69753430.0 1.803842e+09 1.769880e+09 1.786861e+09
2019-08-01 41 41 600789.SHA 10800.0 -10800.0 0.0 920730.0 141000.0 11684936.0 -6048916.0 5636020.0 6.099204e+08 6.080789e+08 6.089997e+08
2019-08-02 42 42 600789.SHA 84500.0 -84500.0 0.0 360470.0 56500.0 16465967.0 -4788597.0 11677370.0 6.045715e+08 6.038506e+08 6.042111e+08
2019-08-05 43 43 600789.SHA 6500.0 -6500.0 0.0 315500.0 50000.0 9980163.0 -1128622.0 8851541.0 6.033980e+08 6.027670e+08 6.030825e+08
2019-08-05 82 82 300033.SZA 20800.0 12700.0 33500.0 14093828.0 169153.0 142716326.0 -28475051.0 114241275.0 1.720135e+09 1.691948e+09 1.706042e+09
2019-08-06 44 44 600789.SHA 0.0 221470.0 221470.0 1650537.6 271470.0 20305175.0 -4559343.0 15745832.0 6.001736e+08 5.968726e+08 5.985231e+08
2019-08-06 83 83 300033.SZA 42169.0 43568.0 85737.0 17019807.0 212721.0 195037215.0 9000644.0 204037859.0 1.732062e+09 1.698022e+09 1.715042e+09
2019-08-07 45 45 600789.SHA 168970.0 -168970.0 0.0 616025.0 102500.0 12045626.0 -5333598.0 6712028.0 5.938055e+08 5.925735e+08 5.931895e+08
2019-08-07 84 84 300033.SZA 52821.0 -36322.0 16499.0 13739718.0 176399.0 92931675.0 -23773289.0 69158386.0 1.705009e+09 1.677529e+09 1.691269e+09
2019-08-08 46 46 600789.SHA 33000.0 479010.0 512010.0 3564656.3 581510.0 10332509.0 686883.0 11019392.0 5.974411e+08 5.903117e+08 5.938764e+08
2019-08-08 85 85 300033.SZA 31700.0 13483.0 45183.0 15010172.0 189882.0 198393576.0 -97124330.0 101269246.0 1.609155e+09 1.579134e+09 1.594145e+09
2019-08-09 47 47 600789.SHA 452010.0 -452010.0 0.0 783475.0 129500.0 8904659.0 -2041919.0 6862740.0 5.926180e+08 5.910510e+08 5.918345e+08
In [58]:
DataSource('mt').read(start_date='2019-07-01').set_index('date').head()
Out[58]:
sec_refund_vol sec_net_sell_vol sec_sell_vol sec_val sec_vol fin_refund_val fin_net_buy_val fin_buy_val trade_val trade_diff_val fin_val instrument
date
2019-07-01 9600.0 7400.0 17000.0 4.519570e+05 57869.0 74868149.0 55733677.0 1.306018e+08 5.166741e+08 5.157702e+08 5.162222e+08 002099.SZA
2019-07-01 12900.0 5900.0 18800.0 4.193242e+08 406377.0 869780439.0 196499305.0 1.066280e+09 7.600831e+09 6.762183e+09 7.181507e+09 600519.SHA
2019-07-01 38012400.0 -8605500.0 29406900.0 4.230226e+08 140073717.0 197518787.0 158535492.0 3.560543e+08 1.476506e+10 1.391902e+10 1.434204e+10 510050.OFA
2019-07-01 30800.0 268700.0 299500.0 7.094320e+06 499600.0 200814654.0 1974519.0 2.027892e+08 2.923359e+09 2.909170e+09 2.916265e+09 000776.SZA
2019-07-01 19500.0 8200.0 27700.0 2.468078e+06 143160.0 145986874.0 57603491.0 2.035904e+08 2.298787e+09 2.293851e+09 2.296319e+09 600487.SHA
In [ ]:
 
In [ ]:
 

(iQuant) #2

收到,我们这边来检查一下哈。