variable:n=0;
if 开仓条件 and holding=0 and n<2 then buy.........;
if 平仓条件 and holding>0 then begin
sell......
n:=n+1;
end
if time>=145500 then sell.........;
variable:n=0;
if TIME>091500 AND TIME<151300 AND 开多条件 and holding=0 and n<2 then BUY(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平多条件 and holding>0 then begin
SELL(1,1,MARKET);
n:=n+1;
end
if TIME>091500 AND TIME<151300 AND 开空条件 and holding=0 and n<2 then BUYSHORT(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平空条件 and holding<0 then begin
SELLSHORT(1,1,MARKET);
n:=n+1;
end
IF TIME>151300 THEN
BEGIN
全平空:SELLSHORT(HOLDING<0,0,MARKET);
全平多:SELL(HOLDING>0,0,MARKET);
END
这段代码为什么不出现信号
variable:n=0;
if date<>ref(date,1) then n:=0;
if TIME>091500 AND TIME<151300 AND 开多条件 and holding=0 and n<2 then BUY(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平多条件 and holding>0 then begin
SELL(1,1,MARKET);
n:=n+1;
end
if TIME>091500 AND TIME<151300 AND 开空条件 and holding=0 and n<2 then BUYSHORT(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平空条件 and holding<0 then begin
SELLSHORT(1,1,MARKET);
n:=n+1;
end
IF TIME>151300 THEN
BEGIN
全平空:SELLSHORT(HOLDING<0,0,MARKET);
全平多:SELL(HOLDING>0,0,MARKET);
END
加了一个全局变量重置,看看效果咋样
就今天上午的行情,为什么在2314.8 和2314.2两上价位了上开了空单?