RA:=maX(O,C);
RB:=MIN(O,C);
RC:=REF(HHV(H,2),1);
RD:=REF(LLV(L,2),1);
T1:=IF(RA>RC,1,IF(RB<RD,-1,0));
T2:=BArslAst(T1=0);
TH:=REF(REF(H,BARSLAST(T1=1)),T2);
TL:=REF(REF(L,BARSLAST(T1=-1)),T2);
TA:=IF(T1=1,IF(RA>TH,1,0),IF(T1=-1,IF(RB<TL,-1,0),0));
T3:=BARSLAST(TA=-1);
T4:=BARSLAST(TA=1);
RE:=REF(COUNT(crOSS(TA,-0.5),T4),T3);
RF:=COUNT(CROSS(TA,0.5),T3);
TB:=IF(TA=1,IF(RF=1,IF(RE>0,1,0),0),0);
NOTEXT1:=VALUEWHEN(TB,REF(REF(H,T4),T3)),COLORGREEN,LINETHICK2;
乖离:=100*Abs(C-NOTEXT1)/NOTEXT1<10;
DIF:=EMA(CLOSE,18)-EMA(CLOSE,40);
DEA:=EMA(DIF,3);
macd:=(DIF-DEA)*2;
MD:=MacD#DAY;
MW:=MACD#WEEK;
MM:=MACD#MONTH;
MS:=MACD#SEASON;
NOTEXTMACD1:=EMA((MD+MW*7+MM*31+MS*94)/133,5);
NOTEXTMACD120:=REF(NOTEXTMACD1/2,BARSLAST(NOTEXTMACD1=HHV(NOTEXTMACD1,120))),COLORRED,LINETHICK1;
NOTEXTMACD250:=REF(NOTEXTMACD1/2,BARSLAST(NOTEXTMACD1=HHV(NOTEXTMACD1,250))),COLORWHITE,LINETHICK1;
大行情:=NOT(REF(NOTEXTMACD120,1)=REF(NOTEXTMACD250,1)) AND NOTEXTMACD120=NOTEXTMACD250 AND C>NOTEXT1 AND 乖离;
NOTEXT前高:=IF(HHVBARS(MACD ,90) ,REF(MACD ,HHVBARS(MACD,90) ),MACD )COLORYELLOW,LINETHICK2;
大牛启动:大行情 AND NOTEXT前高>NOTEXTMACD250;