商品期货的持仓量、仓差是要用哪个fields?


(youke) #1

如题,商品期货的交易量总手是用volume吗?持仓量是要用哪个fields?仓差又是哪个?


(iQuant) #3
克隆策略
In [14]:
df = D.history_data('RB1709.SHF', start_date='2017-05-01', end_date='2017-05-15', fields=['open','low','high','close','volume','open_intl'])
df
Out[14]:
open_intl open instrument close volume date high low
0 12684.0 3171.0 RB1709.SHF 3177.0 11502 2017-05-02 3195.0 3150.0
1 13064.0 3180.0 RB1709.SHF 3170.0 14210 2017-05-03 3195.0 3138.0
2 11038.0 3150.0 RB1709.SHF 2974.0 21270 2017-05-04 3164.0 2950.0
3 10728.0 2971.0 RB1709.SHF 2981.0 19760 2017-05-05 3005.0 2922.0
4 13518.0 2991.0 RB1709.SHF 3051.0 30484 2017-05-08 3076.0 2990.0
5 13484.0 3042.0 RB1709.SHF 3068.0 13162 2017-05-09 3086.0 3031.0
6 14092.0 3060.0 RB1709.SHF 3134.0 13702 2017-05-10 3139.0 3056.0
7 12846.0 3144.0 RB1709.SHF 3123.0 19692 2017-05-11 3164.0 3024.0
8 12478.0 3125.0 RB1709.SHF 3017.0 17274 2017-05-12 3133.0 3016.0
9 12084.0 3032.0 RB1709.SHF 3071.0 12968 2017-05-15 3109.0 2982.0
In [15]:
df.rename(columns={'open_intl':'持仓量','open':'开盘价','instrument':'标的代码','close':'收盘价','volume':'成交量','date':'日期','high':'最高价','low':'最低价'}, inplace=True)
df
Out[15]:
持仓量 开盘价 标的代码 收盘价 成交量 日期 最高价 最低价
0 12684.0 3171.0 RB1709.SHF 3177.0 11502 2017-05-02 3195.0 3150.0
1 13064.0 3180.0 RB1709.SHF 3170.0 14210 2017-05-03 3195.0 3138.0
2 11038.0 3150.0 RB1709.SHF 2974.0 21270 2017-05-04 3164.0 2950.0
3 10728.0 2971.0 RB1709.SHF 2981.0 19760 2017-05-05 3005.0 2922.0
4 13518.0 2991.0 RB1709.SHF 3051.0 30484 2017-05-08 3076.0 2990.0
5 13484.0 3042.0 RB1709.SHF 3068.0 13162 2017-05-09 3086.0 3031.0
6 14092.0 3060.0 RB1709.SHF 3134.0 13702 2017-05-10 3139.0 3056.0
7 12846.0 3144.0 RB1709.SHF 3123.0 19692 2017-05-11 3164.0 3024.0
8 12478.0 3125.0 RB1709.SHF 3017.0 17274 2017-05-12 3133.0 3016.0
9 12084.0 3032.0 RB1709.SHF 3071.0 12968 2017-05-15 3109.0 2982.0