ContextInfo.paint - 在界面上画图
ContextInfo.paint 是 QMT 内置 Python 中用于在界面上画图的接口。
原型
ContextInfo.paint(name, value, index, line_style, color='white', limit='')
释义
ContextInfo.paint 是 QMT 内置 Python 中用于在界面上画图的接口。
研究:官方目录未明确;回测:官方目录未明确;模拟:官方目录未明确;实盘:官方目录未明确。
参数
| 参数 | 是否必填 | 官方原始定义 |
|---|---|---|
name |
是 | name |
value |
是 | value |
index |
是 | index |
line_style |
是 | line_style |
color |
否 | color='white' |
limit |
否 | limit='' |
返回值
以实际接口返回和下方详细说明为准。
示例
python
def init(ContextInfo):
realtimetag = ContextInfo.get_bar_timetag(ContextInfo.barpos)
value = ContextInfo.get_close_price('', '', realtimetag)
ContextInfo.paint('close', value, -1, 0, 'white','noaxis')
详细说明
在界面上画图
调用方法: ContextInfo.paint(name, value, index, line_style, color = 'white', limit = '')
参数详细说明
| 参数名 | 类型 | 说明 | 提示 |
|---|---|---|---|
| name | string | 需显示的指标名 | |
| value | number | 需显示的数值 | |
| index | number | 显示索引位置 | 填 -1 表示按主图索引显示 |
| line_style | number | 线型 | 0:曲线 / 42:柱状线 |
| color | string | 颜色(不填默认为白色) | blue:蓝色 / brown:棕 / cyan:蓝绿 / green:绿 / magenta:品红 / red:红 / white:白 / yellow:黄 |
| limit | string | 画线控制 | 'noaxis':不影响坐标画线 / 'nodraw':不画线 |
**返回:**无