以下是通达信四方力道先知主图指标公式源码和使用说明
通达信四方力道波段先知主图指标公式源码:
AA05:MA(C,5),LINETHICK3,COLOR00CCFF;
五日乖离率:=(C-AA05)/AA05*100;
BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((AA05-REF(AA05,1))/REF(AA05,1),3)*100,3,1);
加速度5:EMA((速度5-REF(速度5,1)),3),NODRAW;
IF(BB05 30ANDAA05 REF(AA05,1),AA05,DRAWNULL),LINETHICK3,COLORRED;
AA10:MA(C,10);AA20:=MA(C,20);
BB10:=ATAN((AA10/REF(AA10,1)-1)*100)*180/3.1416;
IF(BB05 0ANDAA05 REF(AA05,1),AA05,DRAWNULL),LINETHICK3,COLORGREEN;
AA30:MA(C,30);
三拾日乖离率:(C-AA30)/AA30*100,NODRAW;
VAR1:=(AA20-AA30) REF((AA20-AA30),1)ANDAA20 REF(AA20,1)ANDAA30 REF(AA30,1);
VAR2:=(AA30-AA20) REF((AA30-AA20),1)ANDAA20 REF(AA20,1)ANDAA30 REF(AA30,1);
BB30:=ATAN((AA30/REF(AA30,1)-1)*100)*180/3.1416;
IF(BB30 15ANDAA30 REF(AA30,1),AA30,DRAWNULL),LINETHICK3,COLORFF00FF;
波段狙击:=FILTER(BB30 30ANDBB10 45ANDCROSS(BB05,60),10);
加仓:=FILTER(COUNT(CROSS(BB05,30),5) =1ANDAA05 REF(AA05,1)AND三拾日乖离率 REF(三拾日乖离率,1)ANDAA10 REF(AA10,1)
AND加速度5 REF(加速度5,1)AND速度5 REF(速度5,1),10);
清仓:=FILTER(COUNT(CROSS(30,BB05),5) =1AND(C AA30ORO AA30)ANDAA05 REF(AA05,1)AND三拾日乖离率 REF(三拾日乖离率,1)ANDAA10 REF(AA10,1),10);
DRAWTEXT(加仓,LOW*0.98,'←加仓'),COLORRED;
JC:=CROSS(0,五日乖离率)AND三拾日乖离率 REF(三拾日乖离率,1)ANDAA10 REF(AA10,1);
减仓:=FILTER(JC,10);
MR:=COUNT(CROSS(五日乖离率,0),3) =1AND三拾日乖离率 REF(三拾日乖离率,1)ANDAA05 REF(AA05,1)AND(C/REF(C,1)-1)*100 5ANDREF(C,1) AA30;
买入:=FILTER(MR,10);
DRAWTEXT(减仓,HIGH*1.02,'←减仓'),COLORCYAN;
DRAWTEXT(买入,LOW*0.98,'←买入'),COLORYELLOW;
DRAWTEXT(清仓,HIGH*1.02,'←清仓'),COLORGREEN;
DRAWTEXT(波段狙击,LOW*0.98,'←波段狙击'),COLORYELLOW;
VAR21:=MAX(ABS(HIGH-AMOUNT/VOL/100),ABS(AMOUNT/VOL/100-LOW));
VAR3:=ABS((OPEN+CLOSE)/2-AMOUNT/VOL/100);
MV:=(VAR21+VAR3)/AMOUNT*VOL*100*50;
操盘主图
线:MA(C,30),DOTLINECOLORFF00CC;
IF(趋势线 =REF(趋势线,1),趋势线,DRAWNULL),DOTLINE,COLORYELLOW;
回归斜率线A:EMA(SLOPE(C,21)*20+C,42);
回归斜率线B:REF(回归斜率线A,2);
IF(回归斜率线A REF(回归斜率线A,1),回归斜率线A,DRAWNULL),COLORRED;
IF(回归斜率线A REF(回归斜率线A,1),回归斜率线A,DRAWNULL),COLORGREEN;
IF(回归斜率线B REF(回归斜率线B,1),回归斜率线B,DRAWNULL),COLORRED;
IF(回归斜率线B REF(回归斜率线B,1),回归斜率线B,DRAWNULL),COLORGREEN;
经典RL:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
经典K:=SMA(经典RL,3,1);经典D:=SMA(经典K,3,1);经典J:=3*经典K-2*经典D;
MAHL1:=100*((EMA((H+L)/2,3)-LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20)))/(LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20))));
MAHL2:=IF(EMA(C,2) 回归斜率线AANDMAHL1 0,EMA(C,3),LLV(EMA((H+L)/2,5),30));{A}
MAHL3:=IF(EMA(C,2) 回归斜率线AANDMAHL1 0,LLV(EMA((H+L)/2,5),30),EMA(C,5));{A}
{回归斜率带:DRAWBAND(回归斜率线A,RGB(235,0,230),REF(回归斜率线A,2),RGB(0,104,154));}
{C 昨C红K柱+C O红K柱C 昨C红K柱C=昨C是跟白色24线
C 昨C蓝K柱+C O红K柱C 昨C蓝K柱}
{STICKLINE(CLOSE REF(CLOSE,1),HIGH,LOW,0,0),COLORRED;
STICKLINE(C OANDC REF(C,1),C,O,3,0),COLORFFCC00;}
{STICKLINE(CLOSE REF(CLOSE,1)ANDC O,OPEN,CLOSE,2.1,0),COLOR000099;
STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR0000BB;
STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR0000DD;
STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR0000FF;}
STICKLINE(CLOSE=REF(CLOSE,1),H,L,3,1),COLOR999999;
STICKLINE(CLOSE=REF(CLOSE,1),HIGH,LOW,0,0),COLORWHITE;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR555555;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR777777;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR999999;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLORBBBBBB;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLORDDDDDD;
STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLORFFFFFF;
{STICKLINE(CLOSE REF(CLOSE,1),HIGH,LOW,0,1),COLORCYAN;
STICKLINE(C REF(C,1)ANDC O,C,O,3,0),COLORFFCC00;
STICKLINE(C REF(C,1)ANDC O,OPEN,CLOSE,3,0),COLOR990000;
STICKLINE(C REF(C,1)ANDC O,OPEN,CLOSE,2.7,0),COLORCC0000;
STICKLINE(CLOSE REF(C,1),OPEN,CLOSE,2.1,0),COLORFF4400;
STICKLINE(CLOSE REF(C,1),OPEN,CLOSE,1.5,0),COLORFF8800;
STICKLINE(CLOSE REF(C,1),OPEN,CLOSE,0.9,0),COLORFFCC00;}
{经典KDJ买:IF(CROSS(经典K,经典D),(L-(H-L)/2),DRAWNULL),POINTDOT,LINETHICK6,COLOR0000FF;
经典KDJ买:IF(CROSS(经典K,经典D),(L-(H-L)/2),DRAWNULL),POINTDOT,LINETHICK6,COLOR0000FF;}
DRAWICON(CROSS(经典K,经典D),L*0.96,26);
{高亮红}
回归斜率买:IF(CROSS(EMA(C,3),回归斜率线A),(L-(H-L)/3),DRAWNULL),POINTDOT,COLOR0000FF;{高亮红}
回归斜率买_:DRAWICON(CROSS(EMA(C,3),回归斜率线A),L*0.98,1),{买};
回归斜率卖:IF(CROSS(回归斜率线A,EMA(C,2)),(H+(H-L)/3),DRAWNULL),POINTDOT,COLOR00CF00;{中绿}
卖:DRAWICON(CROSS(回归斜率线A,EMA(C,2)),H*1.03,2);
经典KDJ卖:IF(CROSS(经典D,经典K),(H+(H-L)/2),DRAWNULL),CROSSDOT,LINETHICK3,COLOR00CF00;{中绿};
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,9,1);
D:=SMA(K,9,1);
J:=3*K-2*D;
X2:=LLV(J,2)=LLV(J,8);
{DRAWTEXT(CROSS(J,REF(J+0.01,1))ANDX2ANDJ 20,LOW*0.99,'★买'),COLORYELLOW;}
DRAWICON(CROSS(J,REF(J+0.01,1))ANDX2ANDJ 20,LOW*0.99,23);
VAR6:=REF(C,1);
VAR7:=SMA(MAX(C-VAR6,0),6,1)/SMA(ABS(C-VAR6),6,1)*100;
DRAWTEXT(CROSS(84,VAR7),H*1.01,''),COLORYELLOW;
AA:=(REF(H,1)-MAX(REF(C,1),REF(O,1)))/(REF(H,1)-REF(L,1)) 0.6AND(MIN(O,C)-L)/(H-L) 0.6ANDVOL REF(VOL,1);
DRAWTEXT(AA,L*0.99,'揉搓'),COLORRED;
C3:=REF(C,1);
跌停:=IF((C3-C)*100/C3 =(10-0.01*100/C3),1,0);
STICKLINE(跌停,OPEN,CLOSE,3,0),COLORBLUE;
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
{DRAWTEXT(跌停,H+0.1,'跌停'),COLORGREEN;}
:=IF(REF(C,1)*1.095-C 0.01,1,0);
STICKLINE(涨停,OPEN,CLOSE,3,0),COLORRED;
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORYELLOW;
{DRAWTEXT(涨停,L-0.1,'板'),COLORYELLOW;}
超B:=L2_AMO(0,2)/10000.0;
大B:=L2_AMO(1,2)/10000.0;
中B:=L2_AMO(2,2)/10000.0;
小B:=L2_AMO(3,2)/10000.0;
超S:=L2_AMO(0,3)/10000.0;
大S:=L2_AMO(1,3)/10000.0;
中S:=L2_AMO(2,3)/10000.0;
小S:=L2_AMO(3,3)/10000.0;
TESTSKIP(NOT(超BOR大BOR中BOR小BOR超SOR大SOR中SOR小S)!=0);
大宗进:=(超B)+(大B),NODRAW;
大宗出:=(超S)+(大S),NODRAW;
非大宗进:=(中B)+(小B),NODRAW;
非大宗出:=(中S)+(小S),NODRAW;
DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;
DRAWRECTREL(0,CONST(950-(ABS(大宗进)*250/DAZHIV))-20,30,950,IF(CONST(大宗进 0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(32,CONST(950-(ABS(大宗出)*250/DAZHIV))-20,62,950,IF(CONST(大宗出 0),RGB(23,125,255),RGB(255,0,0)));
DRAWRECTREL(92,CONST(950-(ABS(非大宗进)*250/DAZHIV))-20,122,950,IF(CONST(非大宗进 0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(124,CONST(950-(ABS(非大宗出)*250/DAZHIV))-20,154,950,IF(CONST(非大宗出 0),RGB(23,125,255),RGB(255,0,0)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.015,1,0,'进出'),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.107,1,0,'进出'),COLORCYAN;
M1:=EMA(EMA(C,21),3);
M2:=EMA(EMA(C,34),3);
TT2:=CROSS(C,M1)ANDCROSS(C,M2);
DRAWTEXT(TT2,L*0.96,'阳');
四方力道
{四方力道}
V1:=DMA((((HIGH+LOW)+(CLOSE*2))/4.15),0.9);
HY1:=REF(EMA(V1,3),1);
实时线:MA(CLOSE,1),COLOR006400;
神秘线:HY1,COLOR400080;
DRAWTEXT(CROSS(CLOSE,HY1),LOW*0.95,'B'),LINETHICK2,COLORYELLOW;
DRAWTEXT(CROSS(HY1,CLOSE),HIGH*1.08,'S'),LINETHICK3,COLORWHITE;
APP:=(VOL/(((HIGH-LOW)*2)-ABS((CLOSE-OPEN))));
ZL:=IF((CLOSE OPEN),(APP*(HIGH-LOW)),IF((CLOSE OPEN),(APP*((HIGH-OPEN)+(CLOSE-LOW))),(VOL/2)));
SF:=IF((CLOSE OPEN),(0-(APP*((HIGH-CLOSE)+(OPEN-LOW)))),IF((CLOSE OPEN),(0-(APP*(HIGH-LOW))),(0-(VOL/2))));
库存能量:=MA((ZL+SF),2);
库存平均:=MA((ZL+SF),5);
DRAWTEXT(CROSS(库存能量,库存平均),L*0.97,''),COLORFF00FF,LINETHICK4;
{波段主图}
工作线:=MA(CLOSE,1);
趋势线:MA(CLOSE,18)COLORGREEN,LINETHICK2;
强势线:MA(CLOSE,3)COLORRED,LINETHICK2;
TT2:=DMA((((HIGH+LOW)+(CLOSE*2))/4.15),0.9);
TT1:=REF(EMA(TT2,3),1);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100);
FF:=EMA(CLOSE,3);
MA144:EMA(CLOSE,144),POINTDOT,COLORWHITE;
MA318:EMA(C,318);
AA1:=AMOUNT/VOL;
BB1:=L1.2;
DD1:=L MA(C,5)*0.921;
EE1:=VOL MA(V,5)*1.5;
FF1:=BB1ANDCC1ANDDD1ANDEE1;
F:=100*(C-REF(C,1))/REF(C,1);
P1:=IF(C REF(O,1)ANDF 0,1,0);
P2:=IF(C REF(O,2)ANDF 0,1,0);
TT3:=P1=0ANDREF(P1,1)=1ANDP2=0ANDREF(P2,1)=1;
TT4:=P1=1ANDREF(P1,1)=0ANDP2=1ANDREF(P2,1)=0;
Z1:=MA(C,13);
ZX:=REF(Z1,13/2+1);
DRAWICON(CROSS(ZX,C),H*1.01,2);
DRAWTEXT(CROSS(工作线,趋势线)ANDJ 55,LOW,'入')COLORWHITE;
DRAWTEXT(CROSS(CLOSE,TT1)ANDJ 55,LOW,'买'),COLORRED;
DRAWTEXT(CROSS(88,RSI),HIGH*1.02,'顶'),COLOR00FFFF;
DRAWTEXT(FF1,L*0.99,'超短'),COLOR00FF00;
STICKLINE(TT3,OPEN,CLOSE,3,0),COLORFF00FF;
STICKLINE(TT4,OPEN,CLOSE,3,0),COLORGREEN;
TT5:=5;
V1:=MA(HIGH,30)*1.15;
V2:=MA(HIGH,3)*1.03;
V3:=MA(LOW,3)*0.97;
V4:=MA(LOW,30)*0.85;
GET:ZIG(3,TT5)COLORWHITE,LINETHICK3;
{先知主图}
VAR2:=REF(LOW,1);
VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100;
VAR4:=EMA(IF(CLOSE*1.3,VAR3*10,VAR3/10),3);
VAR5:=LLV(LOW,30);
VAR6:=HHV(VAR4,30);
VAR7:=IF(MA(CLOSE,58),1,0);
VAR8:=EMA(IF(LOW =VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;
VAR9:=IF(VAR8 100,100,VAR8);
STICKLINE(VAR9 -150,0,VAR9,0.1,0),COLORFF00FF;
吸筹指标:(CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100,COLOR00FF00;
STICKLINE(CROSS(吸筹指标,-24),100,0,1,0),COLORFFFFFF;
先知:(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100,COLORFF00FF;
放量拉升:IF(CROSS(吸筹指标,-24),1,0),COLORFFFFFF;
获利:STICKLINE(REF("KDJ.J",1) 0AND"KDJ.J" 0,60,0,1,0),COLOR0000FF;
VARK1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
VARK2:=REVERSE(VARK1);
VARK3:=SMA(VARK1,3,1);
波段王:SMA(VARK3,3,1),COLORRED,LINETHICK2;
波段鬼:SMA(波段王,2.5,1),COLORYELLOW,LINETHICK2;
趋势线: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),COLORFF6666,LINETHICK2;
RSV9:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K1:SMA(RSV9,3,1);
DK1:K1-REF(K1,1),COLORSTICK;
出手就赢:IF(DK1 7ANDREF(DK1,1) 0AND(DK1-REF(DK1,1)) 9,50,0),STICK,COLORYELLOW;DRAWICON(出手就赢 0,50,1);
STICKLINE(CROSS(趋势线,10),0,73,3,0),COLOR3366FF;
DRAWTEXT(IF(CROSS(趋势线,10),100,0),68,'底'),COLORWHITE;
DRAWTEXT(IF(CROSS(10,趋势线),1,0),10,'钱'),COLOR33FFCC;
DRAWTEXT(REF("KDJ.J",1) 0AND"KDJ.J" 0,50,'买'),COLORRED;
DRAWTEXT(CROSS(吸筹指标,-24),80,'底'),COLORWHITE;
RSV:=(((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9)))*100);
短期底部:=LLV(OPEN,30);
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=((3*K)-(2*D));
AA10:=MA(CLOSE,10);
AA12:=MA(CLOSE,12);
BB10:=((ATAN((AA10-REF(AA10,1)))*3.1416)*10);
BB12:=((ATAN((AA12-REF(AA12,1)))*3.1416)*10);
MA13:=MA(CLOSE,13);
VARB:=(((CLOSE-MA(CLOSE,6))/MA(CLOSE,6))*100);
VARC:=(((CLOSE-MA(CLOSE,12))/MA(CLOSE,12))*100);
VARD:=(((CLOSE-MA(CLOSE,24))/MA(CLOSE,24))*100);
VARE:=(((VARB+(2*VARC))+(3*VARD))/6);
VARF:=MA(VARE,3);
STICKLINE((CROSS(J,0)AND(VARF =(0-7))),0,88,2,0),COLORBLUE;
DRAWICON((CROSS(J,0)AND(VARF =(0-7))),88,9);
VARO2:=(CLOSE-LLV(LOW,26))/(HHV(HIGH,26)-LLV(LOW,26))*100;
VARO3:=SMA(SMA(VARO2,3,1),3,1);
VARO4:=EMA(VARO3,5);
VARO5:=LLV(LOW,26);
VARO6:=HHV(HIGH,34);
VARO7:=EMA((CLOSE-VARO5)/(VARO6-VARO5)*4,4)*25;
STICKLINE(CROSS(VARO4,10)ANDVARO4 10,25,0,1,0),COLORYELLOW;
建仓区:IF((VARO7 10),0,20),LINETHICK3,COLORRED;
CLOSE10:=(CLOSE+LLV(CLOSE,15));
HIGH10:=(HIGH+LLV(HIGH,15));
LOW10:=(LOW+LLV(LOW,15));
JJ:=(CLOSE10+HIGH10+LOW10)/3;
BB:=(CLOSE10+HIGH10)/2;
TT:=(CLOSE10+LOW10)/2;
SS:=(HIGH10+LOW10)/2;
VAR1:=(JJ+BB)/2;
VAR2:=(TT+SS)/2;
VAR3:=EMA(0.667*REF(VAR2,1)+0.333*VAR1,2);
VAR4:=EMA(0.667*REF(VAR1,1)+0.333*VAR2,2);
STICKLINE(VAR1-VAR2 0,VAR1,VAR2,10.0),colorred;
STICKLINE(VAR2-VAR3 0,VAR2,VAR3,10,0),COLOOFFOF;
STICKLINE(VAR1-VAR4 0,VAR1,VAR4,10,0),colorred;
V1:EMA(SS,1),colorred,Iinethick1;
V2:EMA(VAR2,4),CoIorOOFFFF,Iinethick1;
V3:EMA(VAR3,6),colorwhite,Iinethick1;
通达信四方力道波段先知主图指标公式截图