跳到正文
QMT

ContextInfo.draw_number

在图形上显示数字

原型

ContextInfo.draw_number(cond, height, number, precision)

在图形上显示数字

调用方法: ContextInfo.draw_number(cond, height, number, precision)

参数

参数名 类型 说明 提示
cond bool 条件
height number 显示文字的高度位置
text string 显示的数字
precision number 为小数显示位数 取值范围 0 - 7

返回值

无

示例

def init(ContextInfo):
    close = ContextInfo.get_market_data(['close'])   
    ContextInfo.draw_number(1 > 0, close, 66, 1)

官方来源

QMT 官方文档:在图形上显示数字。网页核对日期:2026-10-11。

本页目录