后台模型监控多个期货品种,如何编写条件(不用全局函数extgbdataset和extgbdata):
VARIABLE:n=0;
if daima=cf00 then n:=1;
if daima=au00 then n:=2;
..................
使代码能自动监测到当前刷到的是哪个品种,给n赋不同的值。
if stricmp(stklabel,'ag00')=0 then n:=1;
if stricmp(stklabel,'au00')=0 then n:=2;
if stricmp(stklabel,'cf00')=0 then n:=3;
if stricmp(stklabel,'rb00')=0 then n:=4;
if stricmp(stklabel,'ru00')=0 then n:=5;
这样的方法写,只要改品种代码就行