VIR2:=SUM(ABS(CLOSE-REF(CLOSE,1)),30);
ER2:=DIR2/VIR2;
CS2:=ER2*(0.8-2/24)+2/24;
CQ2:=CS2*CS2;
AMA2:EMA(DMA(CLOSE,CQ2),2),COLORGREEN,LINETHICK1;
牛熊分界:AMA2,STICK,COLOR808080;
AMA3:IF(AMA2/REF(AMA2,1) 0.997,AMA2,DRAWNULL),COLORBLUE,LINETHICK1;
AMA4:IF(AMA2/REF(AMA2,1) 1.001,AMA2,DRAWNULL),COLORRED,LINETHICK1;
M168:MA(C,168),COLORRED,LINETHICK2;
{K线}
{牛熊分界之上阳线}
STICKLINE(C =O AND C 牛熊分界,H,L,0,0),COLORRED;
STICKLINE(C =O AND C 牛熊分界,C,O,2.8,1),COLORRED;
{牛熊分界之上阴线}
STICKLINE(C =O AND C 牛熊分界,C,O,2.8,0),COLORRED;
STICKLINE(C =O AND C 牛熊分界,H,L,0,0),COLORRED;
{牛熊分界之下阳线}
STICKLINE(C =O AND C 牛熊分界,H,L,0,0),COLORGREEN;
STICKLINE(C =O AND C 牛熊分界,C,O,2.8,1),COLORGREEN;
{牛熊分界之下阴线}
STICKLINE(C =O AND C 牛熊分界,H,L,0,0),COLORGREEN;
STICKLINE(C =O AND C 牛熊分界,C,O,2.8,0),COLORGREEN;
{写字}
XX1:=C 牛熊分界 AND 牛熊分界 REF(牛熊分界,1);
DRAWTEXT_FIX(ISLASTBAR AND XX1,0.1,0.01,0,'【牛区持股】'),COLORRED;
XX2:=C 牛熊分界 AND 牛熊分界 =REF(牛熊分界,1);
DRAWTEXT_FIX(ISLASTBAR AND XX2,0.1,0.01,0,'【熊区观望】'),COLORGREEN;
AA1:=ABS(((3.48*CLOSE+HIGH+LOW)/4-EMA(CLOSE,20))/EMA(CLOSE,20));
AA2:=DMA(((2.15*CLOSE+LOW+HIGH)/4),AA1);
牛魔王:EMA(AA2,200)*1.118 ,LINETHICK3,COLORYELLOW;
STICKLINE(C/REF(C,1) 1.095,C,O,2,0),COLORYELLOW;
NE:=IF(NAMELIKE('S') OR NAMELIKE('*S'),0.05,0.1);
跌停:=REF(C,1)/C-1 =NE-0.01/REF(C,1) AND L=C AND PERIOD=5;
STICKLINE(跌停,C,O,-1,0),COLOR00FF00;
年:=YEAR,NODRAW;
月:=MONTH,NODRAW;
星期:=WEEKDAY,NODRAW;
日1:=DATETODAY(DATE);
上市日:=REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT);
自然日:=日1-DATETODAY(上市日)+1;
ZB:=(自然日-REF(自然日,1))!=星期-REF(星期,1)
OR TOTALBARSCOUNT-CURRBARSCOUNT=0;
本周第几天:=BARSLAST(ZB)+1;
本月第几天:=BARSLAST(年*100+月!=REF(年*100+月,1))+1;
MA1:=REF(C,本周第几天);
MA2:=REF(MA1,本周第几天);
MA3:=REF(MA2,本周第几天);
MA4:=REF(MA3,本周第几天);
MAR5:=REF(MA4,本周第几天);
MA6:=REF(MA5,本周第几天);
MA7:=REF(MA6,本周第几天);
MA8:=REF(MA7,本周第几天);
MA9:=REF(MA8,本周第几天);
十周价:=(C+MA1+MA2+MA3+MA4+MA5+MA6+MA7+MA8+MA9)/10;
决策:REFDATE(十周价,DATE),COLORYELLOW,LINETHICK1;
DRAWTEXT(ISLASTBAR,决策,' 决策线'),COLORYELLOW;
低:=REF(LLV(L,150),3);{www.9m8.cn 九毛八公式指标网}
近期底:=REFDATE(低,DATE);
最底:=REFDATE(近期底,DATE);
入:=最底=L AND ((C+L) (O+C) OR (O+L) (C+O));
STICKLINE(入,O,(C+O)/2,3,0),COLORRED;
STICKLINE(入,H,L,0.2,0),COLORRED;
DRAWTEXT(入,L*1.0021,'↖红底'),COLORLIMAGENTA;
高:=REF(HHV(H,150),3);
近期顶:=REFDATE(高,DATE);
最顶:=REFDATE(近期顶,DATE),NODRAW;
出:=最顶=H AND ((C-L) (O-C) OR (O-L) (C-O)),NODRAW;
STICKLINE(出,O,(C+O)/2,3,0),COLORBLUE;
STICKLINE(出,H,L,0.2,0),COLORBLUE;
DRAWTEXT(出,H*0.998,'↙蓝顶'),COLORGREEN;