Rss & SiteMap

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

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

标题:问

1楼
wjxkjs 发表于:2009/11/24 8:53:53

如果我的第一目标,平多单是BP1,第二目标是BP2,bp2>bp1

sell( holding>0 and bp1,holding*50%,thisclose);

sell( holding>0 and bp2,holding*50%,thisclose);

 

这样肯定不对的。按照上述指令,行情如果继续的话,还是在不断地执行满足bp1的平仓指令。用什么函数可以做到50%仓位在BP1平,达到BP1目标后,其余在BP2平??

2楼
金字塔 发表于:2009/11/24 9:02:49

nb:=enterbars;

p1:=bp1*(sum(bp1,nb)=1);

sell( holding>0 and p1,holding*50%,thisclose);

sell( holding>0 and bp2,holding*50%,thisclose);

3楼
金字塔 发表于:2009/11/24 9:09:22

也可试试这个

sell( holding>0 and bp1 and NOT(TYPE(1)=2) ,holding*50%,thisclose);

sell( holding>0 and bp2,holding*50%,thisclose);

 

共3 条记录, 每页显示 10 条, 页签: [1]


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