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;
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;