【12.30帖子恢復】dsyang [求助]自定義函數應用
作者:金字塔 來源:cxh99.com 發布時間:2015年07月11日
- 咨詢內容:
金字塔里程序調用 自己定義函數,出問題
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怎么輸出 消息到窗口,我主要是想看我的變量值是不是計算對了
- 金字塔客服:
您好,對應使用逐K線模式試試