以文本方式查看主题

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

--  作者:XXL
--  发布时间:2017/2/16 17:01:49
--  胜率计算
当前光标位置的前100次开平仓的胜率计算怎么写



--  作者:jinzhe
--  发布时间:2017/2/16 17:14:30
--  

variable:m=0;

 

if 平多条件 and holding>0 then begin

   sell(1,0,marketr);

  

   if numprofit(1)>0 then m:=m+1;

end

 

if 平空条件 and holding<0 then begin

   sellshort(1,0,marketr);

 

   if numprofit(1)>0 then m:=m+1;

end

c1:=平多条件 and holding<> ref(holding,1);

c2:=平空条件 and holding<> ref(holding,1);

nn:=sumbars(c1 or c2,100);

胜率:(m-ref(m,nn))/100;