请老师把这个条件input:TQ(2,1,60,1);
ABB:=(time0-timetot0(dynainfo(207))<=2) or not(islastbar);,帮我写入模型里;
if enterbars>0 and h>hh then hh:=h;
if T4 and ref(h>ref(hhv(h,todaybar),1),1) and close<ref(C,1) then begin sell(holding>0, 1, marketr);
hh:=0;
end
if enterbars>0 and l<ll then ll:=l;
if T4 and ref(l<ref(llv(l,todaybar),1),1) and close>ref(C,1) then begin sellshort(holding<0, 1, marketr);
ll:=0;
end
ABB:=(time0-timetot0(dynainfo(207))<=2) or not(islastbar);
if enterbars>0 and h>hh then hh:=h;
if T4 and ref(h>ref(hhv(h,todaybar),1),1) and close<ref(C,1) and abb then begin sell(holding>0, 1, marketr);
hh:=0;
end
if enterbars>0 and l<ll then ll:=l;
if T4 and ref(l<ref(llv(l,todaybar),1),1) and close>ref(C,1) and abb then begin sellshort(holding<0, 1, marketr);
ll:=0;
end
好的 谢谢!
下面这个指令本来是盘中触发就执行的,我想把它改为K线走完前2秒平仓 ,这样加入ABB可以吗?
if ABB AND H>=AVGenterprice+98 and holding>0 then begin sell(1,1,limitr,close);
a:=1;
end
if ABB AND L<=AVGenterprice-98 and holding<0 then begin sellshort(1,1,limitr,close);
b:=1;
end
这个这样加可以吗? 是加在OR 的后面;
if h>hh and enterbars=0 then hh:=h;
if h/C>1.0050 and ref(C/O,1)>=1.0046 and (L<ref(L,1) or C<ref(O,1)) and abb then begin sell(holding>0, 1, marketr);
end
if l<ll and enterbars=0 then ll:=l;
if close/low>1.0050 and ref(O/C,1)>=1.0046 and (H>ref(H,1) or C>ref(O,1)) and abb then begin sellshort(holding<0, 1, marketr);
end
是or前作为一种平仓条件,or后是第二种平仓条件?是不是加在or后面要看你想怎么表达了
我就是想让这个指令在K线走完前2秒钟才平仓;
如果不加ABB,盘中就会触发平仓的;
我是这个意思;
哦 还有一点 ,我刚发现 ,or 是被大括弧包起来的;
只是在原来基础上加个时间控制的话可以用括号把前边条件整个括起来
if h>hh and enterbars=0 then hh:=h;
if (h/C>1.0050 and ref(C/O,1)>=1.0046 and (L<ref(L,1) or C<ref(O,1))) and abb then begin sell(holding>0, 1, marketr);
end
if l<ll and enterbars=0 then ll:=l;
if (close/low>1.0050 and ref(O/C,1)>=1.0046 and (H>ref(H,1) or C>ref(O,1))) and abb then begin sellshort(holding<0, 1, marketr);
end