以文本方式查看主题

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

--  作者:pxmygl
--  发布时间:2014/8/22 9:13:17
--  全平
每天15:10全平
如何加代码使每月第二个星期五自动转为14:50全平

--  作者:jinzhe
--  发布时间:2014/8/22 9:26:22
--  

variable:n=0;

if month<>ref(monthe,1) then n:=0;

if weekday=5 then n:=n+1;

if n=2 and weekday=5 and time=145000 then begin

   sell........;

   sellshort........;

end


--  作者:pxmygl
--  发布时间:2014/8/22 9:38:28
--  
variable:n=0;
sell(time>151000 and holding>0, 0, market); //1.该句是否需加入n=0
sellshort(time>151000 and holding<0, 0, market);

if month<>ref(monthe,1) then n:=1;

if weekday=5 then n:=n+1;

if n=2 and weekday=5 and time=145000 then begin

   sell(time>145000 and holding>0, 0, market);

   sellshort(time>145000 and holding<0, 0, market);

end

2.这样对不对?

3.n是否对


--  作者:jinzhe
--  发布时间:2014/8/22 9:49:07
--  
照我的写,你这样n会多1
--  作者:pxmygl
--  发布时间:2014/8/22 10:09:59
--  
明白了
谢谢