HQChart使用教程70 -通达信指标翻译
指标翻译
为了方便指标阅读, 我们会把指标翻译成中文。
如:
VOL:VOL,VOLSTICK;
MA1:MA(VOL,M1);
MA2:MA(VOL,M2);
翻译成中文为
输出VOL: 成交量,画成交量柱状线
输出MA1: 成交量的M1日简单移动平均
输出MA2: 成交量的M2日简单移动平均
HQChart也支持翻译功能
翻译函数
JSComplier.Explain(code, option, errorcallback)
参数
code
指标脚本
option
{
Arguments: 参数数组,
Callback:成功回调函数,函数格式:function(data)
}
errorcallback
翻译失败回调函数
函数格式: function(error, data)
例子
var code="T:MA(C,10);";
var option=
{
Callback:(data)=>
{
console.log("[Explain] data ", data);
for(var i in data)
{
var item=data[i];
}
}
};
if (code)
{
JSComplier.Explain(code,option, (error, data)=>
{
console.log("[Explain] error, data ", error, data);
});
}
交流QQ群: 950092318
如果还有问题可以加交流QQ群