ContextInfo.draw_number - 在图形上显示数字
ContextInfo.draw_number 是 QMT 内置 Python 中用于在图形上显示数字的接口。
原型
ContextInfo.draw_number(cond, height, number, precision)
释义
ContextInfo.draw_number 是 QMT 内置 Python 中用于在图形上显示数字的接口。
研究:官方目录未明确;回测:官方目录未明确;模拟:官方目录未明确;实盘:官方目录未明确。
参数
| 参数 | 是否必填 | 官方原始定义 |
|---|---|---|
cond |
是 | cond |
height |
是 | height |
number |
是 | number |
precision |
是 | precision |
返回值
以实际接口返回和下方详细说明为准。
示例
def init(ContextInfo):
close = ContextInfo.get_market_data(['close'])
ContextInfo.draw_number(1 > 0, close, 66, 1)
详细说明
在图形上显示数字
调用方法: ContextInfo.draw_number(cond, height, number, precision)
参数详细说明
| 参数名 | 类型 | 说明 | 提示 |
|---|---|---|---|
| cond | bool | 条件 | |
| height | number | 显示文字的高度位置 | |
| text | string | 显示的数字 | |
| precision | number | 为小数显示位数 | 取值范围 0 - 7 |
**返回值:**无