def get_data(self, code, start, end): self.code = code try: self.data = QA_DataStruct_Stock_transaction( QA_fetch_get_stock_transaction(code, start, end)) return self.data except Exception as e: raise e
def __saving_work(code): QA_util_log_info( '##JOB10 Now Saving STOCK_TRANSACTION ==== %s' % (str(code))) try: coll.insert_many( QA_util_to_json_from_pandas( QA_fetch_get_stock_transaction(str(code), str(stock_list[code]), str(now_time())[0:10]))) except: err.append(str(code))
def __saving_work(code): QA_util_log_info( '##JOB11 Now Saving STOCK_TRANSACTION ==== {}'.format(str(code)), ui_log=ui_log) try: coll.insert_many( QA_util_to_json_from_pandas( # 🛠todo str(stock_list[code]) 参数不对? QA_fetch_get_stock_transaction(str(code), '1990-01-01', str(now_time())[0:10]))) except: err.append(str(code))
data = QA.QA_fetch_stock_min('000001','2018-01-01','2019-01-01','pd') data['2019-06-26 09:25:00':'2019-06-26 09:30:00']['volume'].sum() #%% start = '2017-06-15' end = '2017-06-27' freq = '30min' from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_min,QA_fetch_get_stock_transaction data = QA_fetch_get_stock_min('000002',start,end,freq,True,True) data1 = QA_fetch_get_stock_min('000002',start,end,freq) #data2 = QA_fetch_get_stock_transaction('000002','2018-12-26','2019-02-15 13:02:00','1min') from QUANTAXIS.QAData.data_resample import QA_data_min_resample_stock,QA_data_stocktick_resample_1min,QA_data_min_resample data1 = QA_data_stocktick_resample_1min(QA_fetch_get_stock_transaction('000002',start,end)) data3 = QA_data_min_resample_stock(data1,freq) data3 = QA_data_min_resample(data1,freq) data1[['datetime','code']] #%% data = QA.QAFetch.QATdx.QA_fetch_get_stock_transaction('000001','2015-06-05','2015-06-06') data.index = pd.to_datetime(data.index) type(data.index[0])('2019-01-01') #%% data = QA.QAFetch.QATdx.QA_fetch_get_future_list() data['signal'] = data['code'].apply(lambda x:x[-2:]) data[data['signal'].isin(['L8','L9'])] 1300/8200