T:= time>093500 and time<151300;
input: e1(95,90,150,1) , e2(570,500,900,10) , p(6,1,10,1) , n(53,35,150,1),x(29,1,45,0.1),q(82,60,150,1),r(50,30,100,1),te(140,10,500,10);
ea1:=ma(c,e1);
ea2:=ma(c,e2);
eama1:= EMA(ea1,p);
eama2:= EMA(ea2,n);
ss:=1;
ter:=(HHV(HIGH,e2)-LLV(LOW,e2))/hhv(h,e2)*10000;
aa:= AVGENTERPRICE;
ddsd:= ter>te and holding=0 and cross(eama1,eama2) and T;
if ddsd then
begin
sellshort(holding<0,0,thisclose);
buy(1,ss,thisclose);
END
ddzy:= eama1>eama2 and (HIGH-aa)>=q/10 and T;
If ddzy then
begin
sell(1,ss,MARKETR);
END
ddzs:= LOW<aa-r/10 and holding>0 ;
if ddzs then
begin
sell(1,ss,MARKETR);
end
kdsd:= ter>te and holding=0 and cross(eama2,eama1) and T;
If kdsd then
begin
sell(holding>0,0,thisclose);
buyshort(1,ss,thisclose);
end
kdzy1:= holding<0 and c<enterprice-q/10 and ter>Te;
kdzy2:= eama1<eama2 and T;
kdzy3:= kdzy1 and kdzy2;
kdzs1:= holding<0 and c>enterprice + r/10;
if kdzy3 then sellshort(1,0,MARKETR);
if kdzs1 then sellshort(1,0,MARKETR);
SELL(TIME>151300 AND HOLDING>0,0,thisclose);
sellshort(time>151300 and holding<0,0,thisclose);
当前持仓:HOLDING,COLORGRAY,LINETHICK0;
当前资产:ASSET,NOAXIS,COLORGRAY;
上次开仓价:ENTERPRICE,colorgray,LINETHICK0;