以文本方式查看主题

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

--  作者:acerap
--  发布时间:2012/6/1 10:53:22
--  高手帮忙,谢谢了

cc:=CALLSTOCK(STKLABEL,VTCLOSE,6);
c5:=CALLSTOCK(STKLABEL,VTCLOSE,2);
jx5:=ma(cc,5);
jx20:=ma(cc,20);
jx5f5:=ma(c5,5);
jx5f20:=ma(c5,20);
sc:=cross(jx5f5,jx5f20);
xc:=cross(jx5f20,jx5f5);
money:=holding*c;                    
total0:=money+cash(0);
total1:=money+cash(1);

if jx5>jx20 then
begin
sellshort(holding<0,0,thisclose);
buy(sc and  holding=0,40%,thisclose);
end

if jx20>jx5 then
begin
sell(holding>0,0,thisclose);
buyshort(xc and holding=0,40%,thisclose);
end


 

if ENTERPRICE*1.3>=h and holding>0 then;
begin
sell(holding>entervol/2,entervol/2,thisclose);
end

if ENTERPRICE*0.7<=l and holding<0 then;
begin
sellshort(holding<entervol/2,entervol/2,thisclose);
end


 谁能帮看下,获利30%平仓一半语句有何问题,程序在检测时无法按照此意愿平仓

[此贴子已经被作者于2012-6-1 11:05:15编辑过]

--  作者:just
--  发布时间:2012/6/1 10:57:04
--  

if ENTERPRICE*1.3>=c and holding>0 then;
begin
sell(holding>0,holding/2,thisclose);
end

if ENTERPRICE*1.3<=c and holding<0 then;
begin
sellshort(holding<0,holding/2,thisclose);
end

改这样试试

[此贴子已经被作者于2012-6-1 10:57:22编辑过]

--  作者:acerap
--  发布时间:2012/6/1 11:00:10
--  
改了不得啊,说实话这个不能改,因为如果持续满足条件,单就平光了