@@ -52,39 +52,21 @@ def CreateAuthorization(username, password, appid):
5252## Perform Quote request
5353def RetrieveIntraday (token , appid ):
5454
55- ''''
56- ricName = raw_input('Please input Symbol: ')
57- fieldFiltering = raw_input('Subscribe all Field? (Yes|No)')
58- intradayRequestMsg = None
59- fieldsName = 'CF_LAST:CF_HIGH:CF_LOW:CF_BID:CF_ASK:CF_YIELD:CF_SOURCE:CF_SRC_PAGE:CF_LOTSIZE:CF_DATE:CF_TIME:CF_TICK:CF_NETCHNG:CF_EXCHNG:CF_VOLUME:CF_CLOSE:CF_OPEN:CF_NAME:CF_CURRENCY'
60- if fieldFiltering == 'Yes':
61- ## Request all Fields
62- intradayRequestMsg = \
63- {'RetrieveItem_Request_3': {'TrimResponse': False,
64- 'ItemRequest': [{'RequestKey': [{'Name': ricName, 'NameType': 'RIC'}], 'Scope': 'All',
65- 'ProvideChainLinks': True}]}}
66- elif fieldFiltering == 'No':
67- ## Request specific Fields
68- fieldsName = raw_input('Input interested Field Name in the following format (BID:ASK:TRDPRC_1)')
69- intradayRequestMsg = \
70- {'RetrieveItem_Request_3': {'TrimResponse': False,
71- 'ItemRequest': [{
72- 'RequestKey': [{'Name': ricName, 'NameType': 'RIC'}],
73- 'Fields': fieldsName,
74- 'Scope': 'List',
75- 'ProvideChainLinks': True,
76- }]}}
77- '''
7855 ricName = raw_input ('Please input Symbol: ' )
7956 intradayRequestMsg = None
57+ fields = ['OPEN' ,'HIGH' ,'LOW' ,'CLOSE' ,'CLOSEYIELD' ,'VOLUME' ,'BID' ,'ASK' ] #change your fields (support these 'OPEN','HIGH','LOW','CLOSE','CLOSEYIELD','VOLUME','BID','ASK' fields only)
58+ startTime = '2016-09-12T00:00:00' #change your StartTime
59+ endtime = '2016-09-19T23:59:00' #change your EndTime
8060 intradayRequestMsg = {
8161 'GetIntradayTimeSeries_Request_4' :{
82- 'Field' : [ 'OPEN' , 'HIGH' , 'LOW' , 'CLOSE' , 'CLOSEYIELD' , 'VOLUME' , 'BID' , 'ASK' ] ,
62+ 'Field' : fields ,
8363 'TrimResponse' : True ,
8464 'Symbol' : ricName ,
85- 'StartTime' :'2016-09-12T00:00:00' ,
86- 'EndTime' :'2016-09-19T23:59:00' ,
87- 'Interval' :'MINUTE'
65+ 'StartTime' :startTime ,
66+ 'EndTime' :endtime ,
67+ 'Interval' :'MINUTE' ,
68+ 'TrimResponse' : True ,
69+ 'MetaField' : ['NAME' ,'QOS' ,'CCY' ,'TZ' ,'TZOFFSET' ,'NAME_LL' ]
8870 }
8971 }
9072
0 commit comments