当一个条件成立后开仓,后面的条件再成立则不再开仓???谢谢!比如下面的如何修改
/引用kdj的数值;
k:"kdj.k";
d:"kdj.d";
//建立多头条件
long:k>65;
if long then
begin
sellshort(holding<0,0,thisclose);
buy(long,1,thisclose);
end
//建立空头条件
short:k<50;
if short then
begin
sell(holding>0,0,thisclose);
buyshort(short,1,thisclose);
end
k:"kdj.k";
d:"kdj.d";
//建立多头条件
long:k>65;
variable:duo=0,kong=0;
if long then
begin
sellshort(holding<0,0,thisclose);
if holding=0 and long and duo=0 then begin
buy(long,1,thisclose);
duo:=1;
kong:=0;
end
end
//建立空头条件
short:k<50;
if short then
begin
sell(holding>0,0,thisclose);
if holding=0 and short and kong=0 then begin
buyshort(short,1,thisclose);
kong:=1;
duo:=0;
end
end