以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请老师帮忙、、、谢谢  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=78438)

--  作者:jinzhe
--  发布时间:2015/5/11 9:06:54
--  
处理中请稍等
--  作者:pyd
--  发布时间:2015/5/11 9:16:56
--  
if d1 and d2 and d3 and d4 then buy(holding=0,1,marketr);
if enterbars>=0 then sell(holding>0,holding,market);
if k1 and k2 and k3 and k4 and k5 then buyshort(holding=0,1,market);
if enterbars>=0 then sellshort(holding<0,holding,market);

--  作者:jinzhe
--  发布时间:2015/5/11 9:42:15
--  

market:市价下单

thisclose:对手价下单


--  作者:jinzhe
--  发布时间:2015/5/11 9:48:21
--  

不是

指的是开仓时的即时的市价和对手价


--  作者:jinzhe
--  发布时间:2015/5/11 9:48:49
--  
没有begin和end的,上面不是写了吗?
--  作者:pyd
--  发布时间:2015/5/11 9:49:39
--  

if d1 and d2 and d3 and d4 then buy(holding=0,1,marketr);
if enterbars>=0 then sell(holding>0,holding,market);
if k1 and k2 and k3 and k4 and k5 then buyshort(holding=0,1,market);
if enterbars>=0 then sellshort(holding<0,holding,market);
 
只有这4句不会提示缺少begin end 你是不是其他地方用了begin 少写了end?

把全部代码贴下

market是市价下单,thisclose是对手价,单根还是下跟下单取决于你是选择走完一根k还是固定时间间隔

[此贴子已经被作者于2015/5/11 9:50:16编辑过]

--  作者:jinzhe
--  发布时间:2015/5/11 10:22:08
--  
这单独的4句没有用end结尾的地方
--  作者:jinzhe
--  发布时间:2015/5/11 13:57:12
--  

把两句平仓语句里面的enterbars>=0 都改成

enterbars>0这样就不会同根k线平仓了  


--  作者:jinzhe
--  发布时间:2015/5/11 14:05:17
--  

把开仓语句里面的market改成marketr