以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 高级功能研发区 (http://www.weistock.com/bbs/list.asp?boardid=5) ---- 交易程序问题 各位大神帮入门人士指点一下 (http://www.weistock.com/bbs/dispbbs.asp?boardid=5&id=137170) |
-- 作者:hnfxp -- 发布时间:2016/7/27 15:05:28 -- 交易程序问题 各位大神帮入门人士指点一下 Sub Fratrad1_executebutton1_Click() dim count dim exce1 dim HistroyData dim AC dim STOCK set AC=1698 set STOCK=IF08 if OptionButton1.check is true then set fx.value=1 end if if OptionButton2.check is true then set fx.value=0 end if if OptionButton3.check is true then set kp.value=1 end if if OptionButton4.check is true then set kp.value=1 end if order.OrderQueue = 1 Set HistroyData = marketdata.GetHistoryData(STOCK,AC,0) \'Set report2 = marketdata.GetReportData(Fratrad1_report2.text,Fratrad1_report2market) count=zgds.value \'多开 if fx.value=1 and kp.value=1 then for i = 0 to count-1
call ORDER.TBUY(1,1,HistroyData+100*i,0,0,AC,STOCK) end if \'多平 if fx.value=1 and kp.value=0 then for i = 0 to count-1 call ORDER.TSELL(1,1,HistroyData+100*i,0,0,AC,STOCK) end if \'空开 if fx.value=0 and kp.value=1 then for i = 0 to count-1 call ORDER.TSELL(1,1,HistroyData-100*i,0,0,AC,STOCK) end if \'空平 if fx.value=0 and kp.value=0 then for i = 0 to count-1 call
ORDER.TBUY(1,1,HistroyData-100*i,0,0,AC,STOCK) end if End Sub Sub Fratrad1_Load() End Sub |
-- 作者:王锋 -- 发布时间:2016/7/27 15:21:16 -- 请问你具体遇到了什么问题? |
-- 作者:hnfxp -- 发布时间:2016/7/27 15:42:20 -- 报错信息 我执行程序时出现下列报错信息 编译器错误 ‘1024’缺少语句
|
-- 作者:hnfxp -- 发布时间:2016/7/27 15:44:20 -- 交易程序报错信息 我怀疑是语法错误,但是看了好久好几个人看了,没有发现问题 |
-- 作者:hnfxp -- 发布时间:2016/7/27 16:09:55 -- 程序报错在40行 程序已经发到您邮箱了 |
-- 作者:王锋 -- 发布时间:2016/7/27 16:21:38 -- 请问哪行出的问题? |
-- 作者:yukizzc -- 发布时间:2016/7/27 16:50:03 -- for i = 0 to count-1
1、vb的for语法要跟上next的,这部分你可以百度vba for然后看下 2、vba的报单是order.Buy(1,1,0,0,"IF08","ZJ","") 请按照这个格式去完成你的参数那边全都乱了。 3、其他问题还没看到,建议您先把后面的命令全部注释掉,集中先把一个开仓指令完成正确后再加入其他的 |
-- 作者:hnfxp -- 发布时间:2016/7/27 17:11:42 -- 40行的时候停了 |
-- 作者:王锋 -- 发布时间:2016/7/27 17:41:16 -- 7楼给你答案了 |
-- 作者:hnfxp -- 发布时间:2016/7/28 8:55:21 -- 我做的界面中有执行按钮,实现执行,我写的有执行函数 |