求开多仓动作完成时所对应的时间?这个怎么表达?求高手指点!万分感激!
variable:a1=1;
if cond1 and a1>0 then
begin
......
buy.......
a2:=time;
a1:=-1;
end
if cond2 then
begin
........
buyshort......
a1:=1;
end
买入开仓时间:a2,linethick0;
[此贴子已经被作者于2013-2-19 11:22:26编辑过]
用这种写法可能更好一些。时间上有毫秒级的差别。
if holding>0 and holding<>ref(holding,1) then
begin
a2:=time;
end
使用固定轮询
[此贴子已经被作者于2013-2-19 12:10:05编辑过]
7楼的写法有问题,应该这样写
variable:a1=1;
if holding>0 and holding<>ref(holding,1) and a1>0 then
begin
a2:=time;
a1:=-1;
end
if holding<=0 and a1<0 then a1:=1;
买入开仓时间:a2,linethick0;
可以用time0代替time 计算time0-a2得到开仓到现在的时间(秒)
以下是引用时间蛰虎在2013-2-19 12:56:03的发言:
非常感谢楼上高手!新年祝高手们发横财!
你太客气,祝你新年好运!程序我在论坛上随手写的你自己要调试看看有没有问题。
谢谢版主的金币!