QMT Python API

规模风向标

规模风向标

qmt://docs/python
Python
1# coding:gbk
2'''
3内置python,规模风向标
4'''
5
6def init(C):
7 return
8
9def after_init(C):
10 stockLst = ["000016.SH", "000300.SH", "000905.SH", "000852.SH"]
11 key = ["上证50", "沪深300", "中证500", "中证1000"]
12 value = []
13 
14 ticks = C.get_full_tick(stockLst)
15 for code in ticks:
16 tick = ticks[code]
17 value.append(str(round((tick['lastPrice'] / tick['lastClose'] - 1) * 100, 2)) + "%")
18 
19 data = dict(zip(key, value))
20 print(data)
21 return
22
23def handlebar(C):
24 return

智能助手

咨询式 AI · 带入当前文档

智能助手加载中...