MOBV:=OBV-MA(OBV,30);
W1:STICKLINE(MOBV>0,MOBV,0,3,1),COLORRED;
W2:STICKLINE(MOBV<0,MOBV,0,3,1),COLORCYAN;
VA1:=HHVBARS(MOBV,BARSLAST(MOBV<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MOBV),REF(VA1,1)+2),0.5);
QG:=CROSS(BACKSET(CROSS(0,MOBV) OR (ISLASTBAR AND MOBV>0),REF(VA1,1)+2),0.5);
前高:DRAWLINE(VA2,MOBV,REF(VA2,1),REF(MOBV,1),1),COLORMAGENTA;
VA3:=LLVBARS(MOBV,BARSLAST(MOBV>0)+1);
VA4:=CROSS(BACKSET(CROSS(MOBV,0),REF(VA3,1)+2),0.5);
BD:=BARSLAST(FILTERX(CROSS(0,MOBV),BARSCOUNT(C)));
前低:DRAWLINE(VA4,MOBV,REF(VA4,1),REF(MOBV,1),1);
BDTJ:=IF(MOBV<0,FILTERX(MOBV=LLV(MOBV,BARSLAST(MOBV>0)),
BARSCOUNT(C)),DRAWNULL);
TSBDTJ:=BARSLAST(BDTJ);
BDZH:=FILTERX(MOBV<CONST(LLV(MOBV,BD+1)),BARSCOUNT(C));
BDTS:=BARSLAST(BDZH);
本低:IF(BD+1>=1,CONST(LLV(MOBV,BD+1)),DRAWNULL);
BDCL:=CROSS(COUNT(CROSS(MOBV>本低/2 AND MOBV<0,0.5),TSBDTJ)=1,0.5) AND TSBDTJ>=0;
终点:=IF(ISLASTBAR AND MOBV>0 AND MOBV=HHV(MOBV,BARSLAST(MOBV<0)),1,IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));
UU:=(终点=1 OR 终点=2) AND MOBV>0;
ZZ:=FILTERX(UU,BARSCOUNT(C));
本高:DRAWLINE(ZZ,MOBV,REF(ZZ,1),REF(MOBV,1),1),COLORWHITE;
横线:=CONST(REF(MOBV,BARSLAST(ZZ)));
WW:=MOBV>横线;
起始点:=FILTERX(REFX(BARSLAST(WW),1)=1,BARSCOUNT(C));
天数:=BARSLAST(起始点),COLORYELLOW,NODRAW;
上横线:=DRAWLINE(起始点,横线,ZZ,横线,0),COLORGREEN,DOTLINE;
下横线:=DRAWLINE(BDZH,CONST(LLV(MOBV,BD+1)),BDTJ=1,MOBV,0),COLOR8080FF,DOTLINE;
DRAWNUMBER(BDTJ,CONST(LLV(MOBV,BD+1))*0.9,BDTS);
DRAWNUMBER(ZZ,上横线*1.1,天数);
TJ:=IF(起始点,BARSNEXT(ZZ),DRAWNULL);
红柱数量:=IF(天数>0 AND 天数<=REF(TJ,天数),SUM(MOBV>0,天数),DRAWNULL),COLORWHITE,NODRAW;
横线起始价:=REF(C,天数),NODRAW;
空间评估:=(横线起始价-C)/C*100,NODRAW;
TT:=BARSLAST(ZZ);
WQG:=CROSS(COUNT(CROSS(MOBV<本高/2 AND MOBV>0,0.5),ZZ)=1,0.5) AND ZZ>=0;
STICKLINE(MOBV>前高 AND 本高>前高 AND BARSLAST(CROSS(MOBV<本高/2,0.5))>0 AND MOBV>(前高+本高)/2,MOBV,前高,1,0),COLORYELLOW;
前高本高二分位:IF(MOBV>0 AND 本高!=前高,DRAWLINE(WQG,(前高+本高)/2,REF(WQG,1),REF((前高+本高)/2,1),1),DRAWNULL),COLORC0C000,DOTLINE;
AA:=STRCAT(STRCAT(STRCAT('〖','上升空间'),'〗'),CON2STR(IF(空间评估,空间评估,DRAWNULL),2));
STICKLINE(MOBV>前高,MOBV,前高,1,0),COLORYELLOW;
STICKLINE(WQG,MOBV,0,1,0),COLORGREEN;
STICKLINE(MOBV<0 AND MOBV<前低 AND 前低<0,MOBV,前低,1,0),COLORBLUE;
B1:=IF(CROSS(MOBV<0,0.5),BARSNEXT(BDTJ),DRAWNULL);
TSB1:=BARSLAST(MOBV>0)-1;
STICKLINE(BARSLAST(BDCL)>=0 AND MOBV<前低 AND MOBV<0,MOBV,前低,1,0),COLORGREEN;
STICKLINE(BDCL,MOBV,0,1,0),COLORWHITE;
STICKLINE(MOBV>前高 AND 本高>前高 AND BARSLAST(WQG)>0,MOBV,前高,1,0),COLORRED;
DRAWTEXT(VA2 AND VA2!=UU,(MOBV/10)*9,'前');
DRAWTEXT(VA2 AND VA2!=UU,MOBV/10,'高');
DRAWTEXT(ZZ,(MOBV/10)*7,'本'),COLORBLUE;
DRAWTEXT(ZZ,MOBV/10,'高'),COLORBLUE;
DRAWTEXT(BDTJ,(MOBV/10)*9,'低'),COLORRED;
DRAWTEXT(BDTJ,MOBV/10,'本'),COLORRED;
IF(BARSLAST(BDCL)>=0,本低/2,DRAWNULL),COLORRED,DOTLINE;