subscribe_formula - 订阅模型

subscribe_formula 是 QMT 内置 Python 中用于订阅模型的接口。

原型

subscribe_formula( formula_name, stock_code, period, start_time="", end_time="", count=-1, dividend_type="none", extend_param={}, callback=None)

释义

subscribe_formula 是 QMT 内置 Python 中用于订阅模型的接口。

研究:官方目录未明确;回测:官方目录未明确;模拟:官方目录未明确;实盘:官方目录未明确。

参数

参数 是否必填 官方原始定义
formula_name formula_name
stock_code stock_code
period period
start_time start_time=""
end_time end_time=""
count count=-1
dividend_type dividend_type="none"
extend_param extend_param={}
callback callback=None

返回值

以实际接口返回和下方详细说明为准。

示例

示例

#encoding=gbk

def callback(data):

print(data)

def init(ContextInfo):

basket={

'600000.SH':0.06,

'000001.SZ':0.01

}

argsDict={'a':100,'__basket':basket}

subID=subscribe_formula(

'单股模型示范','000300.SH','1d',

'20240101','20240201',-1,

"none",

argsDict,

callback

)

详细说明