//區間多,專做多
input:N(18,1,100,1);
開盤K線數:barslast(day<>ref(day,1))+1,linethick0;
開盤價:ref(c,開盤K線數-1),colorwhite;
上軌:開盤價+N,colorred;
long:=cross(c,上軌);
longend:=cross(開盤價,c);
if holding=0 then buy(long,1,thisclose);
if holding>0 then sell(longend,1,thisclose);
if holding>0 and enterprice-c>=20 then sell(1,1,thisclose);
if time>150500 and holding>0 then sell(1,1,thisclose);
?
//區間空,專做空
input:N(10,1,100,1);
開盤K線數:barslast(day<>ref(day,1))+1,linethick0;
開盤價:ref(c,開盤K線數-1),colorwhite;
下軌:開盤價-N,colorred;
short:=cross(下軌,c);
shortend:=cross(c,開盤價);
if holding=0 then buyshort(short,1,thisclose);
if holding<0 then sellshort(shortend,1,thisclose);
if time>150500 and holding<0 then sellshort(1,1,thisclose);
?