以文本方式查看主题

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

--  作者:jiangsen
--  发布时间:2012/11/12 23:14:15
--  代码编写
从开仓到现在这段时间中浮盈的最大值如何表示?
--  作者:jinzhe
--  发布时间:2012/11/13 9:09:58
--  

variable:a=0;

 

if 开仓条件 and holding=0 then begin

buy();

a:=openprofit;

end

 

if openproft>a then a:=openprofit;

 

if 平仓条件 and holding>0 then begin

sell();

a:=0;

end