Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:止盈的问题

1楼
acerap 发表于:2012/6/1 21:59:01

variable:hl=0,zs=0,zy=0;
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);

             
if jx5>jx20 then
begin
sellshort(holding<0,0,thisclose);
buy(sc and  holding=0,10,thisclose);
hl:=h;
zs:=enterprice*0.9;
zy:=enterprice*1.1;

end

if jx20>jx5 then
begin
sell(holding>0,0,thisclose);
buyshort(xc and holding=0,10,thisclose);
hl:=l;
zs:=enterprice*1.1;
zy:=enterprice*0.9;

end

if low<=zs then
sell(holding>0,0,market);

if high>=zs then
sellshort(holding<0,0,market);

 

if hl>zy then
sell(holding>0,50%,market);

 

if hl<zy  then
sellshort(holding<0,50%,market);

 

最后2句设定盈利达到10%的时候,平仓一半,但是系统却因满足条件一直不停的平仓,直到没有仓位,哪位高手能帮忙解决此问题啊?

2楼
阿火 发表于:2012/6/2 21:07:10

if holding>0 and hl>zy then begin sell(1,50%,market);hl:=drawnull;end

 

if holding<0 and hl<zy then begin sellshort(1,50%,market); hl:=drawnull;end

3楼
acerap 发表于:2012/6/2 22:36:48
谢谢火哥!!
4楼
acerap 发表于:2012/6/2 22:40:56
不得,还是不停平仓
共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03027 s, 3 queries.