duo:=T and macd_m5>0 and k>d and macd_M15>0 and cross(macd1,0);
kong:=S and macd_m5<0 and k<d and macd_M15<0 and cross(0,macd1);
if duo then Tbuy(Tholding=0,x,MKT);
if duo and C-TENTERPRICE>=w*MINDIFF and abs(Tholding)=x then Tbuy(1,x,MKT);
if duo and C-TENTERPRICE>=w*MINDIFF and abs(Tholding)=2*x then Tbuy(1,x,MKT);
if duo and C-TENTERPRICE>=w*MINDIFF and abs(Tholding)=3*x then Tbuy(1,x,MKT);
if kong then Tbuyshort(Tholding=0,x,MKT);
if kong and TENTERPRICE-C>=w*MINDIFF and abs(Tholding)=x then Tbuyshort(1,x,MKT);
if kong and TENTERPRICE-C>=w*MINDIFF and abs(Tholding)=2*x then Tbuyshort(1,x,MKT);
if kong and TENTERPRICE-C>=w*MINDIFF and abs(Tholding)=3*x then Tbuyshort(1,x,MKT);
老師 是這樣的