老师,if ref(dt,1)=1 then begin
KD:=TDC and tdh and tdl and tv and tv1; //开多条件
end dt是条件
错那呢
当前周期满足 KD:=TDC and tdh and tdl and tv and tv1;
上个周期满足dt 为啥输出结果都对不上 不解
if ref(dt,1)=1 then begin
KD:=TDC and tdh and tdl and tv and tv1; //开多条件
end
if ref(kt,1)=1 then begin
PD:=tkc and tkh and tkl and tv and tv1; //平多条件
end
if ref(kt,1)=1 then begin
KK:=tkc and tkh and tkl and tv and tv1; //开空条件
end
if ref(dt,1)=1 then begin
PK:=TDC and tdh and tdl and tv and tv1; //平空条件
end
平多:SELL(PD,1,THISCLOSE); //平多信号
平空:SELLSHORT(PK,1,THISCLOSE); //平空信号
开多:BUY(KD AND HOLDING=0,1,THISCLOSE); //开多信号
开空:BUYSHORT(KK AND HOLDING=0,1,THISCLOSE); //开空信号
顺序有错吗
做空为例
x1:=(REF(o,1)+REF(o,2)+REF(o,3))/3;
x2:=(REF(h,1)+REF(h,2)+REF(h,3))/3;
x3:=(REF(l,1)+REF(L,2)+REF(L,3))/3;
x4:=(REF(CLOSE,1)+REF(CLOSE,2)+REF(CLOSE,3))/3;
dc:=(x1+x2+x3+x4)/4;
kt:=c>(dc+(c-ref(l,1);
当前周收盘满足KK:=tkc and tkh and tkl and tv and tv1的同时上个周期满足kt条件 才能执行, 让后执行做空 不知道这样表述是否