repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.new | def new(self, data=None, dtype=None, if_fq=None):
"""
创建一个新的DataStruct
data 默认是self.data
🛠todo 没有这个?? inplace 是否是对于原类的修改 ??
"""
data = self.data if data is None else data
dtype = self.type if dtype is None else dtype
if_fq = self.if_fq if if_fq is None e... | python | def new(self, data=None, dtype=None, if_fq=None):
"""
创建一个新的DataStruct
data 默认是self.data
🛠todo 没有这个?? inplace 是否是对于原类的修改 ??
"""
data = self.data if data is None else data
dtype = self.type if dtype is None else dtype
if_fq = self.if_fq if if_fq is None e... | [
"def",
"new",
"(",
"self",
",",
"data",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"if_fq",
"=",
"None",
")",
":",
"data",
"=",
"self",
".",
"data",
"if",
"data",
"is",
"None",
"else",
"data",
"dtype",
"=",
"self",
".",
"type",
"if",
"dtype",
... | 创建一个新的DataStruct
data 默认是self.data
🛠todo 没有这个?? inplace 是否是对于原类的修改 ?? | [
"创建一个新的DataStruct",
"data",
"默认是self",
".",
"data",
"🛠todo",
"没有这个??",
"inplace",
"是否是对于原类的修改",
"??"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L845-L858 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.reindex | def reindex(self, ind):
"""reindex
Arguments:
ind {[type]} -- [description]
Raises:
RuntimeError -- [description]
RuntimeError -- [description]
Returns:
[type] -- [description]
"""
if isinstance(ind, pd.MultiIndex):
... | python | def reindex(self, ind):
"""reindex
Arguments:
ind {[type]} -- [description]
Raises:
RuntimeError -- [description]
RuntimeError -- [description]
Returns:
[type] -- [description]
"""
if isinstance(ind, pd.MultiIndex):
... | [
"def",
"reindex",
"(",
"self",
",",
"ind",
")",
":",
"if",
"isinstance",
"(",
"ind",
",",
"pd",
".",
"MultiIndex",
")",
":",
"try",
":",
"return",
"self",
".",
"new",
"(",
"self",
".",
"data",
".",
"reindex",
"(",
"ind",
")",
")",
"except",
":",
... | reindex
Arguments:
ind {[type]} -- [description]
Raises:
RuntimeError -- [description]
RuntimeError -- [description]
Returns:
[type] -- [description] | [
"reindex"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L863-L885 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.to_json | def to_json(self):
"""
转换DataStruct为json
"""
data = self.data
if self.type[-3:] != 'min':
data = self.data.assign(datetime= self.datetime)
return QA_util_to_json_from_pandas(data.reset_index()) | python | def to_json(self):
"""
转换DataStruct为json
"""
data = self.data
if self.type[-3:] != 'min':
data = self.data.assign(datetime= self.datetime)
return QA_util_to_json_from_pandas(data.reset_index()) | [
"def",
"to_json",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"data",
"if",
"self",
".",
"type",
"[",
"-",
"3",
":",
"]",
"!=",
"'min'",
":",
"data",
"=",
"self",
".",
"data",
".",
"assign",
"(",
"datetime",
"=",
"self",
".",
"datetime",
"... | 转换DataStruct为json | [
"转换DataStruct为json"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L965-L973 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.to_hdf | def to_hdf(self, place, name):
'IO --> hdf5'
self.data.to_hdf(place, name)
return place, name | python | def to_hdf(self, place, name):
'IO --> hdf5'
self.data.to_hdf(place, name)
return place, name | [
"def",
"to_hdf",
"(",
"self",
",",
"place",
",",
"name",
")",
":",
"self",
".",
"data",
".",
"to_hdf",
"(",
"place",
",",
"name",
")",
"return",
"place",
",",
"name"
] | IO --> hdf5 | [
"IO",
"--",
">",
"hdf5"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L993-L996 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.is_same | def is_same(self, DataStruct):
"""
判断是否相同
"""
if self.type == DataStruct.type and self.if_fq == DataStruct.if_fq:
return True
else:
return False | python | def is_same(self, DataStruct):
"""
判断是否相同
"""
if self.type == DataStruct.type and self.if_fq == DataStruct.if_fq:
return True
else:
return False | [
"def",
"is_same",
"(",
"self",
",",
"DataStruct",
")",
":",
"if",
"self",
".",
"type",
"==",
"DataStruct",
".",
"type",
"and",
"self",
".",
"if_fq",
"==",
"DataStruct",
".",
"if_fq",
":",
"return",
"True",
"else",
":",
"return",
"False"
] | 判断是否相同 | [
"判断是否相同"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L998-L1005 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.splits | def splits(self):
"""
将一个DataStruct按code分解为N个DataStruct
"""
return list(map(lambda x: self.select_code(x), self.code)) | python | def splits(self):
"""
将一个DataStruct按code分解为N个DataStruct
"""
return list(map(lambda x: self.select_code(x), self.code)) | [
"def",
"splits",
"(",
"self",
")",
":",
"return",
"list",
"(",
"map",
"(",
"lambda",
"x",
":",
"self",
".",
"select_code",
"(",
"x",
")",
",",
"self",
".",
"code",
")",
")"
] | 将一个DataStruct按code分解为N个DataStruct | [
"将一个DataStruct按code分解为N个DataStruct"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1007-L1011 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.add_func | def add_func(self, func, *arg, **kwargs):
"""QADATASTRUCT的指标/函数apply入口
Arguments:
func {[type]} -- [description]
Returns:
[type] -- [description]
"""
return self.groupby(level=1, sort=False).apply(func, *arg, **kwargs) | python | def add_func(self, func, *arg, **kwargs):
"""QADATASTRUCT的指标/函数apply入口
Arguments:
func {[type]} -- [description]
Returns:
[type] -- [description]
"""
return self.groupby(level=1, sort=False).apply(func, *arg, **kwargs) | [
"def",
"add_func",
"(",
"self",
",",
"func",
",",
"*",
"arg",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"groupby",
"(",
"level",
"=",
"1",
",",
"sort",
"=",
"False",
")",
".",
"apply",
"(",
"func",
",",
"*",
"arg",
",",
"*",
"... | QADATASTRUCT的指标/函数apply入口
Arguments:
func {[type]} -- [description]
Returns:
[type] -- [description] | [
"QADATASTRUCT的指标",
"/",
"函数apply入口"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1029-L1039 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.get_data | def get_data(self, columns, type='ndarray', with_index=False):
"""获取不同格式的数据
Arguments:
columns {[type]} -- [description]
Keyword Arguments:
type {str} -- [description] (default: {'ndarray'})
with_index {bool} -- [description] (default: {False})
Retu... | python | def get_data(self, columns, type='ndarray', with_index=False):
"""获取不同格式的数据
Arguments:
columns {[type]} -- [description]
Keyword Arguments:
type {str} -- [description] (default: {'ndarray'})
with_index {bool} -- [description] (default: {False})
Retu... | [
"def",
"get_data",
"(",
"self",
",",
"columns",
",",
"type",
"=",
"'ndarray'",
",",
"with_index",
"=",
"False",
")",
":",
"res",
"=",
"self",
".",
"select_columns",
"(",
"columns",
")",
"if",
"type",
"==",
"'ndarray'",
":",
"if",
"with_index",
":",
"re... | 获取不同格式的数据
Arguments:
columns {[type]} -- [description]
Keyword Arguments:
type {str} -- [description] (default: {'ndarray'})
with_index {bool} -- [description] (default: {False})
Returns:
[type] -- [description] | [
"获取不同格式的数据"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1052-L1081 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.pivot | def pivot(self, column_):
"""增加对于多列的支持"""
if isinstance(column_, str):
try:
return self.data.reset_index().pivot(
index='datetime',
columns='code',
values=column_
)
except:
... | python | def pivot(self, column_):
"""增加对于多列的支持"""
if isinstance(column_, str):
try:
return self.data.reset_index().pivot(
index='datetime',
columns='code',
values=column_
)
except:
... | [
"def",
"pivot",
"(",
"self",
",",
"column_",
")",
":",
"if",
"isinstance",
"(",
"column_",
",",
"str",
")",
":",
"try",
":",
"return",
"self",
".",
"data",
".",
"reset_index",
"(",
")",
".",
"pivot",
"(",
"index",
"=",
"'datetime'",
",",
"columns",
... | 增加对于多列的支持 | [
"增加对于多列的支持"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1083-L1110 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.selects | def selects(self, code, start, end=None):
"""
选择code,start,end
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间... | python | def selects(self, code, start, end=None):
"""
选择code,start,end
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间... | [
"def",
"selects",
"(",
"self",
",",
"code",
",",
"start",
",",
"end",
"=",
"None",
")",
":",
"def",
"_selects",
"(",
"code",
",",
"start",
",",
"end",
")",
":",
"if",
"end",
"is",
"not",
"None",
":",
"return",
"self",
".",
"data",
".",
"loc",
"... | 选择code,start,end
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pandas索引问题已经解决
... | [
"选择code",
"start",
"end"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1112-L1146 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.select_time | def select_time(self, start, end=None):
"""
选择起始时间
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,rais... | python | def select_time(self, start, end=None):
"""
选择起始时间
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,rais... | [
"def",
"select_time",
"(",
"self",
",",
"start",
",",
"end",
"=",
"None",
")",
":",
"def",
"_select_time",
"(",
"start",
",",
"end",
")",
":",
"if",
"end",
"is",
"not",
"None",
":",
"return",
"self",
".",
"data",
".",
"loc",
"[",
"(",
"slice",
"(... | 选择起始时间
如果end不填写,默认获取到结尾
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pandas索引问题已经解决
全部恢... | [
"选择起始时间",
"如果end不填写",
"默认获取到结尾"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1148-L1178 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.select_day | def select_day(self, day):
"""选取日期(一般用于分钟线)
Arguments:
day {[type]} -- [description]
Raises:
ValueError -- [description]
Returns:
[type] -- [description]
"""
def _select_day(day):
return self.data.loc[day, slice(None)]
... | python | def select_day(self, day):
"""选取日期(一般用于分钟线)
Arguments:
day {[type]} -- [description]
Raises:
ValueError -- [description]
Returns:
[type] -- [description]
"""
def _select_day(day):
return self.data.loc[day, slice(None)]
... | [
"def",
"select_day",
"(",
"self",
",",
"day",
")",
":",
"def",
"_select_day",
"(",
"day",
")",
":",
"return",
"self",
".",
"data",
".",
"loc",
"[",
"day",
",",
"slice",
"(",
"None",
")",
"]",
"try",
":",
"return",
"self",
".",
"new",
"(",
"_selec... | 选取日期(一般用于分钟线)
Arguments:
day {[type]} -- [description]
Raises:
ValueError -- [description]
Returns:
[type] -- [description] | [
"选取日期",
"(",
"一般用于分钟线",
")"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1180-L1199 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.select_month | def select_month(self, month):
"""
选择月份
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pa... | python | def select_month(self, month):
"""
选择月份
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pa... | [
"def",
"select_month",
"(",
"self",
",",
"month",
")",
":",
"def",
"_select_month",
"(",
"month",
")",
":",
"return",
"self",
".",
"data",
".",
"loc",
"[",
"month",
",",
"slice",
"(",
"None",
")",
"]",
"try",
":",
"return",
"self",
".",
"new",
"(",... | 选择月份
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pandas索引问题已经解决
全部恢复 | [
"选择月份"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1201-L1224 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.select_code | def select_code(self, code):
"""
选择股票
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pand... | python | def select_code(self, code):
"""
选择股票
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pand... | [
"def",
"select_code",
"(",
"self",
",",
"code",
")",
":",
"def",
"_select_code",
"(",
"code",
")",
":",
"return",
"self",
".",
"data",
".",
"loc",
"[",
"(",
"slice",
"(",
"None",
")",
",",
"code",
")",
",",
":",
"]",
"try",
":",
"return",
"self",... | 选择股票
@2018/06/03 pandas 的索引问题导致
https://github.com/pandas-dev/pandas/issues/21299
因此先用set_index去重做一次index
影响的有selects,select_time,select_month,get_bar
@2018/06/04
当选择的时间越界/股票不存在,raise ValueError
@2018/06/04 pandas索引问题已经解决
全部恢复 | [
"选择股票"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1226-L1249 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | _quotation_base.get_bar | def get_bar(self, code, time):
"""
获取一个bar的数据
返回一个series
如果不存在,raise ValueError
"""
try:
return self.data.loc[(pd.Timestamp(time), code)]
except:
raise ValueError(
'DATASTRUCT CURRENTLY CANNOT FIND THIS BAR WITH {} {}'.forma... | python | def get_bar(self, code, time):
"""
获取一个bar的数据
返回一个series
如果不存在,raise ValueError
"""
try:
return self.data.loc[(pd.Timestamp(time), code)]
except:
raise ValueError(
'DATASTRUCT CURRENTLY CANNOT FIND THIS BAR WITH {} {}'.forma... | [
"def",
"get_bar",
"(",
"self",
",",
"code",
",",
"time",
")",
":",
"try",
":",
"return",
"self",
".",
"data",
".",
"loc",
"[",
"(",
"pd",
".",
"Timestamp",
"(",
"time",
")",
",",
"code",
")",
"]",
"except",
":",
"raise",
"ValueError",
"(",
"'DATA... | 获取一个bar的数据
返回一个series
如果不存在,raise ValueError | [
"获取一个bar的数据",
"返回一个series",
"如果不存在",
"raise",
"ValueError"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/base_datastruct.py#L1264-L1278 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/trans_ss.py | QA_SU_trans_stock_min | def QA_SU_trans_stock_min(client=DATABASE, ui_log=None, ui_progress=None,
data_path: str = "D:\\skysoft\\", type_="1min"):
"""
将天软本地数据导入 QA 数据库
:param client:
:param ui_log:
:param ui_progress:
:param data_path: 存放天软数据的路径,默认文件名格式为类似 "SH600000.csv" 格式
"""
code_li... | python | def QA_SU_trans_stock_min(client=DATABASE, ui_log=None, ui_progress=None,
data_path: str = "D:\\skysoft\\", type_="1min"):
"""
将天软本地数据导入 QA 数据库
:param client:
:param ui_log:
:param ui_progress:
:param data_path: 存放天软数据的路径,默认文件名格式为类似 "SH600000.csv" 格式
"""
code_li... | [
"def",
"QA_SU_trans_stock_min",
"(",
"client",
"=",
"DATABASE",
",",
"ui_log",
"=",
"None",
",",
"ui_progress",
"=",
"None",
",",
"data_path",
":",
"str",
"=",
"\"D:\\\\skysoft\\\\\"",
",",
"type_",
"=",
"\"1min\"",
")",
":",
"code_list",
"=",
"list",
"(",
... | 将天软本地数据导入 QA 数据库
:param client:
:param ui_log:
:param ui_progress:
:param data_path: 存放天软数据的路径,默认文件名格式为类似 "SH600000.csv" 格式 | [
"将天软本地数据导入",
"QA",
"数据库",
":",
"param",
"client",
":",
":",
"param",
"ui_log",
":",
":",
"param",
"ui_progress",
":",
":",
"param",
"data_path",
":",
"存放天软数据的路径,默认文件名格式为类似",
"SH600000",
".",
"csv",
"格式"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/trans_ss.py#L21-L145 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | get_best_ip_by_real_data_fetch | def get_best_ip_by_real_data_fetch(_type='stock'):
"""
用特定的数据获取函数测试数据获得的时间,从而选择下载数据最快的服务器ip
默认使用特定品种1min的方式的获取
"""
from QUANTAXIS.QAUtil.QADate import QA_util_today_str
import time
#找到前两天的有效交易日期
pre_trade_date=QA_util_get_real_date(QA_util_today_str())
pre_trade_date=QA_util_get... | python | def get_best_ip_by_real_data_fetch(_type='stock'):
"""
用特定的数据获取函数测试数据获得的时间,从而选择下载数据最快的服务器ip
默认使用特定品种1min的方式的获取
"""
from QUANTAXIS.QAUtil.QADate import QA_util_today_str
import time
#找到前两天的有效交易日期
pre_trade_date=QA_util_get_real_date(QA_util_today_str())
pre_trade_date=QA_util_get... | [
"def",
"get_best_ip_by_real_data_fetch",
"(",
"_type",
"=",
"'stock'",
")",
":",
"from",
"QUANTAXIS",
".",
"QAUtil",
".",
"QADate",
"import",
"QA_util_today_str",
"import",
"time",
"#找到前两天的有效交易日期",
"pre_trade_date",
"=",
"QA_util_get_real_date",
"(",
"QA_util_today_str"... | 用特定的数据获取函数测试数据获得的时间,从而选择下载数据最快的服务器ip
默认使用特定品种1min的方式的获取 | [
"用特定的数据获取函数测试数据获得的时间",
"从而选择下载数据最快的服务器ip",
"默认使用特定品种1min的方式的获取"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L158-L206 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | get_ip_list_by_multi_process_ping | def get_ip_list_by_multi_process_ping(ip_list=[], n=0, _type='stock'):
''' 根据ping排序返回可用的ip列表
2019 03 31 取消参数filename
:param ip_list: ip列表
:param n: 最多返回的ip数量, 当可用ip数量小于n,返回所有可用的ip;n=0时,返回所有可用ip
:param _type: ip类型
:return: 可以ping通的ip列表
'''
cache = QA_util_cache()
results = cache.get(... | python | def get_ip_list_by_multi_process_ping(ip_list=[], n=0, _type='stock'):
''' 根据ping排序返回可用的ip列表
2019 03 31 取消参数filename
:param ip_list: ip列表
:param n: 最多返回的ip数量, 当可用ip数量小于n,返回所有可用的ip;n=0时,返回所有可用ip
:param _type: ip类型
:return: 可以ping通的ip列表
'''
cache = QA_util_cache()
results = cache.get(... | [
"def",
"get_ip_list_by_multi_process_ping",
"(",
"ip_list",
"=",
"[",
"]",
",",
"n",
"=",
"0",
",",
"_type",
"=",
"'stock'",
")",
":",
"cache",
"=",
"QA_util_cache",
"(",
")",
"results",
"=",
"cache",
".",
"get",
"(",
"_type",
")",
"if",
"results",
":"... | 根据ping排序返回可用的ip列表
2019 03 31 取消参数filename
:param ip_list: ip列表
:param n: 最多返回的ip数量, 当可用ip数量小于n,返回所有可用的ip;n=0时,返回所有可用ip
:param _type: ip类型
:return: 可以ping通的ip列表 | [
"根据ping排序返回可用的ip列表",
"2019",
"03",
"31",
"取消参数filename"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L208-L246 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | get_mainmarket_ip | def get_mainmarket_ip(ip, port):
"""[summary]
Arguments:
ip {[type]} -- [description]
port {[type]} -- [description]
Returns:
[type] -- [description]
"""
global best_ip
if ip is None and port is None and best_ip['stock']['ip'] is None and best_ip['stock']['port'] is No... | python | def get_mainmarket_ip(ip, port):
"""[summary]
Arguments:
ip {[type]} -- [description]
port {[type]} -- [description]
Returns:
[type] -- [description]
"""
global best_ip
if ip is None and port is None and best_ip['stock']['ip'] is None and best_ip['stock']['port'] is No... | [
"def",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
":",
"global",
"best_ip",
"if",
"ip",
"is",
"None",
"and",
"port",
"is",
"None",
"and",
"best_ip",
"[",
"'stock'",
"]",
"[",
"'ip'",
"]",
"is",
"None",
"and",
"best_ip",
"[",
"'stock'",
"]",
"[... | [summary]
Arguments:
ip {[type]} -- [description]
port {[type]} -- [description]
Returns:
[type] -- [description] | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L276-L297 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_security_bars | def QA_fetch_get_security_bars(code, _type, lens, ip=None, port=None):
"""按bar长度推算数据
Arguments:
code {[type]} -- [description]
_type {[type]} -- [description]
lens {[type]} -- [description]
Keyword Arguments:
ip {[type]} -- [description] (default: {best_ip})
port {[... | python | def QA_fetch_get_security_bars(code, _type, lens, ip=None, port=None):
"""按bar长度推算数据
Arguments:
code {[type]} -- [description]
_type {[type]} -- [description]
lens {[type]} -- [description]
Keyword Arguments:
ip {[type]} -- [description] (default: {best_ip})
port {[... | [
"def",
"QA_fetch_get_security_bars",
"(",
"code",
",",
"_type",
",",
"lens",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"wit... | 按bar长度推算数据
Arguments:
code {[type]} -- [description]
_type {[type]} -- [description]
lens {[type]} -- [description]
Keyword Arguments:
ip {[type]} -- [description] (default: {best_ip})
port {[type]} -- [description] (default: {7709})
Returns:
[type] -- [des... | [
"按bar长度推算数据"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L300-L333 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_stock_day | def QA_fetch_get_stock_day(code, start_date, end_date, if_fq='00', frequence='day', ip=None, port=None):
"""获取日线及以上级别的数据
Arguments:
code {str:6} -- code 是一个单独的code 6位长度的str
start_date {str:10} -- 10位长度的日期 比如'2017-01-01'
end_date {str:10} -- 10位长度的日期 比如'2018-01-01'
Keyword Argument... | python | def QA_fetch_get_stock_day(code, start_date, end_date, if_fq='00', frequence='day', ip=None, port=None):
"""获取日线及以上级别的数据
Arguments:
code {str:6} -- code 是一个单独的code 6位长度的str
start_date {str:10} -- 10位长度的日期 比如'2017-01-01'
end_date {str:10} -- 10位长度的日期 比如'2018-01-01'
Keyword Argument... | [
"def",
"QA_fetch_get_stock_day",
"(",
"code",
",",
"start_date",
",",
"end_date",
",",
"if_fq",
"=",
"'00'",
",",
"frequence",
"=",
"'day'",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"... | 获取日线及以上级别的数据
Arguments:
code {str:6} -- code 是一个单独的code 6位长度的str
start_date {str:10} -- 10位长度的日期 比如'2017-01-01'
end_date {str:10} -- 10位长度的日期 比如'2018-01-01'
Keyword Arguments:
if_fq {str} -- '00'/'bfq' -- 不复权 '01'/'qfq' -- 前复权 '02'/'hfq' -- 后复权 '03'/'ddqfq' -- 定点前复权 '04'/'ddhf... | [
"获取日线及以上级别的数据"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L336-L409 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | for_sz | def for_sz(code):
"""深市代码分类
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description]
"""
if str(code)[0:2] in ['00', '30', '02']:
return 'stock_cn'
elif str(code)[0:2] in ['39']:
return 'index_cn'
elif str(code)[0:2] in ['15']:
ret... | python | def for_sz(code):
"""深市代码分类
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description]
"""
if str(code)[0:2] in ['00', '30', '02']:
return 'stock_cn'
elif str(code)[0:2] in ['39']:
return 'index_cn'
elif str(code)[0:2] in ['15']:
ret... | [
"def",
"for_sz",
"(",
"code",
")",
":",
"if",
"str",
"(",
"code",
")",
"[",
"0",
":",
"2",
"]",
"in",
"[",
"'00'",
",",
"'30'",
",",
"'02'",
"]",
":",
"return",
"'stock_cn'",
"elif",
"str",
"(",
"code",
")",
"[",
"0",
":",
"2",
"]",
"in",
"... | 深市代码分类
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description] | [
"深市代码分类"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L591-L617 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_index_list | def QA_fetch_get_index_list(ip=None, port=None):
"""获取指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
Returns:
[type] -- [description]
"""
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
... | python | def QA_fetch_get_index_list(ip=None, port=None):
"""获取指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
Returns:
[type] -- [description]
"""
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
... | [
"def",
"QA_fetch_get_index_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"with",
"api",
".",
"connect",
"(",
"ip",
",",
... | 获取指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
Returns:
[type] -- [description] | [
"获取指数列表"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L672-L697 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_stock_transaction_realtime | def QA_fetch_get_stock_transaction_realtime(code, ip=None, port=None):
'实时分笔成交 包含集合竞价 buyorsell 1--sell 0--buy 2--盘前'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
try:
with api.connect(ip, port):
data = pd.DataFrame()
data = pd.concat([api.to_df(api.get_transa... | python | def QA_fetch_get_stock_transaction_realtime(code, ip=None, port=None):
'实时分笔成交 包含集合竞价 buyorsell 1--sell 0--buy 2--盘前'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
try:
with api.connect(ip, port):
data = pd.DataFrame()
data = pd.concat([api.to_df(api.get_transa... | [
"def",
"QA_fetch_get_stock_transaction_realtime",
"(",
"code",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"try",
":",
"with",
... | 实时分笔成交 包含集合竞价 buyorsell 1--sell 0--buy 2--盘前 | [
"实时分笔成交",
"包含集合竞价",
"buyorsell",
"1",
"--",
"sell",
"0",
"--",
"buy",
"2",
"--",
"盘前"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L983-L1001 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_stock_xdxr | def QA_fetch_get_stock_xdxr(code, ip=None, port=None):
'除权除息'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
market_code = _select_market_code(code)
with api.connect(ip, port):
category = {
'1': '除权除息', '2': '送配股上市', '3': '非流通股上市', '4': '未知股本变动', '5': '股本变化',
... | python | def QA_fetch_get_stock_xdxr(code, ip=None, port=None):
'除权除息'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
market_code = _select_market_code(code)
with api.connect(ip, port):
category = {
'1': '除权除息', '2': '送配股上市', '3': '非流通股上市', '4': '未知股本变动', '5': '股本变化',
... | [
"def",
"QA_fetch_get_stock_xdxr",
"(",
"code",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"market_code",
"=",
"_select_market_co... | 除权除息 | [
"除权除息"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1004-L1027 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_stock_info | def QA_fetch_get_stock_info(code, ip=None, port=None):
'股票基本信息'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
market_code = _select_market_code(code)
with api.connect(ip, port):
return api.to_df(api.get_finance_info(market_code, code)) | python | def QA_fetch_get_stock_info(code, ip=None, port=None):
'股票基本信息'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
market_code = _select_market_code(code)
with api.connect(ip, port):
return api.to_df(api.get_finance_info(market_code, code)) | [
"def",
"QA_fetch_get_stock_info",
"(",
"code",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"market_code",
"=",
"_select_market_co... | 股票基本信息 | [
"股票基本信息"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1030-L1036 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_stock_block | def QA_fetch_get_stock_block(ip=None, port=None):
'板块数据'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
with api.connect(ip, port):
data = pd.concat([api.to_df(api.get_and_parse_block_info("block_gn.dat")).assign(type='gn'),
api.to_df(api.get_and_parse_block_... | python | def QA_fetch_get_stock_block(ip=None, port=None):
'板块数据'
ip, port = get_mainmarket_ip(ip, port)
api = TdxHq_API()
with api.connect(ip, port):
data = pd.concat([api.to_df(api.get_and_parse_block_info("block_gn.dat")).assign(type='gn'),
api.to_df(api.get_and_parse_block_... | [
"def",
"QA_fetch_get_stock_block",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_mainmarket_ip",
"(",
"ip",
",",
"port",
")",
"api",
"=",
"TdxHq_API",
"(",
")",
"with",
"api",
".",
"connect",
"(",
"ip",
",",... | 板块数据 | [
"板块数据"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1039-L1056 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_extensionmarket_list | def QA_fetch_get_extensionmarket_list(ip=None, port=None):
'期货代码list'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
with apix.connect(ip, port):
num = apix.get_instrument_count()
return pd.concat([apix.to_df(
apix.get_instrument_info((int(num / 500) - i) * ... | python | def QA_fetch_get_extensionmarket_list(ip=None, port=None):
'期货代码list'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
with apix.connect(ip, port):
num = apix.get_instrument_count()
return pd.concat([apix.to_df(
apix.get_instrument_info((int(num / 500) - i) * ... | [
"def",
"QA_fetch_get_extensionmarket_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
"apix",
"=",
"TdxExHq_API",
"(",
")",
"with",
"apix",
".",
"connect",
"... | 期货代码list | [
"期货代码list"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1172-L1180 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_list | def QA_fetch_get_future_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
... | python | def QA_fetch_get_future_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
... | [
"def",
"QA_fetch_get_future_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extensi... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
29 3 大连商品 QD
30 3 ... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1183-L1208 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_globalindex_list | def QA_fetch_get_globalindex_list(ip=None, port=None):
"""全球指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
37 11 全球指数(静态) FW
12 5 国际指数 WI
"""
global extension_m... | python | def QA_fetch_get_globalindex_list(ip=None, port=None):
"""全球指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
37 11 全球指数(静态) FW
12 5 国际指数 WI
"""
global extension_m... | [
"def",
"QA_fetch_get_globalindex_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"ex... | 全球指数列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
37 11 全球指数(静态) FW
12 5 国际指数 WI | [
"全球指数列表"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1211-L1227 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_goods_list | def QA_fetch_get_goods_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
... | python | def QA_fetch_get_goods_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
... | [
"def",
"QA_fetch_get_goods_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extensio... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
42 3 商品指数 TI
60 3 主力期货合约 MA
28 3 郑州商品 QZ
29 3 大连商品 QD
30 3 ... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1230-L1255 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_globalfuture_list | def QA_fetch_get_globalfuture_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
14 3 伦敦金属 LM
15 3 伦敦石油 IP
16 3 纽约商... | python | def QA_fetch_get_globalfuture_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
14 3 伦敦金属 LM
15 3 伦敦石油 IP
16 3 纽约商... | [
"def",
"QA_fetch_get_globalfuture_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"e... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
14 3 伦敦金属 LM
15 3 伦敦石油 IP
16 3 纽约商品 CO
17 3 纽约石油 NY
18... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1258-L1282 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_hkstock_list | def QA_fetch_get_hkstock_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2... | python | def QA_fetch_get_hkstock_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2... | [
"def",
"QA_fetch_get_hkstock_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extens... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2 香港创业板 KG
49 2 香港基金 ... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1285-L1305 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_hkindex_list | def QA_fetch_get_hkindex_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2... | python | def QA_fetch_get_hkindex_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2... | [
"def",
"QA_fetch_get_hkindex_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extens... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2 香港创业板 KG
49 2 香港基金 ... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1308-L1328 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_hkfund_list | def QA_fetch_get_hkfund_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 ... | python | def QA_fetch_get_hkfund_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 ... | [
"def",
"QA_fetch_get_hkfund_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extensi... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 2 香港创业板 KG
49 2 香港基... | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1331-L1351 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_usstock_list | def QA_fetch_get_usstock_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 美股 USA STOCK
74 13 美国股票 US
40 11 中国概念股 CH
41 ... | python | def QA_fetch_get_usstock_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 美股 USA STOCK
74 13 美国股票 US
40 11 中国概念股 CH
41 ... | [
"def",
"QA_fetch_get_usstock_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extens... | [summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 美股 USA STOCK
74 13 美国股票 US
40 11 中国概念股 CH
41 11 美股知名公司 MG | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1354-L1373 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_macroindex_list | def QA_fetch_get_macroindex_list(ip=None, port=None):
"""宏观指标列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
38 10 宏观指标 HG
"""
global extension_market_list
extension_market_list = QA... | python | def QA_fetch_get_macroindex_list(ip=None, port=None):
"""宏观指标列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
38 10 宏观指标 HG
"""
global extension_market_list
extension_market_list = QA... | [
"def",
"QA_fetch_get_macroindex_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"ext... | 宏观指标列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
38 10 宏观指标 HG | [
"宏观指标列表"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1376-L1391 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_option_list | def QA_fetch_get_option_list(ip=None, port=None):
"""期权列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 期权 OPTION
1 12 临时期权(主要是50ETF)
4 12 郑州商品期权 OZ
5 ... | python | def QA_fetch_get_option_list(ip=None, port=None):
"""期权列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 期权 OPTION
1 12 临时期权(主要是50ETF)
4 12 郑州商品期权 OZ
5 ... | [
"def",
"QA_fetch_get_option_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"extensi... | 期权列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 期权 OPTION
1 12 临时期权(主要是50ETF)
4 12 郑州商品期权 OZ
5 12 大连商品期权 OD
6 12 上海... | [
"期权列表"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1394-L1416 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_option_contract_time_to_market | def QA_fetch_get_option_contract_time_to_market():
'''
#🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
'''
fix here :
See the caveats in the documentation: http://panda... | python | def QA_fetch_get_option_contract_time_to_market():
'''
#🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
'''
fix here :
See the caveats in the documentation: http://panda... | [
"def",
"QA_fetch_get_option_contract_time_to_market",
"(",
")",
":",
"result",
"=",
"QA_fetch_get_option_list",
"(",
"'tdx'",
")",
"# pprint.pprint(result)",
"# category market code name desc code",
"'''\n fix here : \n See the caveats in the documentation: http://pandas.pydata.or... | #🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series | [
"#🛠todo",
"获取期权合约的上市日期",
"?",
"暂时没有。",
":",
"return",
":",
"list",
"Series"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1419-L1646 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_option_50etf_contract_time_to_market | def QA_fetch_get_option_50etf_contract_time_to_market():
'''
#🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
'''
fix here :
See the caveats in the documenta... | python | def QA_fetch_get_option_50etf_contract_time_to_market():
'''
#🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
'''
fix here :
See the caveats in the documenta... | [
"def",
"QA_fetch_get_option_50etf_contract_time_to_market",
"(",
")",
":",
"result",
"=",
"QA_fetch_get_option_list",
"(",
"'tdx'",
")",
"# pprint.pprint(result)",
"# category market code name desc code",
"'''\n fix here : \n See the caveats in the documentation: http://pandas.pyd... | #🛠todo 获取期权合约的上市日期 ? 暂时没有。
:return: list Series | [
"#🛠todo",
"获取期权合约的上市日期",
"?",
"暂时没有。",
":",
"return",
":",
"list",
"Series"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1649-L1730 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_commodity_option_CF_contract_time_to_market | def QA_fetch_get_commodity_option_CF_contract_time_to_market():
'''
铜期权 CU 开头 上期证
豆粕 M开头 大商所
白糖 SR开头 郑商所
测试中发现,行情不太稳定 ? 是 通达信 IP 的问题 ?
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
# df = pd.DataFra... | python | def QA_fetch_get_commodity_option_CF_contract_time_to_market():
'''
铜期权 CU 开头 上期证
豆粕 M开头 大商所
白糖 SR开头 郑商所
测试中发现,行情不太稳定 ? 是 通达信 IP 的问题 ?
'''
result = QA_fetch_get_option_list('tdx')
# pprint.pprint(result)
# category market code name desc code
# df = pd.DataFra... | [
"def",
"QA_fetch_get_commodity_option_CF_contract_time_to_market",
"(",
")",
":",
"result",
"=",
"QA_fetch_get_option_list",
"(",
"'tdx'",
")",
"# pprint.pprint(result)",
"# category market code name desc code",
"# df = pd.DataFrame()",
"rows",
"=",
"[",
"]",
"result",
"[",
... | 铜期权 CU 开头 上期证
豆粕 M开头 大商所
白糖 SR开头 郑商所
测试中发现,行情不太稳定 ? 是 通达信 IP 的问题 ? | [
"铜期权",
"CU",
"开头",
"上期证",
"豆粕",
"M开头",
"大商所",
"白糖",
"SR开头",
"郑商所",
"测试中发现,行情不太稳定",
"?",
"是",
"通达信",
"IP",
"的问题",
"?"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1733-L1765 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_exchangerate_list | def QA_fetch_get_exchangerate_list(ip=None, port=None):
"""汇率列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 汇率 EXCHANGERATE
10 4 基本汇率 FE
11 4 交叉汇率 FX
""... | python | def QA_fetch_get_exchangerate_list(ip=None, port=None):
"""汇率列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 汇率 EXCHANGERATE
10 4 基本汇率 FE
11 4 交叉汇率 FX
""... | [
"def",
"QA_fetch_get_exchangerate_list",
"(",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"global",
"extension_market_list",
"extension_market_list",
"=",
"QA_fetch_get_extensionmarket_list",
"(",
")",
"if",
"extension_market_list",
"is",
"None",
"else",
"e... | 汇率列表
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
## 汇率 EXCHANGERATE
10 4 基本汇率 FE
11 4 交叉汇率 FX | [
"汇率列表"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1938-L1955 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_day | def QA_fetch_get_future_day(code, start_date, end_date, frequence='day', ip=None, port=None):
'期货数据 日线'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
start_date = str(start_date)[0:10]
today_ = datetime.date.today()
lens = QA_util_get_trade_gap(start_date, today_)
global e... | python | def QA_fetch_get_future_day(code, start_date, end_date, frequence='day', ip=None, port=None):
'期货数据 日线'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
start_date = str(start_date)[0:10]
today_ = datetime.date.today()
lens = QA_util_get_trade_gap(start_date, today_)
global e... | [
"def",
"QA_fetch_get_future_day",
"(",
"code",
",",
"start_date",
",",
"end_date",
",",
"frequence",
"=",
"'day'",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
... | 期货数据 日线 | [
"期货数据",
"日线"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1958-L1995 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_min | def QA_fetch_get_future_min(code, start, end, frequence='1min', ip=None, port=None):
'期货数据 分钟线'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
type_ = ''
start_date = str(start)[0:10]
today_ = datetime.date.today()
lens = QA_util_get_trade_gap(start_date, today_)
global... | python | def QA_fetch_get_future_min(code, start, end, frequence='1min', ip=None, port=None):
'期货数据 分钟线'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
type_ = ''
start_date = str(start)[0:10]
today_ = datetime.date.today()
lens = QA_util_get_trade_gap(start_date, today_)
global... | [
"def",
"QA_fetch_get_future_min",
"(",
"code",
",",
"start",
",",
"end",
",",
"frequence",
"=",
"'1min'",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
"apix",... | 期货数据 分钟线 | [
"期货数据",
"分钟线"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L1998-L2045 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_transaction | def QA_fetch_get_future_transaction(code, start, end, retry=4, ip=None, port=None):
'期货历史成交分笔'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extensio... | python | def QA_fetch_get_future_transaction(code, start, end, retry=4, ip=None, port=None):
'期货历史成交分笔'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extensio... | [
"def",
"QA_fetch_get_future_transaction",
"(",
"code",
",",
"start",
",",
"end",
",",
"retry",
"=",
"4",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
"apix",
... | 期货历史成交分笔 | [
"期货历史成交分笔"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L2075-L2109 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_transaction_realtime | def QA_fetch_get_future_transaction_realtime(code, ip=None, port=None):
'期货历史成交分笔'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extension_market_lis... | python | def QA_fetch_get_future_transaction_realtime(code, ip=None, port=None):
'期货历史成交分笔'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extension_market_lis... | [
"def",
"QA_fetch_get_future_transaction_realtime",
"(",
"code",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
"apix",
"=",
"TdxExHq_API",
"(",
")",
"global",
"exte... | 期货历史成交分笔 | [
"期货历史成交分笔"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L2112-L2128 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATdx.py | QA_fetch_get_future_realtime | def QA_fetch_get_future_realtime(code, ip=None, port=None):
'期货实时价格'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extension_market_list
__data =... | python | def QA_fetch_get_future_realtime(code, ip=None, port=None):
'期货实时价格'
ip, port = get_extensionmarket_ip(ip, port)
apix = TdxExHq_API()
global extension_market_list
extension_market_list = QA_fetch_get_extensionmarket_list(
) if extension_market_list is None else extension_market_list
__data =... | [
"def",
"QA_fetch_get_future_realtime",
"(",
"code",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"ip",
",",
"port",
"=",
"get_extensionmarket_ip",
"(",
"ip",
",",
"port",
")",
"apix",
"=",
"TdxExHq_API",
"(",
")",
"global",
"extension_market... | 期货实时价格 | [
"期货实时价格"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATdx.py#L2131-L2150 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/dsmethods.py | concat | def concat(lists):
"""类似于pd.concat 用于合并一个list里面的多个DataStruct,会自动去重
Arguments:
lists {[type]} -- [DataStruct1,DataStruct2,....,DataStructN]
Returns:
[type] -- new DataStruct
"""
return lists[0].new(
pd.concat([lists.data for lists in lists]).drop_duplicates()
) | python | def concat(lists):
"""类似于pd.concat 用于合并一个list里面的多个DataStruct,会自动去重
Arguments:
lists {[type]} -- [DataStruct1,DataStruct2,....,DataStructN]
Returns:
[type] -- new DataStruct
"""
return lists[0].new(
pd.concat([lists.data for lists in lists]).drop_duplicates()
) | [
"def",
"concat",
"(",
"lists",
")",
":",
"return",
"lists",
"[",
"0",
"]",
".",
"new",
"(",
"pd",
".",
"concat",
"(",
"[",
"lists",
".",
"data",
"for",
"lists",
"in",
"lists",
"]",
")",
".",
"drop_duplicates",
"(",
")",
")"
] | 类似于pd.concat 用于合并一个list里面的多个DataStruct,会自动去重
Arguments:
lists {[type]} -- [DataStruct1,DataStruct2,....,DataStructN]
Returns:
[type] -- new DataStruct | [
"类似于pd",
".",
"concat",
"用于合并一个list里面的多个DataStruct",
"会自动去重"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/dsmethods.py#L39-L53 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/dsmethods.py | datastruct_formater | def datastruct_formater(
data,
frequence=FREQUENCE.DAY,
market_type=MARKET_TYPE.STOCK_CN,
default_header=[]
):
"""一个任意格式转化为DataStruct的方法
Arguments:
data {[type]} -- [description]
Keyword Arguments:
frequence {[type]} -- [description] (default: {FREQU... | python | def datastruct_formater(
data,
frequence=FREQUENCE.DAY,
market_type=MARKET_TYPE.STOCK_CN,
default_header=[]
):
"""一个任意格式转化为DataStruct的方法
Arguments:
data {[type]} -- [description]
Keyword Arguments:
frequence {[type]} -- [description] (default: {FREQU... | [
"def",
"datastruct_formater",
"(",
"data",
",",
"frequence",
"=",
"FREQUENCE",
".",
"DAY",
",",
"market_type",
"=",
"MARKET_TYPE",
".",
"STOCK_CN",
",",
"default_header",
"=",
"[",
"]",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"list",
")",
":",
"t... | 一个任意格式转化为DataStruct的方法
Arguments:
data {[type]} -- [description]
Keyword Arguments:
frequence {[type]} -- [description] (default: {FREQUENCE.DAY})
market_type {[type]} -- [description] (default: {MARKET_TYPE.STOCK_CN})
default_header {list} -- [description] (default: {[... | [
"一个任意格式转化为DataStruct的方法",
"Arguments",
":",
"data",
"{",
"[",
"type",
"]",
"}",
"--",
"[",
"description",
"]",
"Keyword",
"Arguments",
":",
"frequence",
"{",
"[",
"type",
"]",
"}",
"--",
"[",
"description",
"]",
"(",
"default",
":",
"{",
"FREQUENCE",
"."... | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/dsmethods.py#L56-L138 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/dsmethods.py | from_tushare | def from_tushare(dataframe, dtype='day'):
"""dataframe from tushare
Arguments:
dataframe {[type]} -- [description]
Returns:
[type] -- [description]
"""
if dtype in ['day']:
return QA_DataStruct_Stock_day(
dataframe.assign(date=pd.to_datetime(dataframe.date)
... | python | def from_tushare(dataframe, dtype='day'):
"""dataframe from tushare
Arguments:
dataframe {[type]} -- [description]
Returns:
[type] -- [description]
"""
if dtype in ['day']:
return QA_DataStruct_Stock_day(
dataframe.assign(date=pd.to_datetime(dataframe.date)
... | [
"def",
"from_tushare",
"(",
"dataframe",
",",
"dtype",
"=",
"'day'",
")",
":",
"if",
"dtype",
"in",
"[",
"'day'",
"]",
":",
"return",
"QA_DataStruct_Stock_day",
"(",
"dataframe",
".",
"assign",
"(",
"date",
"=",
"pd",
".",
"to_datetime",
"(",
"dataframe",
... | dataframe from tushare
Arguments:
dataframe {[type]} -- [description]
Returns:
[type] -- [description] | [
"dataframe",
"from",
"tushare"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/dsmethods.py#L141-L166 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/dsmethods.py | QDS_StockDayWarpper | def QDS_StockDayWarpper(func):
"""
日线QDS装饰器
"""
def warpper(*args, **kwargs):
data = func(*args, **kwargs)
if isinstance(data.index, pd.MultiIndex):
return QA_DataStruct_Stock_day(data)
else:
return QA_DataStruct_Stock_day(
data.assign(d... | python | def QDS_StockDayWarpper(func):
"""
日线QDS装饰器
"""
def warpper(*args, **kwargs):
data = func(*args, **kwargs)
if isinstance(data.index, pd.MultiIndex):
return QA_DataStruct_Stock_day(data)
else:
return QA_DataStruct_Stock_day(
data.assign(d... | [
"def",
"QDS_StockDayWarpper",
"(",
"func",
")",
":",
"def",
"warpper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"isinstance",
"(",
"data",
".",
"index",
",",
"... | 日线QDS装饰器 | [
"日线QDS装饰器"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/dsmethods.py#L169-L189 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/dsmethods.py | QDS_StockMinWarpper | def QDS_StockMinWarpper(func, *args, **kwargs):
"""
分钟线QDS装饰器
"""
def warpper(*args, **kwargs):
data = func(*args, **kwargs)
if isinstance(data.index, pd.MultiIndex):
return QA_DataStruct_Stock_min(data)
else:
return QA_DataStruct_Stock_min(
... | python | def QDS_StockMinWarpper(func, *args, **kwargs):
"""
分钟线QDS装饰器
"""
def warpper(*args, **kwargs):
data = func(*args, **kwargs)
if isinstance(data.index, pd.MultiIndex):
return QA_DataStruct_Stock_min(data)
else:
return QA_DataStruct_Stock_min(
... | [
"def",
"QDS_StockMinWarpper",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"warpper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"i... | 分钟线QDS装饰器 | [
"分钟线QDS装饰器"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/dsmethods.py#L192-L211 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATushare.py | QA_fetch_get_stock_adj | def QA_fetch_get_stock_adj(code, end=''):
"""获取股票的复权因子
Arguments:
code {[type]} -- [description]
Keyword Arguments:
end {str} -- [description] (default: {''})
Returns:
[type] -- [description]
"""
pro = get_pro()
adj = pro.adj_factor(ts_code=code, trade... | python | def QA_fetch_get_stock_adj(code, end=''):
"""获取股票的复权因子
Arguments:
code {[type]} -- [description]
Keyword Arguments:
end {str} -- [description] (default: {''})
Returns:
[type] -- [description]
"""
pro = get_pro()
adj = pro.adj_factor(ts_code=code, trade... | [
"def",
"QA_fetch_get_stock_adj",
"(",
"code",
",",
"end",
"=",
"''",
")",
":",
"pro",
"=",
"get_pro",
"(",
")",
"adj",
"=",
"pro",
".",
"adj_factor",
"(",
"ts_code",
"=",
"code",
",",
"trade_date",
"=",
"end",
")",
"return",
"adj"
] | 获取股票的复权因子
Arguments:
code {[type]} -- [description]
Keyword Arguments:
end {str} -- [description] (default: {''})
Returns:
[type] -- [description] | [
"获取股票的复权因子",
"Arguments",
":",
"code",
"{",
"[",
"type",
"]",
"}",
"--",
"[",
"description",
"]",
"Keyword",
"Arguments",
":",
"end",
"{",
"str",
"}",
"--",
"[",
"description",
"]",
"(",
"default",
":",
"{",
"}",
")",
"Returns",
":",
"[",
"type",
"... | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATushare.py#L67-L82 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/QATushare.py | cover_time | def cover_time(date):
"""
字符串 '20180101' 转变成 float 类型时间 类似 time.time() 返回的类型
:param date: 字符串str -- 格式必须是 20180101 ,长度8
:return: 类型float
"""
datestr = str(date)[0:8]
date = time.mktime(time.strptime(datestr, '%Y%m%d'))
return date | python | def cover_time(date):
"""
字符串 '20180101' 转变成 float 类型时间 类似 time.time() 返回的类型
:param date: 字符串str -- 格式必须是 20180101 ,长度8
:return: 类型float
"""
datestr = str(date)[0:8]
date = time.mktime(time.strptime(datestr, '%Y%m%d'))
return date | [
"def",
"cover_time",
"(",
"date",
")",
":",
"datestr",
"=",
"str",
"(",
"date",
")",
"[",
"0",
":",
"8",
"]",
"date",
"=",
"time",
".",
"mktime",
"(",
"time",
".",
"strptime",
"(",
"datestr",
",",
"'%Y%m%d'",
")",
")",
"return",
"date"
] | 字符串 '20180101' 转变成 float 类型时间 类似 time.time() 返回的类型
:param date: 字符串str -- 格式必须是 20180101 ,长度8
:return: 类型float | [
"字符串",
"20180101",
"转变成",
"float",
"类型时间",
"类似",
"time",
".",
"time",
"()",
"返回的类型",
":",
"param",
"date",
":",
"字符串str",
"--",
"格式必须是",
"20180101",
",长度8",
":",
"return",
":",
"类型float"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/QATushare.py#L109-L117 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/QABlockStruct.py | QA_DataStruct_Stock_block.new | def new(self, data):
"""通过data新建一个stock_block
Arguments:
data {[type]} -- [description]
Returns:
[type] -- [description]
"""
temp = copy(self)
temp.__init__(data)
return temp | python | def new(self, data):
"""通过data新建一个stock_block
Arguments:
data {[type]} -- [description]
Returns:
[type] -- [description]
"""
temp = copy(self)
temp.__init__(data)
return temp | [
"def",
"new",
"(",
"self",
",",
"data",
")",
":",
"temp",
"=",
"copy",
"(",
"self",
")",
"temp",
".",
"__init__",
"(",
"data",
")",
"return",
"temp"
] | 通过data新建一个stock_block
Arguments:
data {[type]} -- [description]
Returns:
[type] -- [description] | [
"通过data新建一个stock_block"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/QABlockStruct.py#L50-L61 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/QABlockStruct.py | QA_DataStruct_Stock_block.view_code | def view_code(self):
"""按股票排列的查看blockname的视图
Returns:
[type] -- [description]
"""
return self.data.groupby(level=1).apply(
lambda x:
[item for item in x.index.remove_unused_levels().levels[0]]
) | python | def view_code(self):
"""按股票排列的查看blockname的视图
Returns:
[type] -- [description]
"""
return self.data.groupby(level=1).apply(
lambda x:
[item for item in x.index.remove_unused_levels().levels[0]]
) | [
"def",
"view_code",
"(",
"self",
")",
":",
"return",
"self",
".",
"data",
".",
"groupby",
"(",
"level",
"=",
"1",
")",
".",
"apply",
"(",
"lambda",
"x",
":",
"[",
"item",
"for",
"item",
"in",
"x",
".",
"index",
".",
"remove_unused_levels",
"(",
")"... | 按股票排列的查看blockname的视图
Returns:
[type] -- [description] | [
"按股票排列的查看blockname的视图"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/QABlockStruct.py#L94-L104 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/QABlockStruct.py | QA_DataStruct_Stock_block.get_code | def get_code(self, code):
"""getcode 获取某一只股票的板块
Arguments:
code {str} -- 股票代码
Returns:
DataStruct -- [description]
"""
# code= [code] if isinstance(code,str) else
return self.new(self.data.loc[(slice(None), code), :]) | python | def get_code(self, code):
"""getcode 获取某一只股票的板块
Arguments:
code {str} -- 股票代码
Returns:
DataStruct -- [description]
"""
# code= [code] if isinstance(code,str) else
return self.new(self.data.loc[(slice(None), code), :]) | [
"def",
"get_code",
"(",
"self",
",",
"code",
")",
":",
"# code= [code] if isinstance(code,str) else",
"return",
"self",
".",
"new",
"(",
"self",
".",
"data",
".",
"loc",
"[",
"(",
"slice",
"(",
"None",
")",
",",
"code",
")",
",",
":",
"]",
")"
] | getcode 获取某一只股票的板块
Arguments:
code {str} -- 股票代码
Returns:
DataStruct -- [description] | [
"getcode",
"获取某一只股票的板块"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/QABlockStruct.py#L128-L138 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/QABlockStruct.py | QA_DataStruct_Stock_block.get_block | def get_block(self, block_name):
"""getblock 获取板块, block_name是list或者是单个str
Arguments:
block_name {[type]} -- [description]
Returns:
[type] -- [description]
"""
# block_name = [block_name] if isinstance(
# block_name, str) else block_name
... | python | def get_block(self, block_name):
"""getblock 获取板块, block_name是list或者是单个str
Arguments:
block_name {[type]} -- [description]
Returns:
[type] -- [description]
"""
# block_name = [block_name] if isinstance(
# block_name, str) else block_name
... | [
"def",
"get_block",
"(",
"self",
",",
"block_name",
")",
":",
"# block_name = [block_name] if isinstance(",
"# block_name, str) else block_name",
"# return QA_DataStruct_Stock_block(self.data[self.data.blockname.apply(lambda x: x in block_name)])",
"return",
"self",
".",
"new",
"("... | getblock 获取板块, block_name是list或者是单个str
Arguments:
block_name {[type]} -- [description]
Returns:
[type] -- [description] | [
"getblock",
"获取板块",
"block_name是list或者是单个str"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/QABlockStruct.py#L140-L153 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/QABlockStruct.py | QA_DataStruct_Stock_block.get_both_code | def get_both_code(self, code):
"""get_both_code 获取几个股票相同的版块
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description]
"""
return self.new(self.data.loc[(slice(None), code), :]) | python | def get_both_code(self, code):
"""get_both_code 获取几个股票相同的版块
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description]
"""
return self.new(self.data.loc[(slice(None), code), :]) | [
"def",
"get_both_code",
"(",
"self",
",",
"code",
")",
":",
"return",
"self",
".",
"new",
"(",
"self",
".",
"data",
".",
"loc",
"[",
"(",
"slice",
"(",
"None",
")",
",",
"code",
")",
",",
":",
"]",
")"
] | get_both_code 获取几个股票相同的版块
Arguments:
code {[type]} -- [description]
Returns:
[type] -- [description] | [
"get_both_code",
"获取几个股票相同的版块",
"Arguments",
":",
"code",
"{",
"[",
"type",
"]",
"}",
"--",
"[",
"description",
"]",
"Returns",
":",
"[",
"type",
"]",
"--",
"[",
"description",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/QABlockStruct.py#L155-L165 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/Fetcher.py | QA_get_tick | def QA_get_tick(code, start, end, market):
"""
统一的获取期货/股票tick的接口
"""
res = None
if market == MARKET_TYPE.STOCK_CN:
res = QATdx.QA_fetch_get_stock_transaction(code, start, end)
elif market == MARKET_TYPE.FUTURE_CN:
res = QATdx.QA_fetch_get_future_transaction(code, start, end)
... | python | def QA_get_tick(code, start, end, market):
"""
统一的获取期货/股票tick的接口
"""
res = None
if market == MARKET_TYPE.STOCK_CN:
res = QATdx.QA_fetch_get_stock_transaction(code, start, end)
elif market == MARKET_TYPE.FUTURE_CN:
res = QATdx.QA_fetch_get_future_transaction(code, start, end)
... | [
"def",
"QA_get_tick",
"(",
"code",
",",
"start",
",",
"end",
",",
"market",
")",
":",
"res",
"=",
"None",
"if",
"market",
"==",
"MARKET_TYPE",
".",
"STOCK_CN",
":",
"res",
"=",
"QATdx",
".",
"QA_fetch_get_stock_transaction",
"(",
"code",
",",
"start",
",... | 统一的获取期货/股票tick的接口 | [
"统一的获取期货",
"/",
"股票tick的接口"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/Fetcher.py#L93-L102 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/Fetcher.py | QA_get_realtime | def QA_get_realtime(code, market):
"""
统一的获取期货/股票实时行情的接口
"""
res = None
if market == MARKET_TYPE.STOCK_CN:
res = QATdx.QA_fetch_get_stock_realtime(code)
elif market == MARKET_TYPE.FUTURE_CN:
res = QATdx.QA_fetch_get_future_realtime(code)
return res | python | def QA_get_realtime(code, market):
"""
统一的获取期货/股票实时行情的接口
"""
res = None
if market == MARKET_TYPE.STOCK_CN:
res = QATdx.QA_fetch_get_stock_realtime(code)
elif market == MARKET_TYPE.FUTURE_CN:
res = QATdx.QA_fetch_get_future_realtime(code)
return res | [
"def",
"QA_get_realtime",
"(",
"code",
",",
"market",
")",
":",
"res",
"=",
"None",
"if",
"market",
"==",
"MARKET_TYPE",
".",
"STOCK_CN",
":",
"res",
"=",
"QATdx",
".",
"QA_fetch_get_stock_realtime",
"(",
"code",
")",
"elif",
"market",
"==",
"MARKET_TYPE",
... | 统一的获取期货/股票实时行情的接口 | [
"统一的获取期货",
"/",
"股票实时行情的接口"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/Fetcher.py#L105-L115 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAFetch/Fetcher.py | QA_quotation | def QA_quotation(code, start, end, frequence, market, source=DATASOURCE.TDX, output=OUTPUT_FORMAT.DATAFRAME):
"""一个统一的获取k线的方法
如果使用mongo,从本地数据库获取,失败则在线获取
Arguments:
code {str/list} -- 期货/股票的代码
start {str} -- 开始日期
end {str} -- 结束日期
frequence {enum} -- 频率 QA.FREQUENCE
m... | python | def QA_quotation(code, start, end, frequence, market, source=DATASOURCE.TDX, output=OUTPUT_FORMAT.DATAFRAME):
"""一个统一的获取k线的方法
如果使用mongo,从本地数据库获取,失败则在线获取
Arguments:
code {str/list} -- 期货/股票的代码
start {str} -- 开始日期
end {str} -- 结束日期
frequence {enum} -- 频率 QA.FREQUENCE
m... | [
"def",
"QA_quotation",
"(",
"code",
",",
"start",
",",
"end",
",",
"frequence",
",",
"market",
",",
"source",
"=",
"DATASOURCE",
".",
"TDX",
",",
"output",
"=",
"OUTPUT_FORMAT",
".",
"DATAFRAME",
")",
":",
"res",
"=",
"None",
"if",
"market",
"==",
"MAR... | 一个统一的获取k线的方法
如果使用mongo,从本地数据库获取,失败则在线获取
Arguments:
code {str/list} -- 期货/股票的代码
start {str} -- 开始日期
end {str} -- 结束日期
frequence {enum} -- 频率 QA.FREQUENCE
market {enum} -- 市场 QA.MARKET_TYPE
source {enum} -- 来源 QA.DATASOURCE
output {enum} -- 输出类型 QA.OUTPUT_F... | [
"一个统一的获取k线的方法",
"如果使用mongo",
"从本地数据库获取",
"失败则在线获取"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAFetch/Fetcher.py#L118-L201 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAUtil/QARandom.py | QA_util_random_with_zh_stock_code | def QA_util_random_with_zh_stock_code(stockNumber=10):
'''
随机生成股票代码
:param stockNumber: 生成个数
:return: ['60XXXX', '00XXXX', '300XXX']
'''
codeList = []
pt = 0
for i in range(stockNumber):
if pt == 0:
#print("random 60XXXX")
iCode = random.randint(600000, 6... | python | def QA_util_random_with_zh_stock_code(stockNumber=10):
'''
随机生成股票代码
:param stockNumber: 生成个数
:return: ['60XXXX', '00XXXX', '300XXX']
'''
codeList = []
pt = 0
for i in range(stockNumber):
if pt == 0:
#print("random 60XXXX")
iCode = random.randint(600000, 6... | [
"def",
"QA_util_random_with_zh_stock_code",
"(",
"stockNumber",
"=",
"10",
")",
":",
"codeList",
"=",
"[",
"]",
"pt",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"stockNumber",
")",
":",
"if",
"pt",
"==",
"0",
":",
"#print(\"random 60XXXX\")",
"iCode",
"=",
... | 随机生成股票代码
:param stockNumber: 生成个数
:return: ['60XXXX', '00XXXX', '300XXX'] | [
"随机生成股票代码",
":",
"param",
"stockNumber",
":",
"生成个数",
":",
"return",
":",
"[",
"60XXXX",
"00XXXX",
"300XXX",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAUtil/QARandom.py#L28-L63 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAUtil/QARandom.py | QA_util_random_with_topic | def QA_util_random_with_topic(topic='Acc', lens=8):
"""
生成account随机值
Acc+4数字id+4位大小写随机
"""
_list = [chr(i) for i in range(65,
91)] + [chr(i) for i in range(97,
123)
... | python | def QA_util_random_with_topic(topic='Acc', lens=8):
"""
生成account随机值
Acc+4数字id+4位大小写随机
"""
_list = [chr(i) for i in range(65,
91)] + [chr(i) for i in range(97,
123)
... | [
"def",
"QA_util_random_with_topic",
"(",
"topic",
"=",
"'Acc'",
",",
"lens",
"=",
"8",
")",
":",
"_list",
"=",
"[",
"chr",
"(",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"65",
",",
"91",
")",
"]",
"+",
"[",
"chr",
"(",
"i",
")",
"for",
"i",
"... | 生成account随机值
Acc+4数字id+4位大小写随机 | [
"生成account随机值"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAUtil/QARandom.py#L66-L79 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAMarket/QAPosition.py | QA_Position.update_pos | def update_pos(self, price, amount, towards):
"""支持股票/期货的更新仓位
Arguments:
price {[type]} -- [description]
amount {[type]} -- [description]
towards {[type]} -- [description]
margin: 30080
margin_long: 0
margin_short: 30080
... | python | def update_pos(self, price, amount, towards):
"""支持股票/期货的更新仓位
Arguments:
price {[type]} -- [description]
amount {[type]} -- [description]
towards {[type]} -- [description]
margin: 30080
margin_long: 0
margin_short: 30080
... | [
"def",
"update_pos",
"(",
"self",
",",
"price",
",",
"amount",
",",
"towards",
")",
":",
"temp_cost",
"=",
"amount",
"*",
"price",
"*",
"self",
".",
"market_preset",
".",
"get",
"(",
"'unit_table'",
",",
"1",
")",
"# if towards == ORDER_DIRECTION.SELL_CLOSE:",... | 支持股票/期货的更新仓位
Arguments:
price {[type]} -- [description]
amount {[type]} -- [description]
towards {[type]} -- [description]
margin: 30080
margin_long: 0
margin_short: 30080
open_cost_long: 0
open_cost_short: 419100
... | [
"支持股票",
"/",
"期货的更新仓位"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAMarket/QAPosition.py#L265-L373 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAMarket/QAPosition.py | QA_Position.settle | def settle(self):
"""收盘后的结算事件
"""
self.volume_long_his += self.volume_long_today
self.volume_long_today = 0
self.volume_long_frozen_today = 0
self.volume_short_his += self.volume_short_today
self.volume_short_today = 0
self.volume_short_frozen_today = 0 | python | def settle(self):
"""收盘后的结算事件
"""
self.volume_long_his += self.volume_long_today
self.volume_long_today = 0
self.volume_long_frozen_today = 0
self.volume_short_his += self.volume_short_today
self.volume_short_today = 0
self.volume_short_frozen_today = 0 | [
"def",
"settle",
"(",
"self",
")",
":",
"self",
".",
"volume_long_his",
"+=",
"self",
".",
"volume_long_today",
"self",
".",
"volume_long_today",
"=",
"0",
"self",
".",
"volume_long_frozen_today",
"=",
"0",
"self",
".",
"volume_short_his",
"+=",
"self",
".",
... | 收盘后的结算事件 | [
"收盘后的结算事件"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAMarket/QAPosition.py#L377-L385 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAMarket/QAPosition.py | QA_Position.close_available | def close_available(self):
"""可平仓数量
Returns:
[type] -- [description]
"""
return {
'volume_long': self.volume_long - self.volume_long_frozen,
'volume_short': self.volume_short - self.volume_short_frozen
} | python | def close_available(self):
"""可平仓数量
Returns:
[type] -- [description]
"""
return {
'volume_long': self.volume_long - self.volume_long_frozen,
'volume_short': self.volume_short - self.volume_short_frozen
} | [
"def",
"close_available",
"(",
"self",
")",
":",
"return",
"{",
"'volume_long'",
":",
"self",
".",
"volume_long",
"-",
"self",
".",
"volume_long_frozen",
",",
"'volume_short'",
":",
"self",
".",
"volume_short",
"-",
"self",
".",
"volume_short_frozen",
"}"
] | 可平仓数量
Returns:
[type] -- [description] | [
"可平仓数量"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAMarket/QAPosition.py#L395-L404 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAMarket/QAPosition.py | QA_PMS.orderAction | def orderAction(self, order:QA_Order):
"""
委托回报
"""
return self.pms[order.code][order.order_id].receive_order(order) | python | def orderAction(self, order:QA_Order):
"""
委托回报
"""
return self.pms[order.code][order.order_id].receive_order(order) | [
"def",
"orderAction",
"(",
"self",
",",
"order",
":",
"QA_Order",
")",
":",
"return",
"self",
".",
"pms",
"[",
"order",
".",
"code",
"]",
"[",
"order",
".",
"order_id",
"]",
".",
"receive_order",
"(",
"order",
")"
] | 委托回报 | [
"委托回报"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAMarket/QAPosition.py#L464-L468 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/save_jq.py | QA_SU_save_stock_min | def QA_SU_save_stock_min(client=DATABASE, ui_log=None, ui_progress=None):
"""
聚宽实现方式
save current day's stock_min data
"""
# 导入聚宽模块且进行登录
try:
import jqdatasdk
# 请自行将 JQUSERNAME 和 JQUSERPASSWD 修改为自己的账号密码
jqdatasdk.auth("JQUSERNAME", "JQUSERPASSWD")
except:
rais... | python | def QA_SU_save_stock_min(client=DATABASE, ui_log=None, ui_progress=None):
"""
聚宽实现方式
save current day's stock_min data
"""
# 导入聚宽模块且进行登录
try:
import jqdatasdk
# 请自行将 JQUSERNAME 和 JQUSERPASSWD 修改为自己的账号密码
jqdatasdk.auth("JQUSERNAME", "JQUSERPASSWD")
except:
rais... | [
"def",
"QA_SU_save_stock_min",
"(",
"client",
"=",
"DATABASE",
",",
"ui_log",
"=",
"None",
",",
"ui_progress",
"=",
"None",
")",
":",
"# 导入聚宽模块且进行登录",
"try",
":",
"import",
"jqdatasdk",
"# 请自行将 JQUSERNAME 和 JQUSERPASSWD 修改为自己的账号密码",
"jqdatasdk",
".",
"auth",
"(",
... | 聚宽实现方式
save current day's stock_min data | [
"聚宽实现方式",
"save",
"current",
"day",
"s",
"stock_min",
"data"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/save_jq.py#L34-L207 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/executor.py | execute | def execute(command, shell=None, working_dir=".", echo=False, echo_indent=0):
"""Execute a command on the command-line.
:param str,list command: The command to run
:param bool shell: Whether or not to use the shell. This is optional; if
``command`` is a basestring, shell will be set to True, otherw... | python | def execute(command, shell=None, working_dir=".", echo=False, echo_indent=0):
"""Execute a command on the command-line.
:param str,list command: The command to run
:param bool shell: Whether or not to use the shell. This is optional; if
``command`` is a basestring, shell will be set to True, otherw... | [
"def",
"execute",
"(",
"command",
",",
"shell",
"=",
"None",
",",
"working_dir",
"=",
"\".\"",
",",
"echo",
"=",
"False",
",",
"echo_indent",
"=",
"0",
")",
":",
"if",
"shell",
"is",
"None",
":",
"shell",
"=",
"True",
"if",
"isinstance",
"(",
"comman... | Execute a command on the command-line.
:param str,list command: The command to run
:param bool shell: Whether or not to use the shell. This is optional; if
``command`` is a basestring, shell will be set to True, otherwise it will
be false. You can override this behavior by setting this paramet... | [
"Execute",
"a",
"command",
"on",
"the",
"command",
"-",
"line",
".",
":",
"param",
"str",
"list",
"command",
":",
"The",
"command",
"to",
"run",
":",
"param",
"bool",
"shell",
":",
"Whether",
"or",
"not",
"to",
"use",
"the",
"shell",
".",
"This",
"is... | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/executor.py#L33-L71 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_marketvalue.py | QA_data_calc_marketvalue | def QA_data_calc_marketvalue(data, xdxr):
'使用数据库数据计算复权'
mv = xdxr.query('category!=6').loc[:,
['shares_after',
'liquidity_after']].dropna()
res = pd.concat([data, mv], axis=1)
res = res.assign(
shares=res.shares_afte... | python | def QA_data_calc_marketvalue(data, xdxr):
'使用数据库数据计算复权'
mv = xdxr.query('category!=6').loc[:,
['shares_after',
'liquidity_after']].dropna()
res = pd.concat([data, mv], axis=1)
res = res.assign(
shares=res.shares_afte... | [
"def",
"QA_data_calc_marketvalue",
"(",
"data",
",",
"xdxr",
")",
":",
"mv",
"=",
"xdxr",
".",
"query",
"(",
"'category!=6'",
")",
".",
"loc",
"[",
":",
",",
"[",
"'shares_after'",
",",
"'liquidity_after'",
"]",
"]",
".",
"dropna",
"(",
")",
"res",
"="... | 使用数据库数据计算复权 | [
"使用数据库数据计算复权"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_marketvalue.py#L32-L44 | train |
QUANTAXIS/QUANTAXIS | EXAMPLE/4_回测实盘交易/回测/股票回测/超级简化版回测/MACD_JCSC.py | MACD_JCSC | def MACD_JCSC(dataframe, SHORT=12, LONG=26, M=9):
"""
1.DIF向上突破DEA,买入信号参考。
2.DIF向下跌破DEA,卖出信号参考。
"""
CLOSE = dataframe.close
DIFF = QA.EMA(CLOSE, SHORT) - QA.EMA(CLOSE, LONG)
DEA = QA.EMA(DIFF, M)
MACD = 2*(DIFF-DEA)
CROSS_JC = QA.CROSS(DIFF, DEA)
CROSS_SC = QA.CROSS(DEA, DIFF)
... | python | def MACD_JCSC(dataframe, SHORT=12, LONG=26, M=9):
"""
1.DIF向上突破DEA,买入信号参考。
2.DIF向下跌破DEA,卖出信号参考。
"""
CLOSE = dataframe.close
DIFF = QA.EMA(CLOSE, SHORT) - QA.EMA(CLOSE, LONG)
DEA = QA.EMA(DIFF, M)
MACD = 2*(DIFF-DEA)
CROSS_JC = QA.CROSS(DIFF, DEA)
CROSS_SC = QA.CROSS(DEA, DIFF)
... | [
"def",
"MACD_JCSC",
"(",
"dataframe",
",",
"SHORT",
"=",
"12",
",",
"LONG",
"=",
"26",
",",
"M",
"=",
"9",
")",
":",
"CLOSE",
"=",
"dataframe",
".",
"close",
"DIFF",
"=",
"QA",
".",
"EMA",
"(",
"CLOSE",
",",
"SHORT",
")",
"-",
"QA",
".",
"EMA",... | 1.DIF向上突破DEA,买入信号参考。
2.DIF向下跌破DEA,卖出信号参考。 | [
"1",
".",
"DIF向上突破DEA,买入信号参考。",
"2",
".",
"DIF向下跌破DEA,卖出信号参考。"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/EXAMPLE/4_回测实盘交易/回测/股票回测/超级简化版回测/MACD_JCSC.py#L13-L26 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/cache.py | Cache._create | def _create(self, cache_file):
"""Create the tables needed to store the information."""
conn = sqlite3.connect(cache_file)
cur = conn.cursor()
cur.execute("PRAGMA foreign_keys = ON")
cur.execute('''
CREATE TABLE jobs(
hash TEXT NOT NULL UNIQUE PRIMARY ... | python | def _create(self, cache_file):
"""Create the tables needed to store the information."""
conn = sqlite3.connect(cache_file)
cur = conn.cursor()
cur.execute("PRAGMA foreign_keys = ON")
cur.execute('''
CREATE TABLE jobs(
hash TEXT NOT NULL UNIQUE PRIMARY ... | [
"def",
"_create",
"(",
"self",
",",
"cache_file",
")",
":",
"conn",
"=",
"sqlite3",
".",
"connect",
"(",
"cache_file",
")",
"cur",
"=",
"conn",
".",
"cursor",
"(",
")",
"cur",
".",
"execute",
"(",
"\"PRAGMA foreign_keys = ON\"",
")",
"cur",
".",
"execute... | Create the tables needed to store the information. | [
"Create",
"the",
"tables",
"needed",
"to",
"store",
"the",
"information",
"."
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/cache.py#L68-L84 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/cache.py | Cache.get | def get(self, id):
"""Retrieves the job with the selected ID.
:param str id: The ID of the job
:returns: The dictionary of the job if found, None otherwise
"""
self.cur.execute("SELECT * FROM jobs WHERE hash=?", (id,))
item = self.cur.fetchone()
if item:
... | python | def get(self, id):
"""Retrieves the job with the selected ID.
:param str id: The ID of the job
:returns: The dictionary of the job if found, None otherwise
"""
self.cur.execute("SELECT * FROM jobs WHERE hash=?", (id,))
item = self.cur.fetchone()
if item:
... | [
"def",
"get",
"(",
"self",
",",
"id",
")",
":",
"self",
".",
"cur",
".",
"execute",
"(",
"\"SELECT * FROM jobs WHERE hash=?\"",
",",
"(",
"id",
",",
")",
")",
"item",
"=",
"self",
".",
"cur",
".",
"fetchone",
"(",
")",
"if",
"item",
":",
"return",
... | Retrieves the job with the selected ID.
:param str id: The ID of the job
:returns: The dictionary of the job if found, None otherwise | [
"Retrieves",
"the",
"job",
"with",
"the",
"selected",
"ID",
".",
":",
"param",
"str",
"id",
":",
"The",
"ID",
"of",
"the",
"job",
":",
"returns",
":",
"The",
"dictionary",
"of",
"the",
"job",
"if",
"found",
"None",
"otherwise"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/cache.py#L93-L105 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/cache.py | Cache.update | def update(self, job):
"""Update last_run, next_run, and last_run_result for an existing job.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute('''UPDATE jobs
SET last_run=?,next_run=?,last_run_result=? WHERE hash=?''', (
job["last-ru... | python | def update(self, job):
"""Update last_run, next_run, and last_run_result for an existing job.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute('''UPDATE jobs
SET last_run=?,next_run=?,last_run_result=? WHERE hash=?''', (
job["last-ru... | [
"def",
"update",
"(",
"self",
",",
"job",
")",
":",
"self",
".",
"cur",
".",
"execute",
"(",
"'''UPDATE jobs\n SET last_run=?,next_run=?,last_run_result=? WHERE hash=?'''",
",",
"(",
"job",
"[",
"\"last-run\"",
"]",
",",
"job",
"[",
"\"next-run\"",
"]",
... | Update last_run, next_run, and last_run_result for an existing job.
:param dict job: The job dictionary
:returns: True | [
"Update",
"last_run",
"next_run",
"and",
"last_run_result",
"for",
"an",
"existing",
"job",
".",
":",
"param",
"dict",
"job",
":",
"The",
"job",
"dictionary",
":",
"returns",
":",
"True"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/cache.py#L107-L114 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/cache.py | Cache.add_job | def add_job(self, job):
"""Adds a new job into the cache.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute("INSERT INTO jobs VALUES(?,?,?,?,?)", (
job["id"], job["description"], job["last-run"], job["next-run"], job["last-run-result"]))
... | python | def add_job(self, job):
"""Adds a new job into the cache.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute("INSERT INTO jobs VALUES(?,?,?,?,?)", (
job["id"], job["description"], job["last-run"], job["next-run"], job["last-run-result"]))
... | [
"def",
"add_job",
"(",
"self",
",",
"job",
")",
":",
"self",
".",
"cur",
".",
"execute",
"(",
"\"INSERT INTO jobs VALUES(?,?,?,?,?)\"",
",",
"(",
"job",
"[",
"\"id\"",
"]",
",",
"job",
"[",
"\"description\"",
"]",
",",
"job",
"[",
"\"last-run\"",
"]",
",... | Adds a new job into the cache.
:param dict job: The job dictionary
:returns: True | [
"Adds",
"a",
"new",
"job",
"into",
"the",
"cache",
".",
":",
"param",
"dict",
"job",
":",
"The",
"job",
"dictionary",
":",
"returns",
":",
"True"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/cache.py#L116-L124 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASetting/cache.py | Cache.add_result | def add_result(self, job):
"""Adds a job run result to the history table.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute(
"INSERT INTO history VALUES(?,?,?,?)",
(job["id"], job["description"], job["last-run"], job["last-run-result"... | python | def add_result(self, job):
"""Adds a job run result to the history table.
:param dict job: The job dictionary
:returns: True
"""
self.cur.execute(
"INSERT INTO history VALUES(?,?,?,?)",
(job["id"], job["description"], job["last-run"], job["last-run-result"... | [
"def",
"add_result",
"(",
"self",
",",
"job",
")",
":",
"self",
".",
"cur",
".",
"execute",
"(",
"\"INSERT INTO history VALUES(?,?,?,?)\"",
",",
"(",
"job",
"[",
"\"id\"",
"]",
",",
"job",
"[",
"\"description\"",
"]",
",",
"job",
"[",
"\"last-run\"",
"]",
... | Adds a job run result to the history table.
:param dict job: The job dictionary
:returns: True | [
"Adds",
"a",
"job",
"run",
"result",
"to",
"the",
"history",
"table",
".",
":",
"param",
"dict",
"job",
":",
"The",
"job",
"dictionary",
":",
"returns",
":",
"True"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASetting/cache.py#L126-L135 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_tick_resample_1min | def QA_data_tick_resample_1min(tick, type_='1min', if_drop=True):
"""
tick 采样为 分钟数据
1. 仅使用将 tick 采样为 1 分钟数据
2. 仅测试过,与通达信 1 分钟数据达成一致
3. 经测试,可以匹配 QA.QA_fetch_get_stock_transaction 得到的数据,其他类型数据未测试
demo:
df = QA.QA_fetch_get_stock_transaction(package='tdx', code='000001',
... | python | def QA_data_tick_resample_1min(tick, type_='1min', if_drop=True):
"""
tick 采样为 分钟数据
1. 仅使用将 tick 采样为 1 分钟数据
2. 仅测试过,与通达信 1 分钟数据达成一致
3. 经测试,可以匹配 QA.QA_fetch_get_stock_transaction 得到的数据,其他类型数据未测试
demo:
df = QA.QA_fetch_get_stock_transaction(package='tdx', code='000001',
... | [
"def",
"QA_data_tick_resample_1min",
"(",
"tick",
",",
"type_",
"=",
"'1min'",
",",
"if_drop",
"=",
"True",
")",
":",
"tick",
"=",
"tick",
".",
"assign",
"(",
"amount",
"=",
"tick",
".",
"price",
"*",
"tick",
".",
"vol",
")",
"resx",
"=",
"pd",
".",
... | tick 采样为 分钟数据
1. 仅使用将 tick 采样为 1 分钟数据
2. 仅测试过,与通达信 1 分钟数据达成一致
3. 经测试,可以匹配 QA.QA_fetch_get_stock_transaction 得到的数据,其他类型数据未测试
demo:
df = QA.QA_fetch_get_stock_transaction(package='tdx', code='000001',
start='2018-08-01 09:25:00',
... | [
"tick",
"采样为",
"分钟数据",
"1",
".",
"仅使用将",
"tick",
"采样为",
"1",
"分钟数据",
"2",
".",
"仅测试过,与通达信",
"1",
"分钟数据达成一致",
"3",
".",
"经测试,可以匹配",
"QA",
".",
"QA_fetch_get_stock_transaction",
"得到的数据,其他类型数据未测试",
"demo",
":",
"df",
"=",
"QA",
".",
"QA_fetch_get_stock_transactio... | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L30-L201 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_tick_resample | def QA_data_tick_resample(tick, type_='1min'):
"""tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description]
"""
tick = tick.assign(amount=tick.price * tick.vol)
resx = pd.DataFrame()
_temp = set(tick.index.date)
for item in _temp:
... | python | def QA_data_tick_resample(tick, type_='1min'):
"""tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description]
"""
tick = tick.assign(amount=tick.price * tick.vol)
resx = pd.DataFrame()
_temp = set(tick.index.date)
for item in _temp:
... | [
"def",
"QA_data_tick_resample",
"(",
"tick",
",",
"type_",
"=",
"'1min'",
")",
":",
"tick",
"=",
"tick",
".",
"assign",
"(",
"amount",
"=",
"tick",
".",
"price",
"*",
"tick",
".",
"vol",
")",
"resx",
"=",
"pd",
".",
"DataFrame",
"(",
")",
"_temp",
... | tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description] | [
"tick采样成任意级别分钟线"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L204-L252 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_ctptick_resample | def QA_data_ctptick_resample(tick, type_='1min'):
"""tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description]
"""
resx = pd.DataFrame()
_temp = set(tick.TradingDay)
for item in _temp:
_data = tick.query('TradingDay=="{}"'.format(ite... | python | def QA_data_ctptick_resample(tick, type_='1min'):
"""tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description]
"""
resx = pd.DataFrame()
_temp = set(tick.TradingDay)
for item in _temp:
_data = tick.query('TradingDay=="{}"'.format(ite... | [
"def",
"QA_data_ctptick_resample",
"(",
"tick",
",",
"type_",
"=",
"'1min'",
")",
":",
"resx",
"=",
"pd",
".",
"DataFrame",
"(",
")",
"_temp",
"=",
"set",
"(",
"tick",
".",
"TradingDay",
")",
"for",
"item",
"in",
"_temp",
":",
"_data",
"=",
"tick",
"... | tick采样成任意级别分钟线
Arguments:
tick {[type]} -- transaction
Returns:
[type] -- [description] | [
"tick采样成任意级别分钟线"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L255-L344 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_min_resample | def QA_data_min_resample(min_data, type_='5min'):
"""分钟线采样成大周期
分钟线采样成子级别的分钟线
time+ OHLC==> resample
Arguments:
min {[type]} -- [description]
raw_type {[type]} -- [description]
new_type {[type]} -- [description]
"""
try:
min_data = min_data.reset_index().set_i... | python | def QA_data_min_resample(min_data, type_='5min'):
"""分钟线采样成大周期
分钟线采样成子级别的分钟线
time+ OHLC==> resample
Arguments:
min {[type]} -- [description]
raw_type {[type]} -- [description]
new_type {[type]} -- [description]
"""
try:
min_data = min_data.reset_index().set_i... | [
"def",
"QA_data_min_resample",
"(",
"min_data",
",",
"type_",
"=",
"'5min'",
")",
":",
"try",
":",
"min_data",
"=",
"min_data",
".",
"reset_index",
"(",
")",
".",
"set_index",
"(",
"'datetime'",
",",
"drop",
"=",
"False",
")",
"except",
":",
"min_data",
... | 分钟线采样成大周期
分钟线采样成子级别的分钟线
time+ OHLC==> resample
Arguments:
min {[type]} -- [description]
raw_type {[type]} -- [description]
new_type {[type]} -- [description] | [
"分钟线采样成大周期"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L347-L408 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_futuremin_resample | def QA_data_futuremin_resample(min_data, type_='5min'):
"""期货分钟线采样成大周期
分钟线采样成子级别的分钟线
future:
vol ==> trade
amount X
"""
min_data.tradeime = pd.to_datetime(min_data.tradetime)
CONVERSION = {
'code': 'first',
'open': 'first',
'high': 'max',
'low': 'min... | python | def QA_data_futuremin_resample(min_data, type_='5min'):
"""期货分钟线采样成大周期
分钟线采样成子级别的分钟线
future:
vol ==> trade
amount X
"""
min_data.tradeime = pd.to_datetime(min_data.tradetime)
CONVERSION = {
'code': 'first',
'open': 'first',
'high': 'max',
'low': 'min... | [
"def",
"QA_data_futuremin_resample",
"(",
"min_data",
",",
"type_",
"=",
"'5min'",
")",
":",
"min_data",
".",
"tradeime",
"=",
"pd",
".",
"to_datetime",
"(",
"min_data",
".",
"tradetime",
")",
"CONVERSION",
"=",
"{",
"'code'",
":",
"'first'",
",",
"'open'",
... | 期货分钟线采样成大周期
分钟线采样成子级别的分钟线
future:
vol ==> trade
amount X | [
"期货分钟线采样成大周期"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L411-L440 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QAData/data_resample.py | QA_data_day_resample | def QA_data_day_resample(day_data, type_='w'):
"""日线降采样
Arguments:
day_data {[type]} -- [description]
Keyword Arguments:
type_ {str} -- [description] (default: {'w'})
Returns:
[type] -- [description]
"""
# return day_data_p.assign(open=day_data.open.resample(type_).fir... | python | def QA_data_day_resample(day_data, type_='w'):
"""日线降采样
Arguments:
day_data {[type]} -- [description]
Keyword Arguments:
type_ {str} -- [description] (default: {'w'})
Returns:
[type] -- [description]
"""
# return day_data_p.assign(open=day_data.open.resample(type_).fir... | [
"def",
"QA_data_day_resample",
"(",
"day_data",
",",
"type_",
"=",
"'w'",
")",
":",
"# return day_data_p.assign(open=day_data.open.resample(type_).first(),high=day_data.high.resample(type_).max(),low=day_data.low.resample(type_).min(),\\",
"# vol=day_data.vol.resample(type_).sum() ... | 日线降采样
Arguments:
day_data {[type]} -- [description]
Keyword Arguments:
type_ {str} -- [description] (default: {'w'})
Returns:
[type] -- [description] | [
"日线降采样"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QAData/data_resample.py#L443-L485 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_stock_info | def QA_SU_save_stock_info(engine, client=DATABASE):
"""save stock info
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_info(client=client) | python | def QA_SU_save_stock_info(engine, client=DATABASE):
"""save stock info
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_info(client=client) | [
"def",
"QA_SU_save_stock_info",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_stock_info",
"(",
"client",
"=",
"client",
")"
] | save stock info
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"stock",
"info"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L38-L49 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_stock_list | def QA_SU_save_stock_list(engine, client=DATABASE):
"""save stock_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_list(client=client) | python | def QA_SU_save_stock_list(engine, client=DATABASE):
"""save stock_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_list(client=client) | [
"def",
"QA_SU_save_stock_list",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_stock_list",
"(",
"client",
"=",
"client",
")"
] | save stock_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"stock_list"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L67-L78 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_index_list | def QA_SU_save_index_list(engine, client=DATABASE):
"""save index_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_list(client=client) | python | def QA_SU_save_index_list(engine, client=DATABASE):
"""save index_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_list(client=client) | [
"def",
"QA_SU_save_index_list",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_index_list",
"(",
"client",
"=",
"client",
")"
] | save index_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"index_list"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L81-L92 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_etf_list | def QA_SU_save_etf_list(engine, client=DATABASE):
"""save etf_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_list(client=client) | python | def QA_SU_save_etf_list(engine, client=DATABASE):
"""save etf_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_list(client=client) | [
"def",
"QA_SU_save_etf_list",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_etf_list",
"(",
"client",
"=",
"client",
")"
] | save etf_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"etf_list"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L95-L106 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_future_list | def QA_SU_save_future_list(engine, client=DATABASE):
"""save future_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_list(client=client) | python | def QA_SU_save_future_list(engine, client=DATABASE):
"""save future_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_list(client=client) | [
"def",
"QA_SU_save_future_list",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_future_list",
"(",
"client",
"=",
"client",
")"
] | save future_list
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"future_list"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L109-L120 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_future_day | def QA_SU_save_future_day(engine, client=DATABASE):
"""save future_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_day(client=client) | python | def QA_SU_save_future_day(engine, client=DATABASE):
"""save future_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_day(client=client) | [
"def",
"QA_SU_save_future_day",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_future_day",
"(",
"client",
"=",
"client",
")"
] | save future_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"future_day"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L123-L134 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_future_day_all | def QA_SU_save_future_day_all(engine, client=DATABASE):
"""save future_day_all
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_day_all(client=... | python | def QA_SU_save_future_day_all(engine, client=DATABASE):
"""save future_day_all
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_day_all(client=... | [
"def",
"QA_SU_save_future_day_all",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_future_day_all",
"(",
"client",
"=",
"client",
")"
] | save future_day_all
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"future_day_all"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L137-L148 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_future_min | def QA_SU_save_future_min(engine, client=DATABASE):
"""save future_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_min(client=client) | python | def QA_SU_save_future_min(engine, client=DATABASE):
"""save future_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_min(client=client) | [
"def",
"QA_SU_save_future_min",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_future_min",
"(",
"client",
"=",
"client",
")"
] | save future_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"future_min",
"Arguments",
":",
"engine",
"{",
"[",
"type",
"]",
"}",
"--",
"[",
"description",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L151-L161 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_future_min_all | def QA_SU_save_future_min_all(engine, client=DATABASE):
"""[summary]
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_min_all(client=client) | python | def QA_SU_save_future_min_all(engine, client=DATABASE):
"""[summary]
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_future_min_all(client=client) | [
"def",
"QA_SU_save_future_min_all",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_future_min_all",
"(",
"client",
"=",
"client",
")"
] | [summary]
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"[",
"summary",
"]"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L164-L175 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_stock_day | def QA_SU_save_stock_day(engine, client=DATABASE, paralleled=False):
"""save stock_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine, paralleled=paralleled)
engine.QA... | python | def QA_SU_save_stock_day(engine, client=DATABASE, paralleled=False):
"""save stock_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine, paralleled=paralleled)
engine.QA... | [
"def",
"QA_SU_save_stock_day",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
",",
"paralleled",
"=",
"False",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
",",
"paralleled",
"=",
"paralleled",
")",
"engine",
".",
"QA_SU_save_stock_day",
"(",
... | save stock_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"stock_day"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L178-L189 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_option_commodity_min | def QA_SU_save_option_commodity_min(engine, client=DATABASE):
'''
:param engine:
:param client:
:return:
'''
engine = select_save_engine(engine)
engine.QA_SU_save_option_commodity_min(client=client) | python | def QA_SU_save_option_commodity_min(engine, client=DATABASE):
'''
:param engine:
:param client:
:return:
'''
engine = select_save_engine(engine)
engine.QA_SU_save_option_commodity_min(client=client) | [
"def",
"QA_SU_save_option_commodity_min",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_option_commodity_min",
"(",
"client",
"=",
"client",
")"
] | :param engine:
:param client:
:return: | [
":",
"param",
"engine",
":",
":",
"param",
"client",
":",
":",
"return",
":"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L225-L232 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_option_commodity_day | def QA_SU_save_option_commodity_day(engine, client=DATABASE):
'''
:param engine:
:param client:
:return:
'''
engine = select_save_engine(engine)
engine.QA_SU_save_option_commodity_day(client=client) | python | def QA_SU_save_option_commodity_day(engine, client=DATABASE):
'''
:param engine:
:param client:
:return:
'''
engine = select_save_engine(engine)
engine.QA_SU_save_option_commodity_day(client=client) | [
"def",
"QA_SU_save_option_commodity_day",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_option_commodity_day",
"(",
"client",
"=",
"client",
")"
] | :param engine:
:param client:
:return: | [
":",
"param",
"engine",
":",
":",
"param",
"client",
":",
":",
"return",
":"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L235-L242 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_stock_min | def QA_SU_save_stock_min(engine, client=DATABASE):
"""save stock_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_min(client=client) | python | def QA_SU_save_stock_min(engine, client=DATABASE):
"""save stock_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_stock_min(client=client) | [
"def",
"QA_SU_save_stock_min",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_stock_min",
"(",
"client",
"=",
"client",
")"
] | save stock_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"stock_min"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L245-L256 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_index_day | def QA_SU_save_index_day(engine, client=DATABASE):
"""save index_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_day(client=client) | python | def QA_SU_save_index_day(engine, client=DATABASE):
"""save index_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_day(client=client) | [
"def",
"QA_SU_save_index_day",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_index_day",
"(",
"client",
"=",
"client",
")"
] | save index_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"index_day"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L259-L270 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_index_min | def QA_SU_save_index_min(engine, client=DATABASE):
"""save index_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_min(client=client) | python | def QA_SU_save_index_min(engine, client=DATABASE):
"""save index_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_index_min(client=client) | [
"def",
"QA_SU_save_index_min",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_index_min",
"(",
"client",
"=",
"client",
")"
] | save index_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"index_min"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L273-L284 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_etf_day | def QA_SU_save_etf_day(engine, client=DATABASE):
"""save etf_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_day(client=client) | python | def QA_SU_save_etf_day(engine, client=DATABASE):
"""save etf_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_day(client=client) | [
"def",
"QA_SU_save_etf_day",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_etf_day",
"(",
"client",
"=",
"client",
")"
] | save etf_day
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"etf_day"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L287-L298 | train |
QUANTAXIS/QUANTAXIS | QUANTAXIS/QASU/main.py | QA_SU_save_etf_min | def QA_SU_save_etf_min(engine, client=DATABASE):
"""save etf_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_min(client=client) | python | def QA_SU_save_etf_min(engine, client=DATABASE):
"""save etf_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
engine = select_save_engine(engine)
engine.QA_SU_save_etf_min(client=client) | [
"def",
"QA_SU_save_etf_min",
"(",
"engine",
",",
"client",
"=",
"DATABASE",
")",
":",
"engine",
"=",
"select_save_engine",
"(",
"engine",
")",
"engine",
".",
"QA_SU_save_etf_min",
"(",
"client",
"=",
"client",
")"
] | save etf_min
Arguments:
engine {[type]} -- [description]
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE}) | [
"save",
"etf_min"
] | bb1fe424e4108b62a1f712b81a05cf829297a5c0 | https://github.com/QUANTAXIS/QUANTAXIS/blob/bb1fe424e4108b62a1f712b81a05cf829297a5c0/QUANTAXIS/QASU/main.py#L301-L312 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.