if 多头势 AND abs(adtm)<0.80 and tt0 then BK:=B-B1>0 and close>A6 and close<=Nh;
if 空头势 AND abs(adtm)<0.80 and tt0 then BK:=B-B1>0 and close>A3 and close=<AL;
if 多头势 AND abs(adtm)>0.15 and tt0 then SK:=B-B1<0 AND close<a3 and close>=NH;
if 空头势 and abs(adtm)>0.15 and tt0 then SK:=B-B1<0 and close<a6 and close>=pt;
if 多头势 then SP:=B-B1<0 or close>A;
if 空头势 then sp:=B-B1<0 or close<a3;
if 空头势 then BP:=B-B1>0 or close>A;
if 多头势 then BP:=B-B1>0 or close>a3;
{开多}
buy( holding=0 and bk and NOT(tTYPE(1)=1),intpart(Tasset*0.5/close),thisclose);
Tbuy(Tholding=0 and bk and NOT(tTYPE(1)=1) and NOT(TYPE(1)=3),intpart(Tasset*0.5/close),mkt);
{平多}
if 多头势 and close>nb*1.003 then sell(holding>0 and NOT(TYPE(1)=2),holding*0.50,thisclose);
if 多头势 and close>nb*1.005 then sell(holding>0 ,holding*0.50,thisclose);
sell( holding>0 and sp,0,thisclose);
if 多头势 and close>nb*1.003 then tsell(tholding>0 and NOT(TYPE(1)=2),tholding*0.50,mkt);
if 多头势 and close>nb*1.005 then tsell(tholding>0,tholding*0.50,mkt);
tsell( tholding>0 and sp,0,mkt);//测试时,需要跳变
我任何开多的的单子,开仓的K线,同时就平了50% ,我不知道为什么?
这是程序的语句的逻辑不严密,前一条语句开的仓,下一条语句条件正好成立,所以就把他平了。