主图源码
AAA:=REFDATE(HHV(H,130),DATE);
BBB:=REFDATE(LLV(L,130),DATE);
DRAWBAND(AAA,RGB(0,80,80),BBB,RGB(00,00,00));
MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
DKX:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)
+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)
+10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)
+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)
+2*REF(MID,18)+REF(MID,20))/210;
DKMA:MA(DKX,6);
DRAWBAND(DKX,RGB(128,128,0),DKMA,RGB(0,0,128));
STICKLINE(C>O,C,O,3,0),COLOR000077;
STICKLINE(C>O,C,O,2,0),COLOR000099;
STICKLINE(C>O,C,O,1,0),COLOR0000BB;
STICKLINE(C>O,H,L,0,0),COLOR0000FF;
STICKLINE(C<O,C,O,3,0),COLOR007700;
STICKLINE(C<O,C,O,2,0),COLOR009900;
STICKLINE(C<O,C,O,1,0),COLOR00BB00;
STICKLINE(C<O,H,L,0,0),COLOR00FF00;
套牢盘%:=100*(1-WINNER(C));
获利盘%:=100*WINNER(C);
集中度90%:=(COST(95)-COST(5))/(COST(100))*100;
集中度70%:=(COST(85)-COST(15))/(COST(100))*100;
平均成本:=COST(50);
主力成本:=COST(4);
短期压力:=HHV(H,20);
短期支撑:=LLV(L,20);
PT:=REF(HIGH,1)-REF(LOW,1);
中价:=(H+L+C)/3;
近高:=2*中价-LOW;
近低:=2*中价-HIGH;
最高:=中价+PT;
最低:=中价-PT;
T1:=CONST(IF(获利盘%,1,0));
T2:=CONST(IF(套牢盘%,1,0));
T3:=CONST(IF(集中度90%,1,0));
T4:=CONST(IF(集中度70%,1,0));
T5:=CONST(IF(平均成本,1,0));
T6:=CONST(IF(主力成本,1,0));
T7:=CONST(IF(短期压力,1,0));
T8:=CONST(IF(短期支撑,1,0));
T9:=CONST(IF(中价,1,0));
T10:=CONST(IF(近高,1,0));
T11:=CONST(IF(近低,1,0));
T12:=CONST(IF(最高,1,0));
T13:=CONST(IF(最低,1,0));
TS1:=IF(T1=1,0+0.03,0);
TS2:=IF(T2=1,TS1+0.03,TS1);
TS3:=IF(T3=1,TS2+0.05,TS2);
TS4:=IF(T4=1,TS3+0.03,TS3);
TS5:=IF(T5=1,0+0.03,0);
TS6:=IF(T6=1,TS5+0.03,TS5);
TS7:=IF(T7=1,TS6+0.05,TS6);
TS8:=IF(T8=1,TS7+0.03,TS7);
TS9:=IF(T9=1,0+0.03,0);
TS10:=IF(T10=1,TS9+0.05,TS9);
TS11:=IF(T11=1,TS10+0.03,TS10);
TS12:=IF(T12=1,TS11+0.05,TS11);
TS13:=IF(T13=1,TS12+0.03,TS12);
N1:=115;
N2:=80;
N3:=45;
DRAWTEXT(T1=1 AND CURRBARSCOUNT=N1 AND PERIOD=5,AAA-(AAA*TS1),'【获利盘%】'),COLORRED;
DRAWTEXT(T2=1 AND CURRBARSCOUNT=N1 AND PERIOD=5,AAA-(AAA*TS2),'【套牢盘%】'),COLOR00FF00;
DRAWTEXT(T3=1 AND CURRBARSCOUNT=N1 AND PERIOD=5,AAA-(AAA*TS3),'【90%成本集中度】'),COLORYELLOW;
DRAWTEXT(T4=1 AND CURRBARSCOUNT=N1 AND PERIOD=5,AAA-(AAA*TS4),'【70%成本集中度】'),COLOR008FFF;
DRAWTEXT(T5=1 AND CURRBARSCOUNT=N2 AND PERIOD=5,AAA-(AAA*TS5),'【平均成本】'),COLORFF99FF;
DRAWTEXT(T6=1 AND CURRBARSCOUNT=N2 AND PERIOD=5,AAA-(AAA*TS6),'【主力成本】'),COLORFF00FF;
DRAWTEXT(T7=1 AND CURRBARSCOUNT=N2 AND PERIOD=5,AAA-(AAA*TS7),'【短期压力】'),COLORFFFFBF;
DRAWTEXT(T8=1 AND CURRBARSCOUNT=N2 AND PERIOD=5,AAA-(AAA*TS8),'【短期支撑】'),COLORF0F000;
DRAWTEXT(T9=1 AND CURRBARSCOUNT=N3 AND PERIOD=5,AAA-(AAA*TS9),'【中价】'),COLORWHITE;
DRAWTEXT(T10=1 AND CURRBARSCOUNT=N3 AND PERIOD=5,AAA-(AAA*TS10),'【近高】'),COLORFFFFBF;
DRAWTEXT(T11=1 AND CURRBARSCOUNT=N3 AND PERIOD=5,AAA-(AAA*TS11),'【近低】'),COLORF0F000;
DRAWTEXT(T12=1 AND CURRBARSCOUNT=N3 AND PERIOD=5,AAA-(AAA*TS12),'【最高】'),COLORFF99FF;
DRAWTEXT(T13=1 AND CURRBARSCOUNT=N3 AND PERIOD=5,AAA-(AAA*TS13),'【最低】'),COLORFF00FF;
DRAWNUMBER(T1=1 AND CURRBARSCOUNT=N1-12 AND PERIOD=5,AAA-(AAA*TS1),CONST(获利盘%)),COLORRED;
DRAWNUMBER(T2=1 AND CURRBARSCOUNT=N1-12 AND PERIOD=5,AAA-(AAA*TS2),CONST(套牢盘%)),COLOR00FF00;
DRAWNUMBER(T3=1 AND CURRBARSCOUNT=N1-18 AND PERIOD=5,AAA-(AAA*TS3),CONST(集中度90%)),COLORYELLOW;
DRAWNUMBER(T4=1 AND CURRBARSCOUNT=N1-18 AND PERIOD=5,AAA-(AAA*TS4),CONST(集中度70%)),COLOR008FFF;
DRAWNUMBER(T5=1 AND CURRBARSCOUNT=N2-12 AND PERIOD=5,AAA-(AAA*TS5),CONST(平均成本)),COLORFF99FF;
DRAWNUMBER(T6=1 AND CURRBARSCOUNT=N2-12 AND PERIOD=5,AAA-(AAA*TS6),CONST(主力成本)),COLORFF00FF;
DRAWNUMBER(T7=1 AND CURRBARSCOUNT=N2-12 AND PERIOD=5,AAA-(AAA*TS7),CONST(短期压力)),COLORFFFFBF;
DRAWNUMBER(T8=1 AND CURRBARSCOUNT=N2-12 AND PERIOD=5,AAA-(AAA*TS8),CONST(短期支撑)),COLORF0F000;
DRAWNUMBER(T9=1 AND CURRBARSCOUNT=N3-9 AND PERIOD=5,AAA-(AAA*TS9),CONST(中价)),COLORWHITE;
DRAWNUMBER(T10=1 AND CURRBARSCOUNT=N3-9 AND PERIOD=5,AAA-(AAA*TS10),CONST(近高)),COLORFFFFBF;
DRAWNUMBER(T11=1 AND CURRBARSCOUNT=N3-9 AND PERIOD=5,AAA-(AAA*TS11),CONST(近低)),COLORF0F000;
DRAWNUMBER(T12=1 AND CURRBARSCOUNT=N3-9 AND PERIOD=5,AAA-(AAA*TS12),CONST(最高)),COLORFF99FF;
DRAWNUMBER(T13=1 AND CURRBARSCOUNT=N3-9 AND PERIOD=5,AAA-(AAA*TS13),CONST(最低)),COLORFF00FF;
HH0:=CONST(HHV(H,75));
LL0:=CONST(LLV(L,75));
MM0:=CONST((HH0+LL0)/2);
HL0:=CONST(IF(CONST(C)>=MM0,LL0-(HH0-LL0)*0.2,HH0+(HH0-LL0)*0.2));
HH1:=IF(CONST(C)<MM0,HH0*1.01,HL0);
LL1:=IF(CONST(C)>=MM0,LL0*0.99,HL0);
HL1:=(HH1+LL1)/2,COLORFFFFFF;
STICKLINE("MACD.MACD">0,"MACD.MACD"+HL1,HL1,2,1),COLOR00FFFF;
STICKLINE("MACD.MACD">0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"+HL1,HL1,2,0),COLORFF00FF;
STICKLINE("MACD.MACD"<0,"MACD.MACD"+HL1,HL1,2,0),COLOR00FFFF;
STICKLINE("MACD.MACD"<0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"+HL1,HL1,2,1),COLORFF00FF;
副图主力追踪
多线:27;
空线:55;
P:=((2)*(CLOSE) + HIGH + LOW + OPEN)/(5);
BB:=MA(P,3);
CC:=(SUM(IF((P > REF(P,1)),(P)*(VOL),0),4))/(SUM(IF((P < REF(P,1)),(P)*(VOL),0),4));
DD:=REF(100 - (100)/(1 + CC),1);
A1:=HHV(P,15);
A2:=LLV(P,15);
A3:=A1 - A2;
A4:=(EMA((P - A2)/(A3),2))*(100);
多方力度1:=(3*SMA((CLOSE-LLV(LOW,24))/(HHV(HIGH,24)-LLV(LOW,24))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,24)-LLV(LOW,24))*100,5,1),3,1))*强弱;
空方力度1:=(100*(HHV(HIGH,95)-CLOSE)/(HHV(HIGH,95)-LLV(LOW,95)))*强弱;
强:空方力度1<多方力度1,COLORRED;
STICKLINE(空方力度1<多方力度1,0,100,6.6.0,0)COLOR001050;
弱:STICKLINE(空方力度1>多方力度1,0,100,9.9.0,0)COLORLICYAN;
短线1:=A4;
短线:IF(CURRBARSCOUNT>短线M, DRAWNULL,短线1),COLOR888888,LINETHICK1;
IF(短线>REF(短线,1),短线,DRAWNULL),LINETHICK1,COLORRED;
多方力度:(3*SMA((CLOSE-LLV(LOW,多线))/(HHV(HIGH,多线)-LLV(LOW,多线))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,多线))/(HHV(HIGH,27)-LLV(LOW,多线))*100,5,1),3,1)),COLOR00FFFF,LINETHICK2;
空方力度:100*(HHV(HIGH,空线)-CLOSE)/(HHV(HIGH,空线)-LLV(LOW,空线)),COLOR00EC00,LINETHICK1;
DRAWTEXT(ISLASTBAR,短线,'←短线'),COLOR888888;
DRAWTEXT(ISLASTBAR,多方力度,'←多方'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,空方力度,'←空方'),COLORGREEN;
持币:=(IF(SAR(10,2,20)>=H,SAR(10,2,20),DRAWNULL))*强弱;
持股:(IF(SAR(10,2,20)<=L,SAR(10,2,20),DRAWNULL))*强弱,COLORRED,NODRAW;
STICKLINE(持币,50,50,2.1.1,0),COLORCYAN;
STICKLINE(持股,50,50,2.1.1,0),COLORRED;
买点:REF(持币,1)>0 AND 持股>0,COLORLIRED;
RSV:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
VAR1:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA
((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
VAR2:=EMA(VAR1,8);
VAR3:=3*SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,5,1)-2*SMA(SMA
((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,5,1),3,1);
趋势:=EMA(VAR3,3)-10;
VAR4:=(趋势-REF(趋势,1))/REF(趋势,1)*100;
VAR5:=FILTER((趋势<=13 AND VAR4>13),10);
VAR6:=FILTER((趋势>=90 AND VAR4),10);
VAR7:=LLV(LOW,30);
VAR8:=HHV(HIGH,30);
VAR9:=EMA((CLOSE-VAR7)/(VAR8-VAR7)*4,4)*25;
VAR10:=(VAR9-LLV(VAR9,4))/(HHV(VAR9,4)-LLV(VAR9,4))*100;
VAR11:=SMA(ABS(LOW-REF(LOW,1)),3,1)/SMA(MAX(LOW-REF(LOW,1),0),3,1);
VAR12:=HHV(VAR11,30)*8;
VAR2222:=REF(LOW,1);
VAR3333:=(SMA(ABS(LOW-VAR2222),3,1))/(SMA(MAX(LOW-VAR2222,0),3,1))*100;
VAR4444:=EMA(IF(CLOSE*1.3,VAR3333*10,VAR3333/10),3);
VAR5555:=LLV(LOW,30);
VAR6666:=HHV(VAR4444,30);
VAR7777:=IF(MA(CLOSE,58),1,0);
主力吸筹:(EMA(IF(LOW<=VAR5555,(VAR4444+VAR6666*2)/2,0),3))/(618)*VAR7777,NODRAW;
VAR9999:=IF(主力吸筹>100,100,主力吸筹)*吸筹;
MA1:=MA(C,5);
MA2:=MA(C,10);
MA3:=MA(C,20);
MA4:=MA(C,60);
MA5:=MA(C,120);
筹码:=(COST(90)+COST(70)+COST(50)+COST(30)+COST(10))/5;
今获利:WINNER(C)*100,COLORWHITE,NODRAW;
昨获利:=REF(今获利,1),COLORYELLOW,NODRAW;
获利比增:今获利-昨获利,COLORRED,NODRAW;
二日涨幅:=(C-REF(C,5))/REF(C,5)*100;
五日涨幅:=(C-REF(C,5))/REF(C,5)*100;
十日涨幅:=(C-REF(C,10))/REF(C,10)*100;
二十涨幅:=(C-REF(C,20))/REF(C,20)*100;
十五涨幅:=(C-REF(C,15))/REF(C,15)*100;
六十涨幅:=(C-REF(C,60))/REF(C,60)*100;
量比:=V/REF(MA(V,1),1);
五日换手:=SUM(VOL,5)*100/CAPITAL;
二十换手:=SUM(VOL,20)*100/CAPITAL;
六十换手:=SUM(VOL,60)*100/CAPITAL;
趋势线:=(MA(CLOSE,5)+MA(CLOSE,10)+MA(CLOSE,15)+MA(CLOSE,20))/4;
牛熊线:=MA(CLOSE,26);
生命线:=EMA(CLOSE,55);
AVAR10:=LLV(LOW,10);
AVAR13:=HHV(HIGH,25);
红线:=EMA((CLOSE-AVAR10)/(AVAR13-AVAR10)*4,4)*25;
A:=IF(空方力度1<多方力度1,红线,DRAWNULL),LINETHICK2,COLOR0000FF;
RSV10:=(HHV(HIGH,11)-CLOSE)/(HHV(HIGH,11)-LLV(LOW,11))*100;
绿线:=SMA(RSV10,3,1);
B:=IF(空方力度1<多方力度1,绿线,DRAWNULL),LINETHICK2,COLORWHITE;
多方辅助:IF(CURRBARSCOUNT>5, DRAWNULL,A)COLOR0000FF,LINETHICK2;
空方辅助:IF(CURRBARSCOUNT>5, DRAWNULL,B)COLORWHITE,LINETHICK2;
强势持股:IF(空方力度<空方辅助 AND 空方力度<50 AND 空方力度<多方辅助 AND 空方辅助<多方辅助,空方力度 AND 空方辅助<REF(空方辅助,1),DRAWNULL),LINETHICK1,COLORRED;
天:95,POINTDOT,COLORFFFF00;
界:=50,POINTDOT,COLORFFFFFF;
地:5,POINTDOT;
JD1:=MAX(MAX(趋势线,牛熊线),生命线);
JX1:=MIN(MIN(趋势线,牛熊线),生命线);
一阳定势:=(C>JD1 AND O<JX1 AND 量比>1 AND CROSS(多方力度,空方力度) AND C/REF(C,1)>1.02)*一阳,COLORRED,NODRAW;
金银袋:=(C>生命线 AND L <生命线 AND C>趋势线 AND CROSS(多方力度,空方力度) AND C/REF(C,1)>1.02 AND 量比>1.1 AND C>O AND H/MAX(O,C)<1.05)*金银,COLORYELLOW,NODRAW;
红钻石:=C/REF(C,1)>1.03 AND 量比>1.1 AND CROSS(多方力度,空方力度)*红钻,COLORLIRED,NODRAW;
STICKLINE(一阳定势,50,65,2.7.2,0),COLOR0000AA;
STICKLINE(一阳定势,50,65,1.9.4,0),COLOR0000BB;
DRAWICON(红钻石,35,25);
DRAWICON(金银袋,45,9);
A5:=((CLOSE - (LLV(LOW,9))) / ((HHV(HIGH,9)) - (LLV(LOW,9)))) * 100;
A6:=SMA(A5,3,1);
A7:=SMA(A6,3,1);
A17:=MA(CLOSE,90);
A26:=((CLOSE - A17) / A17) * 100;
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K2:=SMA(RSV2,3,1);
D2:=SMA(K2,3,1);
A65:=(CROSS(K2,D2)) * 60;
A105:=MA(CLOSE,27);
A106:=((CLOSE - A105) / A105) * 100;
A107:=(MA(A106,3));
A149:=BARSLAST(((CROSS(-10,A107)) = 1));
A150:=BARSLAST(((CROSS(A107,10)) = 1));
A151:=((A107 < -10) AND (A149 > 3));
A152:=((A107 > 10) AND (A150 > 3));
安全:=(((IF(A151,A107,0)) < 0) * -10),COLORGREEN;
STICKLINE(VAR9999>-150,0,VAR9999,2,0),COLORFF00FF;
龙抬头:=((((((A65 AND 安全) AND ((A6 - A7) > 1.5)) AND (OPEN != HIGH)) AND (A26 < -10)) OR (安全 AND (CROSS(A6,A7)))) * 20)*梅花;
IF(龙抬头,6,DRAWNULL),CROSSDOT,LINETHICK6,COLORRED;
趋势线2:=MA((CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100 ,2);
钻石底:=(趋势线2<-20)*底部,COLORLIGREEN,NODRAW;
DRAWICON(钻石底,2,27);
VARL1:=(HIGH+LOW+CLOSE)/3;
VARL2:=(VARL1-MA(VARL1,14))/(0.015*AVEDEV(VARL1,14));
VARL3:=(VARL1-MA(VARL1,70))/(0.015*AVEDEV(VARL1,70));
VARL4:=IF(VARL2>=150 AND VARL2<200 AND VARL3>=150 AND VARL3<200,10,0);
VARL5:=IF(VARL2<=-150 AND VARL2>-200 AND VARL3<=-150 AND VARL3>-200,-10,VARL4);
PJX:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
短期强弱:=PJX;
VARL1A:=IF(PJX>0,PJX,0);
VARL1B:=IF(VARL3>=200 AND VARL2>=150,15,IF(VARL3<=-200 AND VARL2<=-150,-15,VARL5));
抄底:REF(VARL1B=-15,1) AND VARL1B>-15,NODRAW;
DRAWTEXT(抄底,5,' ★抄底'),COLORYELLOW;
VAR01:=(HIGH+LOW+CLOSE)/3;
VAR02:=(VAR01-MA(VAR01,14))/(0.015*AVEDEV(VAR01,14));
VAR03:=(VAR01-MA(VAR01,70))/(0.015*AVEDEV(VAR01,70));
VAR04:=IF(VAR02>=150 AND VAR02<200 AND VAR03>=150 AND VAR03<200,10,0);
VAR05:=IF(VAR02<=-150 AND VAR02>-200 AND VAR03<=-150 AND VAR03>-200,-10,VAR04);
VAR1B:=(IF(VAR03>=200 AND VAR02>=150,15,IF(VAR03<=-200 AND VAR02<=-150,-15,VAR05))+60)*逃顶;
DRAWTEXT(FILTER(VAR1B=75,5),95,'★逃顶'),COLORLIGREEN;
{Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,FGBLOCK);
Z3:=STRCAT(Z2,DYBLOCK);
Z4:=STRCAT(Z3,' ');
DRAWTEXT_FIX(ISLASTBAR,0.00,0.01,0,STRCAT(Z4,GNBLOCK)),COLORWHITE;
DRAWTEXT_FIX(1,0.00,1,0,'主题投资:')COLOR0000FF;
DRAWTEXT_FIX(1,0.07,1,0,EXTERNSTR(0,1))COLORWHITE;};
副图2主力动向
DRAWGBK(C>0,RGB(0,150,150),RGB(0,00,100),0,' ',0);
X1:=EMA((C-LLV(L,25))/(HHV(H,25)-LLV(L,25))*100,5);
X2:=(HHV(H,25)-LLV(L,25))/EMA((C-LLV(L,25)),5);
X3:=CROSS(X2,X1);
X4:=REF(X2,2)<REF(X2,1) AND X2<REF(X2,1);
X5:=COUNT(X3,7)>0 AND X4;
主力动向:X5 AND COUNT(X5,25)=1;