股票估值 (划线) 主图源码 + 庄散筹码强度 副图源码
感谢原作!
股票估值 (划线) 主图源码
参数:
N: 3 1 30
M: 1 1 30
P: 10 1 30
F: 27 1 64
S: 2 1 4
STICKLINE(C>=O,C,O,8,0),COLOR0000AA;
STICKLINE(C>=O,C,O,6,0),COLOR0000CC ;
STICKLINE(C>=O,C,O,4,0),COLOR0000DD ;
STICKLINE(C>=O,C,O,2,0),COLOR0000FF;
STICKLINE(C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=O,C,O,8,0),COLOR0000AA;
STICKLINE(C>=O,C,O,6,0),COLOR0000CC ;
STICKLINE(C>=O,C,O,4,0),COLOR0000DD ;
STICKLINE(C>=O,C,O,2,0),COLOR0000FF;
STICKLINE(C>=O,H,L,0,0),COLORRED;
STICKLINE(C<=O,C,O,8,0),Color007B00;
STICKLINE(C<=O,C,O,6,0),Color009000;
STICKLINE(C<=O,C,O,4,0),Color00A800;
STICKLINE(C<=O,C,O,2,0),COLORGREEN;
STICKLINE(C<=O,H,L,0,0),COLORCYAN;
{-------------------------------------------------------------}
强弱分界: MA(CLOSE,F),linethick0,Color0000FF;
{风标: EMA((EMA(CLOSE,3)+EMA(CLOSE,5)+EMA(CLOSE,8)+EMA(CLOSE,13))/4,2),Color00FF00;}
注意卖: 强弱分界+S*STD(CLOSE,F),linethick0,ColorFF00FF;
DRAWICON(cross(H,注意卖),H+0.13 ,12);
DRAWTEXT(cross(H,注意卖),H+0.1,'→注卖'),ColorFF00FF,ALIGN0;
上极限: 强弱分界+3*STD(CLOSE,F),linethick0,ColorFF0080;
DRAWICON(cross(H,上极限),H+0.09 ,9);
DRAWTEXT(cross(H,上极限),H+0.12,'→上卖'),Color00FFFF;
{AUPPER: MID+P.7*STD(CLOSE,N);}
注意买: 强弱分界-S*STD(CLOSE,F),linethick0,Color8000FF;
{DRAWICON(cross(注意买,l),L-0.02 ,14);
DRAWTEXT(cross(注意买,L),L-0.02,'-→买'),Color00FF00;}
下极限: 强弱分界-2.9*STD(close,F),linethick0,Color4080FF;
{DRAWICON(cross(下极限,L),L-0.04 ,10);
DRAWTEXT(cross(下极限,L),L-0.06,'→下买'),Color0080FF;}
{---------------------------------------------------------}
AA:=REF(H,N)=HHV(H,2*N+1);
AAA:=FILTER(AA,N);
BB:=BACKSET(AAA,N+1);
CC1:=FILTER(BB,N);
CC:=CC1 OR ISLASTBAR;
AA2:=REF(L,N)=LLV(L,2*N+1);
AAA2:=FILTER(AA2,N);
BB2:=BACKSET(AAA2,N+1);
CC22:=FILTER(BB2,N);
CC2:=CC22 AND NOT(CC1);
EA:=BACKSET(CC,REF(BARSLAST(CC2),1)+1);
EB:=EA>REF(EA,1); EE:=BACKSET(EB,2);
FF1:=EE>REF(EE,1);
EE2:=BACKSET(FF1 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF2:=EE2>REF(EE2,1);
EE3:=BACKSET(FF2 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF3:=EE3>REF(EE3,1);
JS:=IF(CC,COUNT(CC2,REF(BARSLAST(CC),1)+1),0);
G1:=IF(JS=1 AND CC,BARSLAST(FF1),0);
GA:=IF(CC AND REF(L,BARSLAST(FF1))>=REF(L,BARSLAST(FF2)),BARSLAST(FF2),BARSLAST(FF1));
G2:=IF(JS=2 AND CC,GA,0);
G3:=IF(JS>=3 AND CC,IF(CC AND REF(L,GA)>=REF(L,BARSLAST(FF3)),BARSLAST(FF3),GA),0);
GG:=G1+G2+G3;
JA:=BACKSET(CC,GG); JB:=JA>REF(JA,1); JJ:=BACKSET(JB,2);
LD:=JJ>REF(JJ,1);
LD1:=LD OR ISLASTBAR;
hEA:=BACKSET(LD1,REF(BARSLAST(CC),1)+1);
hEB:=hEA>REF(hEA,1); hEE:=BACKSET(hEB,2);
hFF1:=hEE>REF(hEE,1);
hEE2:=BACKSET(hFF1 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
hFF2:=hEE2>REF(hEE2,1);
hEE3:=BACKSET(hFF2 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
hFF3:=hEE3>REF(hEE3,1);
hJS:=IF(LD1,COUNT(CC1,REF(BARSLAST(LD1),1)+1),0);
hG1:=IF(hJS=1 AND LD1,BARSLAST(hFF1),0);
hGA:=IF(LD1 AND REF(H,BARSLAST(hFF1))<=REF(H,BARSLAST(hFF2)),BARSLAST(hFF2),BARSLAST(hFF1));
hG2:=IF(hJS=2 AND LD1,hGA,0);
hG3:=IF(hJS>=3 AND LD1,IF(LD1 AND REF(H,hGA)<=REF(H,BARSLAST(hFF3)),BARSLAST(hFF3),hGA),0);
hGG:=hG1+hG2+hG3;
hJA:=BACKSET(LD1,hGG); hJB:=hJA>REF(hJA,1); hJJ:=BACKSET(hJB,2);
HD:=hJJ>REF(hJJ,1);
{-------------------------------------------------------------}
DRAWICON(HD,H*1.01,10);
DRAWTEXT(HD,H+0.04,'→上卖'),Color0080FF;
DRAWICON(LD,L*0.995,11);
DRAWTEXT(LD,L-0.02,'→下买'),Color0080FF;
DRAWLINE(LD,L,HD,H,0),COLORFF9900;
DRAWLINE(HD,H,LD,L,0),COLORFF9900;
X1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
X2:=X1>REF(X1,1);
Y1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
Y2:=Y1>REF(Y1,1);
Z1:=IF(BARSLAST(X2)<BARSLAST(Y2),X2,Y2);
Z2:=IF(BARSLAST(X2)<BARSLAST(Y2),L,H);
DRAWLINE(Z1,Z2,ISLASTBAR,C,0),COLORFF9900,POINTDOT;
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,L,VV,L,1),COLORYELLOW,POINTDOT;
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,H,VV2,H,1),COLORYELLOW,POINTDOT;
前一低:REF(L,BARSLAST(VV)),Color00FF00{,COLOR99FF66,POINTDOT},LINETHICK2;
前二低:REF(L,BARSLAST(XX)),ColorFFFFFF{,COLORFF66FF,POINTDOT},LINETHICK2;
前一高:REF(H,BARSLAST(VV2)),Color00FF00{,COLOR99FF66,POINTDOT},LINETHICK2;
前二高:REF(H,BARSLAST(XX2)),ColorFFFFFF{,COLORFF66FF,POINTDOT},LINETHICK2;
短高:=REF(H,BARSLAST(VV2)),LINETHICK0;
短低:=REF(L,BARSLAST(VV)),LINETHICK0;
短比:(C-短低)/(短高-短低),LINETHICK0;
常数:=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV));
叠1:INDEXC/常数,COLORGRAY,LINETHICK0;
PARTLINE(M,叠1),COLORGRAY;
常数2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX));
叠2:INDEXC/常数2,COLORGRAY,LINETHICK0;
PARTLINE(M,叠2),COLORGRAY;
{----------------------------------------------------------------}
lhnh:=BARSLAST(BARPOS=SYSPARAM(2))+1;
nnl:=BARPOS=SYSPARAM(3);
hh:=HHV(h ,lhnh);
ll:=llV(l ,lhnh);
{------------------------------------------------------}
q875:=ll+(hh-ll)*0.875;
q809:=ll+(hh-ll)*0.809;
q75:=ll+(hh-ll)*0.75;
{q625:=ll+(hh-ll)*0.625;}
q618:=ll+(hh-ll)*0.618;
q66:=ll+(hh-ll)*0.66;
q500:=ll+(hh-ll)*0.5;
{q375:=ll+(hh-ll)*0.375;}
q382:=ll+(hh-ll)*0.382;
q33:=ll+(hh-ll)*0.33;
q191:=ll+(hh-ll)*0.191;
q125:=ll+(hh-ll)*0.125;
q25:=ll+(hh-ll)*0.25;
{--------------------------------------------------------
q85:=ll+(hh-ll)*0.85;
q809:=ll+(hh-ll)*0.809;
q71:=ll+(hh-ll)*0.71;
q618:=ll+(hh-ll)*0.618;
q57:=ll+(hh-ll)*0.57;
q500:=ll+(hh-ll)*0.5;
q43:=ll+(hh-ll)*0.43;
q382:=ll+(hh-ll)*0.382;
q29:=ll+(hh-ll)*0.29;
q191:=ll+(hh-ll)*0.191;
q15:=ll+(hh-ll)*0.15;}
{------------------------------------------------------------------}
DRAWTEXT(nnl,hh*0.998,'最高价:'),ALIGN2,Color00FFFF;
drawnumber(nnl,hh*0.998,hh,2),Color00FFFF;
{DRAWTEXT(nnl,hh*0.998,'最高价:'),ALIGN2,Color00FFFF,linethick3;
drawnumber(nnl,hh*0.998,hh,2),ALIGN2,Color00FFFF,linethick3;}
DRAWTEXT(nnl,q809,'19.1%:'),ALIGN2,Color00FFFF;
drawnumber(nnl,q809,q809,2),Color00FFFF;
DRAWTEXT(nnl,q618,'38.2%:'),ALIGN2,Color00FFFF;
DRAWnumber(nnl,q618,q618,2),Color00FFFF;
DRAWTEXT(nnl,q500,'50%:'),ALIGN2,Color00FFFF;
DRAWnumber(nnl,q500,q500,2),Color00FFFF;
DRAWTEXT(nnl,q382,'61.8%:'),ALIGN2,Color00FFFF;
DRAWnumber(nnl,q382,q382,2),Color00FFFF;
DRAWTEXT(nnl,q191,'80.9%:'),ALIGN2,Color00FFFF;
DRAWnumber(nnl,q191,q191,2),Color00FFFF;
DRAWTEXT(nnl,ll*1.01,'最低价:'),ALIGN2,Color00FFFF;
DRAWnumber(nnl,ll*1.01,ll,2),Color00FFFF;
{----------------------------------------------------}
DRAWnumber(nnl,q875,q875,2),ALIGN1,ColorFF00FF;
DRAWnumber(nnl,q75,q75,2),ALIGN1,ColorFF00FF;
DRAWnumber(nnl,q66,q66,2),ALIGN1 |