M2:="3DZB.M1#MIN10",linethick0;
M6:="3DZB.M2#MIN10",linethick0;
XD:=M2>M6;
XK:=M2<M6;
RH10:="3DZB.RH#MIN10",linethick0;
RL10:="3DZB.RL#MIN10",linethick0;
QPK:= XD AND HIGH>RH10 AND ISLASTBAR AND TSELLHOLDING(1)<0;
QPD:= XK AND LOW<RL10 AND ISLASTBAR AND TBUYHOLDING(1)>0;
//{实现手动开仓,自动清除逆向单}
aa:tholding,linethick0;
bb:=extgbdata('quanju');
if bb>0 then buy(barpos=datacount-1 and QPD,bb,thisclose);
if aa>0 then
begin
sell(QPD,0,market);
end
if bb<0 then buyshort(barpos=datacount-1 AND QPK,bb,thisclose);
if aa<0 then
begin
sellshort(QPK,0,market);
end
if islastbar then extgbdataset('quanju',aa);
请问火哥或其他高手,这样能实现手动开仓,有条件自动强平吗?
何须那么麻烦
这样既可:
exitlong:QPD;
exitshort:QPK;