以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 请问为何图表上没有开平仓信号? (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=99153) |
|
-- 作者:jjjfk -- 发布时间:2016/6/20 11:05:38 -- 请问为何图表上没有开平仓信号? 我把系统双击应用于图表,但是图表没有显示开平仓信号,请问是怎么回事?谢谢!以下是代码和图表: //函数定义 a1:=valuewhen(todaybar=1,high); a2:=valuewhen(todaybar=1,low); a3:=time>=020000; a4:=time<230000; a5:=a3 and a4; a6:=time>=002300; //做多条件 if holding=0 and a5 and close>a1 then begin buy(1,1,marketr); end //平多条件 if holding>0 and close<a2 then begin sell(1,0,marketr); end //做空条件 if holding=0 and a5 and close<a2 then begin buyshort(1,1,marketr); end //平空条件 if holding<0 and close>a1 then begin sellshort(1,0,marketr); end //收盘平仓 if a6 and holding>0 then begin sell(1,0,marketr); end if a6 and holding<0 then begin sellshort(1,0,marketr); end |
|
-- 作者:jinzhe -- 发布时间:2016/6/20 11:16:31 -- 这边是有信号的, 全是信号 用户代码是不是用的不是上面给的?用下面的代码呢? a1:=valuewhen(todaybar=1,high);
|
|
-- 作者:jjjfk -- 发布时间:2016/6/20 11:34:35 -- 1.用户代码是不是用的不是上面给的? 代码是我自己写的,用的就是贴出来的代码; 2.用下面的代码呢? 我复制了您的代码,应用于图标,居然全是信号;我对比了我的代码和您的代码,我没看到有什么区别啊,为什么我用自己原来的代码不行,用你的就可以呢?
|
|
-- 作者:jinzhe -- 发布时间:2016/6/20 13:22:12 -- 你代码没编译或者用错代码之类的 |
|
-- 作者:jjjfk -- 发布时间:2016/6/20 13:53:05 --
|
|
-- 作者:jinzhe -- 发布时间:2016/6/20 14:01:00 -- 以下是引用jinzhe在2016-6-20 13:22:12的发言:
你代码没编译或者用错代码之类的 |