【通达信源码分享】分时主图副图两指标 盘中T+0必备指标
1.分时主图
ZRS:=CONST(DYNAINFO(3)),NODRAW;
A1:=3.5(EMA(CLOSE,48)-EMA(CLOSE,104))+ZRS,COLORLIMAGENTA;
A2:=EMA(A1,36),COLORLIBLUE;
MACD:=(A1-A2)2+ZRS;
DRAWKLINE(H,O,L,C);
STICKLINE(A1>=A2,ZRS,MACD ,1,0),COLORRED;
STICKLINE(A1>=A2 AND MACD<REF(MACD,1),ZRS,MACD ,1,0),COLORYELLOW;
STICKLINE(A1<A2,ZRS,MACD ,1,0),COLORCYAN;
STICKLINE(A1<A2 AND MACD>REF(MACD,1),ZRS,MACD ,1,0),COLORFFFFFF;
C,COLORWHITE,LINETHICK2;
均价:SUM(V*C,0)/SUM(V,0),COLORGREEN,LINETHICK1;
IF(均价<=REF(均价,1),均价,DRAWNULL),COLORGREEN;
IF(均价>=REF(均价,1),均价,DRAWNULL),COLORYELLOW;
2.分时副图
VAR10:=EMA(CLOSE,12)-EMA(CLOSE,26);
VAR2:=EMA(VAR10,9);
VAR3:=2(VAR10-VAR2)5+50;
N:=13;M:=9;M1:=3;
VAR11:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))100;
VAR21:=SMA(VAR11,M1,1);
KK:= SMA(VAR21,M1,1);
DD:= SMA(KK,M1,1);
VAR12:=((CLOSE - LLV(LOW,50))/(HHV(HIGH,50) - LLV(LOW,50)))(100);
VAR22:=REVERSE(VAR12);
VAR32:=SMA(VAR12,6,1);
K:=SMA(VAR32,4,1);
D:=SMA(K,4,1);
DRAWBAND(K,RGB(255,0,0),D,RGB(0,201,87));
现价:=CLOSE,COLORFFFFFF,LINETHICK2;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L11:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L11;
阻力:=L11+P17/8,COLOR00DD00;
支撑:=L11+P10.5/8,COLOR00DD00;
STICKLINE(CROSS(支撑,现价),9,60,2,0),COLORYELLOW,LINETHICK5;
STICKLINE(CROSS(现价,阻力),40,90,2,0),COLORFFCC66,LINETHICK5;
指标线1:="MACD.DIF";
指标线2:="MACD.DEA";
条件:=CROSS(指标线1,指标线2) AND 指标线2<0;
周期数:=BARSLAST(REF(条件,1))+1;
上次交点:=(REF(指标线1,周期数) + REF(指标线1,周期数+1))/2;
本次交点:=(指标线1 + REF(指标线1,1))/2;
低位二次金叉:= COUNT(条件,21)>=2 AND 条件 AND 本次交点>上次交点;
低二金叉:IF(低位二次金叉=1,60,9)COLORFFCC66;
N0:=27;NN:=26;M10:=10;M2:=20;M3:=40;M4:=62;
D0:=REF(HIGH+LOW,1)/2;
RE:=SUM(MAX(0,HIGH-D0),NN)/SUM(MAX(0,D0-LOW),NN)100;
MA1:=REF(MA(RE,M10),M10/2.5+1),LINETHICK3;
MA2:=REF(MA(RE,M2),M2/2.5+1);
{MA3:REF(MA(RE,M3),M3/2.5+1);
MA4:REF(MA(RE,M4),M4/2.5+1);}
A:=MA(RE,5);
BR:=(SUM(MAX(0,HIGH-REF(CLOSE,1)),NN)/SUM(MAX(0,REF(CLOSE,1)-LOW),NN)100)COLORCYAN;
AR:=SUM(HIGH-OPEN,NN)/SUM(OPEN-LOW,NN)100;
VAR100:=3;
VAR200:=((3 * SMA((((CLOSE - LLV(LOW,N0)) / (HHV(HIGH,N0) - LLV(LOW,N0))) * 100),5,1)) - (2 * SMA(SMA((((CLOSE - LLV(LOW,N0)) / (HHV(HIGH,N0) - LLV(LOW,N0))) * 100),5,1),3,1)));
买:=IF(CROSS(VAR200,VAR100),40,0)COLORYELLOW,LINETHICK2;
底:IF(RE<50,40,9)COLORRED;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIF,9);
DRAWICON(DIF<0 AND CROSS(DIF, DEA1),9,11);
DRAWICON(DIF>0 AND CROSS( DEA1,DIF),85,12);
MACD:="MACD.MACD";
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);
QG:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1);
QQQQ:=CROSS(MACD>前高,0.5);
过前高:IF(QQQQ=1,90,9)COLORRED;
RSV1:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))100;
RSV2:=(CLOSE-LLV(LOW,37))/(HHV(HIGH,37)-LLV(LOW,37))100;
RSV3:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))100;
短线1:=SMA(SMA(RSV1,3,1),3,1)+3STD(CLOSE,21),COLORGREEN;
中线1:=SMA(RSV2,5,1)+2STD(CLOSE,37),COLORRED;
长线1:=SMA(RSV3,5,1),COLORYELLOW;
STICKLINE(短线1<15,短线1,15,8,0),COLORYELLOW;
STICKLINE(中线1<15 ,中线1,15,8,0),COLORYELLOW;
STICKLINE(长线1<15,长线1,15,8,0),COLORYELLOW;
STICKLINE(短线1<15 AND 中线1<15 AND 长线1<15,MAX(长线1,MAX(短线1,中线1)),15,8,0),COLORYELLOW;
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!