跳到正文
QMT

ContextInfo.paint

在界面上画图

原型

ContextInfo.paint(name, value, index, line_style, color='white', limit='')

在界面上画图

调用方法: 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':不画线

返回值

无

示例

def init(ContextInfo):
    realtimetag = ContextInfo.get_bar_timetag(ContextInfo.barpos)
    value = ContextInfo.get_close_price('', '', realtimetag) 
    ContextInfo.paint('close', value, -1, 0, 'white','noaxis')

官方来源

QMT 官方文档:在界面上画图。网页核对日期:2026-10-11。

本页目录