以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://www.weistock.com/bbs/list.asp?boardid=4)
----  关于连亏  (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=73006)

--  作者:skylands
--  发布时间:2014/12/12 22:08:36
--  关于连亏
请教如何表达:连亏5次后开仓之下单量加大一倍
像下面这样用seqloss函数表达方式正确吗?
XD:=if(seqloss>=5,10,5);
buy(开多条件 and holding=0,XD,thisclose);


--  作者:skylands
--  发布时间:2014/12/12 22:18:23
--  
发现seqloss是指连亏金额,改用maxseqloss函数可以吗?
XD:=if(maxseqloss>=5,SS*2,SS);
buy(开多条件 and holding=0,XD,thisclose);

--  作者:jinzhe
--  发布时间:2014/12/15 9:14:38
--  

variable:n=0;

if 平多条件 and holding>0 then begin

     sell(1,0,market);

     if numprofit(1)>0 then n:=0;

     if numprofit(1)<=0 then n:=n+1;

end

 

if 平空条件 and holding<0 then begin

     sellshort(1,0,market);

     if numprofit(1)>0 then n:=0;

     if numprofit(1)<=0 then n:=n+1;

end

 

if n=5 and ref(n,1)=4 then ss:=ss*2;


--  作者:skylands
--  发布时间:2014/12/15 13:38:18
--  
有没有简单点的方法实现连亏N次后加大下单量?感觉上似乎应该只要一个函数就可以实现的啊,连亏几次的函数应该很容易设计的吧?
--  作者:jinzhe
--  发布时间:2014/12/15 13:43:46
--  

感谢提交建议!