VARIABLE:buy1=2,cross1=2;
T1:TIME>OPENTIME(1)+500 AND TIME<=OPENTIME(1)+2000;
T2:TIME>OPENTIME(1)+2000 and time<closetime(0)-4000-1500;
多:=(c-l)/c*1000;
空:=(h-c)/c*1000;
方向0:=多-空;
方向:ma(方向0,3);
vol2:=vol;
vol3:=ma(vol,10);
voll:=(vol2/vol3-1)*100-5;
v1:voll;
//这句的v1>100,好像不起作用?请帮我看一下;
if v1>100 and 方向>0 and t1 then begin
buy1:=1;
end;
if v1>100 and 方向>0 and t2 then begin
buy2:=1;
end;
//这句的v1>100,好像不起作用?请帮我看一下;
if v1>100 and 方向<0 and t1 then begin
buy1:=0;
end;
if v1>100 and 方向<0 and t2 then begin
buy2:=0;
end;
// if cross(ma(c,5),ma(c,10)) then
// cross1:=1;
// if cross(ma(c,10),ma(c,5)) then
// cross1:=0;
b1:buy1;
c1:cross1;
sell(holding>0 and time=closetime(0),0,thisclose);
sellshort(holding<0 and time=closetime(0),0,thisclose);
sell(buy2=0 and holding>0 and t2,0,thisclose);
sellshort(buy2=1 and holding<0 and t2,0,thisclose);
/买1:buy(buy1 and holding=0 and t1,20%,thisclose);
买2:buy(buy2 and holding=0 and t2,20%,thisclose);
buyshort(buy1=0 and holding=0 and t1,20%,thisclose);
buyshort(buy2=0 and holding=0 and t2,20%,thisclose);
比如我加在PTA5分钟K线,虽然我设定v1>100时,buy1=1,但实际是v1<100时,buy1却可能变成1了?谢谢
v1<100,你在哪里进行判断了,赋值语句在哪里?
即/这句的v1>100,好像不起作用?请帮我看一下;
显示的v1虽然小于100,应该不符合条件不能开仓,但是仍然开仓了