N:=3;N1:=5;N2:=5;N3:=12;
GUP1:=DMA(AMOUNT/vol/100,VOL/CAPITAL);
GUP2:=GUP1+GUP1*34/100;
GUP3:=LOW;
GUP4:=REF(LOW,1);
GUP5:=SMA(Abs(GUP3-GUP4),3,1)/SMA(MAX(GUP3-GUP4,0),N,1)*100;
GUP6:=MA(IF(CLOSE*1.68<='cyc@CYCMAX',GUP5*10,GUP5/10),N);
GUP7:=LLV(LOW,30);
GUP8:=HHV(GUP6,30);
GUP9:=MA(IF(LOW<=GUP7,(GUP6+GUP8*2)/2,0),N);
GUPA:=(2*CLOSE+HIGH+LOW)/4;
GUPB:=LLV(LOW,34);
GUPC:=HHV(HIGH,34);
GUPD:=EMA((GUPA-GUPB)/(GUPC-GUPB)*100,6);
GUPE:=EMA(0.667*REF(GUPD,1)+0.333*GUPD,4);
GUPF:=LLV(LOW,120);
GUP10:=HHV(HIGH,120);
GUP11:=GUP10-GUPF;
DRAWTEXT(IF(COUNT(CLOSE< REF(CLOSE,1),8)/8>0.3 AND COUNT(GUPD>GUPE,3) AND REF(LOW,1)=LLV(LOW,120) AND CLOSE>OPEN,1,0) OR GUP9>40000,LOW,'★买进'),COLORRED;
GUP12:=MA(CLOSE,5);
牛牛趋势A: MA(CLOSE,10);
GUP13:=MA(CLOSE,30);
GUP14:=MA(CLOSE,60);
牛牛趋势B: (EMA(CLOSE,N1)*7+EMA(CLOSE,N2)*3)/10;
牛牛趋势C: DMA(EMA(CLOSE,N3),SUM(VOL/CAPITAL,5)/3);
GUP15:=REF(CLOSE,1);
GUP16:=SMA(MAX(CLOSE-GUP15,0),6,1)/SMA(ABS(CLOSE-GUP15),6,1)*100;
GUP17:=REF(CLOSE,1);
GUP18:=SMA(MAX(CLOSE-GUP17,0),6,1)/SMA(ABS(CLOSE-GUP17),6,1)*100;
DRAWTEXT(crOSS(84,GUP16) AND CROSS(84,GUP18),HIGH,'☆卖出'),COLORGREEN;
STICKLINE(牛牛趋势B>牛牛趋势A,牛牛趋势A,牛牛趋势B,0.1,1);
STICKLINE(牛牛趋势B<牛牛趋势A,牛牛趋势A,牛牛趋势B,0.1,1);