以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  1分钟周期,想在收盘前30秒平掉所有仓位  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=62126)

--  作者:wn10000neng
--  发布时间:2014/2/27 15:00:59
--  1分钟周期,想在收盘前30秒平掉所有仓位

图表交易,1分钟周期,想在实盘前30秒平掉所有的仓位,商品和股指都需要,怎么写


--  作者:jinzhe
--  发布时间:2014/2/27 15:06:42
--  

t1:=timetot0(dynainfo(207));
t2:=timetot0(closetime(0));
tt:=t2-t1;
if (islastbar and t2-t1<=30) or (not(islastbar) and time=closetime(0))  then begin
 sellshort(1,0,market);
 sell(1,0,market);
end

 

这个商品股指通用


--  作者:wn10000neng
--  发布时间:2014/2/27 15:14:29
--  

not(islastbar) and time=closetime(0)

 

time=closetime(0) 是什么意思,它会跟not(islastbar) 同时满足条件吗

 


--  作者:jinzhe
--  发布时间:2014/2/27 15:19:56
--  
判断当前k线是否是收盘k线,用来保持历史k线上的信号,前面半句是用来当前时间的,后面半句是用来保持历史信号的