追加仓位的模块不起作用,帮我看看哪里出现问题了?
DTZCTJ:HIGH>HHV(ref(HIGH,2),1);
KTZCTJ:LOW<LLV(ref(LOW,2),1);
ExtGbdataSet('kaicangpos',barpos);//表示记录你开仓位置
//多头追仓后面的代码就这样写:
con:=0;
if islastbar then
begin
con:=DTZCTJ and mod((barpos-extgbdata('kaicangpos')),5)=0 and barpos - extgbdata('kaicangpos')>0;
end;
IF holding>0 and con then // 多头追仓
begin
buy(1,1,thisclose);
end
//空头追仓后面的代码就这样写:
con:=0;
if islastbar then
begin
con:=KTZCTJ and mod((barpos-extgbdata('kaicangpos')),5)=0 and barpos - extgbdata('kaicangpos')>0;
end;
IF holding<0 and con then // 空头追仓
begin
buy(1,1,thisclose);
end
con:=0;
if islastbar then
begin
con:=DTZCTJ and mod((barpos-extgbdata('kaicangpos')),5)=0 and barpos - extgbdata('kaicangpos')>0;
end;
//你的con始终=0 所以 永远不能触发buy