金字塔里程序调用 自己定义函数,出问题
macd_sp1:=stkindi(sp1,'macd.macd1',0,dotime,0);
macd_sp1_1:=stkindi(sp1,'macd.MACD1',0,dotime,-1);
macd_sp1_2:=stkindi(sp1,'macd.MACD1',0,dotime,-2);
csp1:=checkmacd(macd_sp1,macd_sp1_1,macd_sp1_2); //调用自定义函数
vba 里的函数
Function checkmacd(Formula,sn1,sn2,sn3)
'系统会在逐K线模式解释公式时的每个周期都会调用此函数一遍,因此设计时应该注重程序的执行效
率,不要重复的执行一些没必要的代码
checkmacd=0
if sn1>0 and sn2<0 then checkmacd=1
if sn1>0 and sn2>0 and sn3<0 then checkmacd=1
if sn1<0 and sn2>0 then checkmacd=-1
if sn1<0 and sn2<0 and sn3>0 then checkmacd=-1
imsgBox checkmacd
End Function
出现vba 类型不匹配 13 是什么原因,麻烦告诉我一下,顺便 告诉我 vba怎么输出 消息到窗口,我主要是想看我的变量值是不是计算对了