通达信指标公式源码主力追踪指标.doc
2024-12-28 03:17
多线: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 VAR413),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;