diff --git a/.sln b/.sln new file mode 100644 index 000000000..08cced4d9 --- /dev/null +++ b/.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2026 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "quantaxis", "quantaxis.pyproj", "{43B2BE88-156B-4F23-B9E4-FFD299E44CBD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {43B2BE88-156B-4F23-B9E4-FFD299E44CBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43B2BE88-156B-4F23-B9E4-FFD299E44CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F87F6A44-0B74-49B7-8FF6-2CCC20E492F1} + EndGlobalSection +EndGlobal diff --git a/QUANTAXIS/QAData/QADataStruct.py b/QUANTAXIS/QAData/QADataStruct.py index 23cd31fb5..30ea8db52 100755 --- a/QUANTAXIS/QAData/QADataStruct.py +++ b/QUANTAXIS/QAData/QADataStruct.py @@ -302,6 +302,7 @@ def min60(self): class QA_DataStruct_Future_day(_quotation_base): def __init__(self, DataFrame, dtype='future_day', if_fq=''): + super().__init__(DataFrame, dtype, if_fq) self.type = 'future_day' self.data = DataFrame.loc[:, [ 'open', 'high', 'low', 'close', 'trade', 'position', 'price']] @@ -323,9 +324,10 @@ class QA_DataStruct_Future_min(_quotation_base): def __init__(self, DataFrame, dtype='future_min', if_fq=''): # 🛠todo 期货分钟数据线的维护, 暂时用日线代替分钟线 + super().__init__(DataFrame, dtype, if_fq) self.type = 'future_day' - self.data = DataFrame.loc[:, [ - 'open', 'high', 'low', 'close', 'trade', 'position', 'price']] + self.data = self.data.loc[:, [ + 'open', 'high', 'low', 'close', 'trade', 'position', 'price','tradetime']] self.if_fq = if_fq # 抽象类继承 @@ -376,6 +378,7 @@ class QA_DataStruct_Index_day(_quotation_base): '自定义的日线数据结构' def __init__(self, DataFrame, dtype='index_day', if_fq=''): + super().__init__(DataFrame, dtype, if_fq) self.data = DataFrame self.type = dtype self.if_fq = if_fq @@ -402,6 +405,7 @@ class QA_DataStruct_Index_min(_quotation_base): '自定义的分钟线数据结构' def __init__(self, DataFrame, dtype='index_min', if_fq=''): + super().__init__(DataFrame, dtype, if_fq) self.type = dtype self.if_fq = if_fq self.data = DataFrame.loc[:, [ diff --git a/QUANTAXIS/QAFetch/QAQuery.py b/QUANTAXIS/QAFetch/QAQuery.py index f677f7919..c55c55f9a 100755 --- a/QUANTAXIS/QAFetch/QAQuery.py +++ b/QUANTAXIS/QAFetch/QAQuery.py @@ -386,10 +386,10 @@ def QA_fetch_future_min( __data.append([str(item['code']), float(item['open']), float(item['high']), float( item['low']), float(item['close']), float(item['position']), float(item['price']), float(item['trade']), - item['datetime'], item['time_stamp'], item['date']]) + item['datetime'], item['tradetime'], item['time_stamp'], item['date']]) __data = DataFrame(__data, columns=[ - 'code', 'open', 'high', 'low', 'close', 'position', 'price', 'trade', 'datetime', 'time_stamp', 'date']) + 'code', 'open', 'high', 'low', 'close', 'position', 'price', 'trade', 'datetime','tradetime', 'time_stamp', 'date']) __data['datetime'] = pd.to_datetime(__data['datetime']) __data = __data.set_index('datetime', drop=False) diff --git a/QUANTAXIS/QAFetch/QAQuery_Advance.py b/QUANTAXIS/QAFetch/QAQuery_Advance.py index 3deeaa08e..ef40930ad 100755 --- a/QUANTAXIS/QAFetch/QAQuery_Advance.py +++ b/QUANTAXIS/QAFetch/QAQuery_Advance.py @@ -406,7 +406,7 @@ def QA_fetch_future_min_adv( end = start if end is None else end if len(start) == 10: - start = '{} 09:30:00'.format(start) + start = '{} 00:00:00'.format(start) if len(end) == 10: end = '{} 15:00:00'.format(end) diff --git a/QUANTAXIS/QAFetch/QATdx.py b/QUANTAXIS/QAFetch/QATdx.py index 3ac80b94c..600152224 100755 --- a/QUANTAXIS/QAFetch/QATdx.py +++ b/QUANTAXIS/QAFetch/QATdx.py @@ -1333,7 +1333,7 @@ def QA_fetch_get_future_min(code, start, end, frequence='1min', ip=None, port=No # print(data) # print(data.datetime) data = data\ - .assign(tradetime=pd.to_datetime(data['datetime']), code=str(code))\ + .assign(tradetime=data['datetime'].apply(str), code=str(code))\ .assign(datetime=pd.to_datetime(data['datetime'].apply(QA_util_future_to_realdatetime, 1)))\ .drop(['year', 'month', 'day', 'hour', 'minute'], axis=1, inplace=False)\ .assign(date=data['datetime'].apply(lambda x: str(x)[0:10]))\ diff --git a/QUANTAXIS/QASU/save_tdx.py b/QUANTAXIS/QASU/save_tdx.py index eb2c774f6..f000250c8 100755 --- a/QUANTAXIS/QASU/save_tdx.py +++ b/QUANTAXIS/QASU/save_tdx.py @@ -1073,7 +1073,7 @@ def __saving_work(code, coll): start_time = '2015-01-01' QA_util_log_info( - '##JOB13. Future min{} Now Saving Future {} from {} to {} =={} ' + '##JOB13.{} Now Saving Future {} from {} to {} =={} ' .format(['1min', '5min', '15min', '30min', '60min'] .index(type), str(code), start_time, end_time, type), ui_log=ui_log) diff --git a/quantaxis.pyproj b/quantaxis.pyproj new file mode 100644 index 000000000..53dc94ea2 --- /dev/null +++ b/quantaxis.pyproj @@ -0,0 +1,873 @@ + + + + Debug + 2.0 + {43b2be88-156b-4f23-b9e4-ffd299e44cbd} + + conf.py + + . + . + {888888a0-9f3d-457c-b088-3a5042f75d52} + Standard Python launcher + Global|PythonCore|3.6 + + + + + 10.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file