D1:=1;
AA1:=STRCAT(CON2STR(YEAR,0),'年');
AA2:=STRCAT(CON2STR(MONTH,0),'月');
AA3:=STRCAT(CON2STR(DAY,0),'日');
AA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
AA5:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'】');
AA6:=STRCAT(STRCAT(CON2STR(HOUR,0),'小时'),STRCAT(CON2STR(MINUTE,0),'分钟,蓝柱表示后期股价变动幅度较大'));
AA7:=STRCAT(AA5,AA6);
DRAWTEXT_FIX(D1=1,0,0.02,0,AA7),COLORMAGENTA;
{波段}
B1:=MA(C,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1);
SMA2:=MA(B2,3);
下限:IF(LLV(MA(B2,8),3)<B2,LLV(MA(B2,8),3),B2);
个股红:=B2>SMA2;
个股绿:=B2<SMA2;
IF(个股红,B2,DRAWNULL),COLORRED,LINETHICK3;
IF(个股绿,B2,DRAWNULL),COLORGREEN,LINETHICK3;
{加速跑道}
跑道AA:=MA(L,3);
跑道BB:=MA(L,26);
跑道AF:=CROSS(跑道AA,跑道BB);
跑道AF1:=CROSS(跑道BB,跑道AA);
{上穿天数:=BARSLAST(跑道AF);
周期涨幅:=(HHV(C,上穿天数+0)-LLV(C,上穿天数+0))/LLV(C,上穿天数+0);
加速跑道:=周期涨幅<=0.15 AND 上穿天数>=6 AND COUNT(跑道AF1,上穿天数)<=0;}
上下穿数:=COUNT(跑道AF1,20)+COUNT(跑道AF,20);
CC:=EMA(上下穿数,10)*6;
变动指数:=IF(CC>1,CC,0);
变动数1:=REF(变动指数,1)-REF(变动指数,2);
变动数2:=变动指数-REF(变动指数,1);
变盘条件1:=变动数1>0 AND 变动数2<0;
变盘条件2:=变动数1<0 AND 变动数2>0;
变盘条件3:=变动指数=0 AND COUNT(变动指数=0,2)<=1;
变盘条件4:=REF(变动指数,1)=0 AND 变动指数>0;
加速条件1:=变动数1<0 AND 变动数2<0 AND (ABS(变动数2)/ABS(变动数1))>2 AND 变动指数>0;
加速条件2:=变动数1>0 AND 变动数2>0 AND (ABS(变动数2)/ABS(变动数1))>2;
{DRAWTEXT(变盘条件1,B2,'!变盘');
DRAWTEXT(变盘条件2,B2,'!变盘');
DRAWTEXT(变盘条件3,B2,'!异动');
DRAWTEXT(变盘条件4,B2,'!异动');
DRAWTEXT(加速条件1 OR 加速条件2,B2,'!异动');}
{资金額亿}
YUWEI:=MA(CLOSE,1)-MA(CLOSE,6);
线上:=YUWEI>0;
线下:=YUWEI<0;
线下绿柱:=YUWEI<0 AND YUWEI<REF(YUWEI,1);
线下红柱:=YUWEI<0 AND YUWEI>REF(YUWEI,1);
资金买:=CROSS(YUWEI,0);
线上数:=COUNT(线上,15);
主力强度:=EMA(线上数,10);
强度C1:=主力强度>REF(主力强度,1);
{STICKLINE(强度C1,主力强度,主力强度*1.02,1,0), COLORRED;
DRAWTEXT(强度C1 AND COUNT(强度C1,2)<=1,主力强度*0.94,'!资金流入'),COLORRED;}
MAVOL:=HHV(REF(VOL,1),3);
MDAY:=BARSLAST(MAVOL);
条件:=VOL>MAVOL AND CLOSE>REF(CLOSE,MDAY+1);
STICKLINE(条件 AND CC>1,B2*0.99,B2*1.01,1,0),COLORGREEN;
CC差:=ABS(CC-REF(CC,2));
DRAWTEXT(条件 AND CC>1 AND CC差>1 AND COUNT(条件,2)<=1 AND 主力强度>REF(主力强度,1),B2*1.01,'!真突破'),COLORRED;
DRAWTEXT(条件 AND CC>1 AND CC差>1 AND COUNT(条件,2)<=1 AND 主力强度<=REF(主力强度,1),B2*1.01,'!假突破'),COLORRED;
DRAWTEXT(条件 AND CC>1 AND CC差<=1 AND COUNT(条件,2)<=1 AND 主力强度>REF(主力强度,1),B2*1.01,'!真突破暴涨'),COLORRED;
DRAWTEXT(条件 AND CC>1 AND CC差<=1 AND COUNT(条件,2)<=1 AND 主力强度<=REF(主力强度,1),B2*1.01,'!假突破暴涨'),COLORRED;
STICKLINE(条件 AND CC<=1,B2*0.99,B2*1.01,2,0),COLORBLUE;
DRAWTEXT(条件 AND CC<=1 AND COUNT(条件,2)<=1 AND 主力强度>REF(主力强度,1),B2,'!真突破暴涨'),COLORYELLOW;
DRAWTEXT(条件 AND CC<=1 AND COUNT(条件,2)<=1 AND 主力强度<=REF(主力强度,1),B2,'!假突破暴涨'),COLORYELLOW;
DRAWICON(COUNT(条件,2)=2,B2*1.02,9);
DRAWICON(COUNT(条件,4)=2 AND 条件,B2*1.02,9);
DRAWICON(COUNT(条件,4)>=3 AND 条件,B2*1.04,1);