通達信公式分時主圖指標(biāo)(源碼)
IF(MACD.DEA<0,C,DRAWNULL),COLORGREEN,LINETHICK9; XX:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(V*100,BARSCOUNT(CLOSE)); 主力:=EXPMA(CLOSE/XX,20);大戶:=EXPMA(CLOSE/XX,60);散戶:=EXPMA(CLOSE/XX,120); 底:=1;1.02,NODRAW;高:=1.03; DRAWTEXT(CROSS(主力,1.02),C*0.999,"-拉升"),COLORCYAN; DRAWICON(CROSS(主力,1.04),C,24); DRAWTEXT(CROSS(主力,1.04),C*0.999,"-沖漲停"),COLORLIMAGENTA; A1:=(VOL/CLOSE)/3; A2:=SUM((IF(((A1>40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0); A3:=SUM((IF(((A1>40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0); A4:=SUM((IF(((A1<40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0); A5:=SUM((IF(((A1<40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0); A6:=((A2+A3)+A4)+A5; A7:=IF((BARSTATUS=2),((100*A2)/A6),0); A8:=((IF((BARSTATUS=2),((100*A3)/A6),0))); A9:=((IF((BARSTATUS=2),((100*A4)/A6),0))); A10:=((IF((BARSTATUS=2),((100*A5)/A6),0))); 機構(gòu)買盤:=(A2),LINETHICK2; 機構(gòu)賣盤:=(A3),LINETHICK2; 散戶買盤:=(A4); 散戶賣盤:=(A5); DRAWTEXT_FIX(1,0.000,1-0.05,0,STRCAT(STRCAT("【機構(gòu)買盤】",CON2STR(機構(gòu)買盤,2)),"萬")),COLORRED; DRAWTEXT_FIX(1,0.250,1-0.05,0,STRCAT(STRCAT("【機構(gòu)賣盤】",CON2STR(機構(gòu)賣盤,2)),"萬")),COLOR00FF00; DRAWTEXT_FIX(1,0.500,1-0.05,0,STRCAT(STRCAT("【散戶買盤】",CON2STR(散戶買盤,2)),"萬")),COLORRED; DRAWTEXT_FIX(1,0.745,1-0.05,0,STRCAT(STRCAT("【散戶賣盤】",CON2STR(散戶賣盤,2)),"萬")),COLOR00FF00; H1:=MAX(DYNAINFO(3),DYNAINFO(5)); L1:=MIN(DYNAINFO(3),DYNAINFO(6)); P1:=H1-L1; 阻力:=L1+P1*7/8,COLORGREEN; 支撐:=L1+P1*0.5/8,COLORMAGENTA; DRAWTEXT(LONGCROSS(支撐,C,2),C,"買"),COLOR00FFFF; DRAWTEXT(LONGCROSS(C,阻力,2),C,"出"),COLORGREEN; CC:=C; TT:=BARSCOUNT(CC); 均價:SUM(V*C,0)/SUM(V,0),COLORGREEN; 均:=MA(CC,TT); DRAWICON(CROSS(均價,均),均價,1); 突破:=REF(EMA(C,20),1); A1X:=(EMA(C,10)-突破)/突破*100; 多方:=IF(A1X>=0,REF(EMA(C,10),BARSLAST(CROSS(A1X,0))+1),DRAWNULL); 空方:=IF(A1X<0,REF(EMA(C,10),BARSLAST(CROSS(0,A1X))+1),DRAWNULL); STICKLINE(A1X>=0,多方,突破,2,0),COLOR0000FF; STICKLINE(A1X<0,空方,突破,2,0),COLOR00FF00; 量價:=(VOL/CLOSE)/3; B2:=SUM((IF(((量價>0.20) AND (CLOSE>(REF(CLOSE,1)))),量價,0)),0); B3:=SUM((IF(((量價>0.20) AND (CLOSE<(REF(CLOSE,1)))),量價,0)),0); B6:=B2+B3;DD1:=1;比:=B2/B3; BBB1:=STRCAT(STRCAT("買= ",CON2STR((100*B2)/B6,0)),"%"); BBB2:=STRCAT(STRCAT("賣= ",CON2STR((100*B3)/B6,0)),"%"); BBB3:=STRCAT(STRCAT("差= ",CON2STR((100*(B2-B3))/B6,0)),"%"); DRAWTEXT_FIX(DD1=1,0,0.04,0,BBB1),COLORRED; DRAWTEXT_FIX(DD1=1,0,0.12,0,BBB2),COLORGREEN; DRAWTEXT_FIX(DD1=1,0,0.20,0,BBB3),COLOR00FFFF; 中期線:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4)+100; DRAWTEXT(比<1.1,(DYNAINFO(5)+DYNAINFO(6))/2,"○"),COLORGREEN; DRAWTEXT(比>1.5,(DYNAINFO(5)+DYNAINFO(6))/2,"○"),COLORCYAN; DRAWTEXT(比>2,(DYNAINFO(5)+DYNAINFO(6))/2,"○"),COLORMAGENTA; DRAWTEXT(比>2.5,(DYNAINFO(5)+DYNAINFO(6))/2,"○"),COLORRED; DRAWTEXT((比>1.1 AND 中期線<5),(DYNAINFO(5)+DYNAINFO(6))/2,"●"),COLORWHITE; DRAWTEXT((比<1.1 AND 中期線>98.0),(DYNAINFO(5)+DYNAINFO(6))/2,"●"),COLORWHITE; DRAWTEXT((比>1.1 AND 中期線<5),C,"--機會"),COLORYELLOW; DRAWTEXT((比<1.1 AND 中期線>98.0),C,"--風(fēng)險"),COLORYELLOW; 上漲家數(shù):IF(PERIOD=0 ,"分時引.上漲家數(shù)#DAY",DRAWNULL),NODRAW; 下跌家數(shù):IF(PERIOD=0 ,"分時引.下跌家數(shù)#DAY",DRAWNULL),NODRAW; DRAWTEXT_FIX(1,0.160,1-0.12,0,STRCAT("上漲家數(shù):",CON2STR(上漲家數(shù),0))),COLOR0000FF; DRAWTEXT_FIX(1,0.650,1-0.12,0,STRCAT("下跌家數(shù):",CON2STR(下跌家數(shù),0))),COLOR00FF00;
|