以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请教大虾如何统计当天的开多次数和开空次数?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=58370)

--  作者:celuezuhe
--  发布时间:2013/11/4 15:52:11
--  请教大虾如何统计当天的开多次数和开空次数?
请教大虾如何统计当天的开多次数和开空次数?
在模型里如何写?
开多和开空要分别统计
谢谢

--  作者:jinzhe
--  发布时间:2013/11/4 16:28:56
--  

variable:n=0,m=0;

 

if 开空条件 and holding=0 then begin

    buyshort(holding=0,1,market);

    n:=n+1;

end

 

if 开多条件 and holding=0 then begin

   buy(holding=0,1,market);

   m:=m+1;

end

n是开空次数,m是开多次数