以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  请问 为什么平仓不可以  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=97074)

--  作者:qq代人发帖
--  发布时间:2016/5/5 13:50:25
--  请问 为什么平仓不可以

ma9:ma(c,987);

if max(o,c)<ma9 and isdown then buyshort(holding=0,10,marketr);

if min(o,c)>ma9 and isup then sellshort(holding=10,10,marketr);


--  作者:yukizzc
--  发布时间:2016/5/5 13:56:24
--  
输出min(o,c)>ma9 and isup这个条件看下不满足的原因是什么
--  作者:wenarm
--  发布时间:2016/5/5 13:57:59
--  

if min(o,c)>ma9 and isup then sellshort(holding=10,10,marketr);

红色部分。使用HOLDING作为限制,空仓是负数,多仓是正数,没有仓位时0


--  作者:yukizzc
--  发布时间:2016/5/5 14:19:42
--  

开空条件:=cross(ma(c,60),c) and c<o;

平空条件:=cross(c,ma(c,60)) and c>o;

buyshort(开空条件,1,marketr);

sellshort(平空条件,1,marketr);

 

 

 

[此贴子已经被作者于2016/5/5 14:19:50编辑过]