通达信量能平台+趋势线主图指标公式
- 指标类别: 通达信指标公式
- 授权方式: 免费版
- 指标评级: ★★★★★
- 指标分类: 趋势
- 画线方法: 主图
- 日期:2022-12-05 来源:互联网
通达信量能平台+趋势线主图指标公式:包含未来函数:BACKSET,DYNAINFO,FINANCE
N1:=5;G:=5;
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:MA(CLOSE,30),LINETHICK2;
MA60:MA(CLOSE,60),COLORRED,LINETHICK2;
MA144:MA(CLOSE,144),COLOR9F5F9F;
{金差价}
{AD:=MA(C,N1)-MA(C,M1);
BD:=BACKSET(1,MA(C,N1)/N1-BACKSET(1,MA(C,M1)))/M1;
价差:AD/BD/N1,NODRAW;
价:=AD/BD/N1,NODRAW;
叉价价:(价-DYNAINFO(7))*(-1),NODRAW;
MA5叉:(价-MA(C,N1))*(-1),COLORRED,NODRAW;}
{5、10周均线}
ZRR:=(YEAR-1992)*365+INTPART((YEAR-1989)/4)+IF(MONTH<=2,DAY+(MONTH-1)*31,DAY+
INTPART(13*(MONTH+1)/5)-7+(MONTH-1)*28+IF(INTPART(YEAR/4)=YEAR/4,1,0)),NODRAW;
T:=BARSLAST(ZRR-REF(ZRR,1)>WEEKDAY-REF(WEEKDAY,1))+1,NODRAW;
T1:=REF(T,T)+T,NODRAW;
T2:=REF(T,T1)+T1,NODRAW;
T3:=REF(T,T2)+T2,NODRAW;
T4:=REF(T,T3)+T3,NODRAW;
T5:=REF(T,T4)+T4,NODRAW;
T6:=REF(T,T5)+T5,NODRAW;
T7:=REF(T,T6)+T6,NODRAW;
T8:=REF(T,T7)+T7,NODRAW;
周5:=(REF(CLOSE,T)+REF(CLOSE,T1)+REF(CLOSE,T2)+REF(CLOSE,T3)+CLOSE)/5,COLORE6E8FA,LINETHICK2;
周10:=(REF(CLOSE,T)+REF(CLOSE,T1)+REF(CLOSE,T2)+REF(CLOSE,T3)+REF(CLOSE,T4)+
REF(CLOSE,T5)+REF(CLOSE,T6)+REF(CLOSE,T7)+REF(CLOSE,T8)
+CLOSE)/10,COLORBLUE,LINETHICK2;
日跌:= L*0.99,NODRAW,COLORFF00FF;
周跌:= L*0.94,NODRAW,COLORFF00FF;
{支撑压力}
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC,H*1.02,2);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高压:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORFF00FF,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,POINTDOT;
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,POINTDOT;
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1,L*0.98,1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低支:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORFF00FF,LINETHICK1;
ZGSTAR:=(高压+低支)/2;
ZGEND:=CONST((高压+低支)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:=DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF00FF,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORMAGENTA,POINTDOT,;
DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLORCYAN,POINTDOT;
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;
{量能平台}
G21:=30;
T112:=CONST(HHVBARS(V,G21));
T122:IF(CURRBARSCOUNT<=G21+7,CONST(IF(T112=0,H,REF(H,T112))),DRAWNULL);
IF(CURRBARSCOUNT=T112+1,T122,DRAWNULL),CIRCLEDOT;
DRAWTEXT(ISLASTBAR,T122,' 30天量能平台');
{W:=10;
TW1:=CONST(HHVBARS(V,W));
TW0:IF(CURRBARSCOUNT<=W+7,CONST(IF(TW1=0,C,REF(C,TW1))),DRAWNULL);}
{IF(CURRBARSCOUNT=TW1+1,TW0,DRAWNULL),CIRCLEDOT;}
{DRAWTEXT(ISLASTBAR,TW0,' 10量能平台');}
{MW:=10;
MW1:=CONST(LLVBARS(V,MW));
MW0:IF(CURRBARSCOUNT<=MW+7,CONST(IF(MW1=0,O,REF(O,MW1))),DRAWNULL);
IF(CURRBARSCOUNT=MW1+1,MW0,DRAWNULL),CIRCLEDOT;}
{DRAWTEXT(ISLASTBAR,MW0,' 地量反量能平台');}
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDDDD:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
AAB:=REF(H,G)=HHV(H,2*G+1); AAB1:=REF(L,G)=LLV(L,2*G+1);
QYB:=BACKSET(AAB,G+1); QYB1:=BACKSET(AAB1,G+1);
CCB:=FILTER(QYB,G) AND H=HHV(H,G+1); CCB1:=FILTER(QYB1,G) AND L=LLV(L,G+1);
DDDB:=BARSLAST(CCB); DDB1:=BARSLAST(CCB1);
GDTSB:=IF(CCB,CURRBARSCOUNT,0); DDTSB:=IF(CCB1,CURRBARSCOUNT,0);
DINGBUTSB:=IF(DDDB,REF(GDTSB,DDDB),GDTSB); DDTSB1:=IF(DDB1,REF(DDTSB,DDB1),DDTSB);
GDCSB1:=CONST(DINGBUTSB); DDCSB1:=CONST(DDTSB1);
GDCS13:=CONST(REF(HIGH,GDCSB1-1)); DDCS13:=CONST(REF(L,DDCSB1-1));
DINGBUTSB1:=REF(DINGBUTSB,DDDB+1); DDTSB2:=REF(DDTSB1,DDB1+1);
GDCSB2:=CONST(DINGBUTSB1); DDCSB2:=CONST(DDTSB2);
GDCS23:=CONST(REF(HIGH,DINGBUTSB1-1)); DDCS23:=CONST(REF(L,DDTSB2-1));
XG1:=BACKSET(ISLASTBAR,GDCSB1); XD1:=BACKSET(ISLASTBAR,DDCSB1);
XG2:=BACKSET(ISLASTBAR,DINGBUTSB1); XD2:=BACKSET(ISLASTBAR,DDTSB2);
XDD:=IF(DDCS13<=DDCS23,XD1,XD2);
M:=INTPART(3*G/5);
AAAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC),NODRAW;
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M)=LLV(L,2*M+1);
QY11:=BACKSET(AA11,M+1);
CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
HH1:= REF(H,GDCSB1-1),NODRAW;
HH2:= REF(H,GDCSB2-1),NODRAW;
HH11:= REF(H,GDCS11-1),NODRAW;
HH22:= REF(H,GDCS22-1),NODRAW;
GHH1:=MAX(MAX(REF(H,GDCSB1-1),REF(H,GDCSB2-1)),MAX(REF(H,GDCS11-1),REF(H,GDCS22-1))),NODRAW;
DLL1:=MIN(MIN(REF(L,DDCSB1-1),REF(L,DDCSB2-1)),MIN(REF(L,DDCS11-1),REF(L,DDCS22-1))),NODRAW;
GHH:=MAX(GHH1,HHV(H,10));
DLL:=MIN(DLL1,LLV(L,10));
DX1:=(REF(H,GDCSB1-1)-REF(H,GDCSB2-1))/(GDCSB2-GDCSB1),NODRAW;
DX2:=(REF(H,GDCS11-1)-REF(H,GDCS22-1))/(GDCS22-GDCS11),NODRAW;
GGAA:=DX1>0 AND (REF(H,(GDCSB1-1))+DX1*GDCSB1)>GHH*1.05,NODRAW;
GGAB:=DX1<0 AND (REF(H,(GDCSB1-1))+DX1*GDCSB1)<DLL*0.95,NODRAW;
DDX1:=IF(GGAA OR GGAB,0,1),NODRAW;
GGBA:=DX2>0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)>GHH*1.05,NODRAW;
GGBB:=DX2<0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)<DLL*0.95,NODRAW;
DDDX1:=IF(GGBA OR GGBB,0,1),NODRAW;
LX1:=(REF(L,DDCSB1-1)-REF(L,DDCSB2-1))/(DDCSB2-DDCSB1),NODRAW;
LX2:=(REF(L,DDCS11-1)-REF(L,DDCS22-1))/(DDCS22-DDCS11),NODRAW;
DDAA:=LX1<0 AND (REF(L,(DDCSB1-1))+LX1*DDCSB1)<DLL*0.95,NODRAW;
DDAB:=LX1>0 AND (REF(L,(DDCSB1-1))+LX1*DDCSB1)>GHH*1.05,NODRAW;
LLX1:=IF(DDAA OR DDAB,0,1);
DDBA:=LX2<0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)<DLL*0.95,NODRAW;
DDBB:=LX2>0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)>GHH*1.05,NODRAW;
LLLX1:=IF(DDBA OR DDBB,0,1),NODRAW;
高压力:DRAWLINE(CURRBARSCOUNT=GDCSB2,H,CURRBARSCOUNT=GDCSB1,H,DDX1),COLORYELLOW,LINETHICK1;
低支撑:DRAWLINE(CURRBARSCOUNT=DDCSB2,L,CURRBARSCOUNT=DDCSB1,L,LLX1),COLORYELLOW,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=GDCS22 ,H,CURRBARSCOUNT=GDCS11,H,DDDX1),COLORRED,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=DDCS22 ,L,CURRBARSCOUNT=DDCS11,L,LLLX1),COLORRED,LINETHICK1;
AS:=(H+(H-(L-(H-L)))-LLV(L,12))/(HHV(H+(H-L),12)-LLV(L,12));
AS1:=SMA(AS,12,1);
AS2:=SMA(AS1,12,1);
AS3:=3*AS1-2*AS2 ;
AS4:=2*AS3-0.5;
AS5:=C*(1-(AS4-AS2)/30);
AAAB1:=30*AS5+29*REF(AS5 ,1 )+28*REF(AS5 ,2 )+27*REF(AS5 ,3 )+26*REF(AS5 ,4 )+25*REF(AS5 ,5 )
+24*REF(AS5 ,6 )+23*REF(AS5 ,7 )+22*REF(AS5 ,8 )+21*REF(AS5 ,9 )+20*REF(AS5 ,10 )
+19*REF(AS5 ,11 )+18*REF(AS5 ,12 )+17*REF(AS5 ,13 )+16*REF(AS5 ,14 )+15*REF(AS5 ,15 )
+14*REF(AS5 ,16 )+13*REF(AS5 ,17 )+12*REF(AS5 ,18 )+11*REF(AS5 ,19 )+10*REF(AS5 ,20 )
+9*REF(AS5 ,21 )+8*REF(AS5 ,22 )+7*REF(AS5 ,23 )+6*REF(AS5 ,24 )+5*REF(AS5 ,25 )
+4*REF(AS5 ,26 )+3*REF(AS5 ,27 )+2*REF(AS5 ,28 )+REF(AS5 ,29 );
AS51:=AAAB1/465;
MTM:=C-REF(C,1);
ZLGJ:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买1:=IF(LLV(ZLGJ,2)=LLV(ZLGJ,7) AND COUNT(ZLGJ<0,2) AND CROSS(ZLGJ,MA(ZLGJ,2)),1,0);
卖1:=IF(HHV(ZLGJ,2)=HHV(ZLGJ,7) AND COUNT(ZLGJ>50,2) AND CROSS(MA(ZLGJ,2),ZLGJ),1,0);
{STICKLINE(FILTER(买1=1,1),C,O,1,0),COLORFF00FF;
STICKLINE(FILTER(卖1=1,1),C,O,1,0),COLORRED;}
BDGD:=HHV(J,2)=HHV(J,8) AND J>80;
注意:=IF(CROSS(REF(J-0.01,1),J) AND REF(BDGD,1),1,0);
{STICKLINE(注意 AND 卖1<1,O,CLOSE,1,0),COLORYELLOW,LINETHICK2;}
{A3X:(MA5-REF(MA5,1))/REF(MA5,1)*100,NODRAW;
IF(A3X>=0,MA5,DRAWNULL),COLORWHITE,LINETHICK1;}
{A1X:(MA60-REF(MA60,1))/REF(MA60,1)*100,NODRAW;
IF(A1X>=0,MA60,DRAWNULL),COLORLIGRAY,LINETHICK1;}
{A4X:(MA10-REF(MA10,1))/REF(MA10,1)*100,NODRAW;
IF(A4X>=0,MA10,DRAWNULL),COLORYELLOW,LINETHICK1;};
{涨停标注}
STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;
{财务数据}
DRAWTEXT_FIX(ISLASTBAR ,0.06,0.01,1,DYBLOCK),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR ,0.065,0.01,0,HYBLOCK),COLORYELLOW;
{DRAWTEXT_FIX(ISLASTBAR,0.16,0.01,1,'上市日期:'),COLOR00FF00;
DRAWNUMBER_FIX(ISLASTBAR,0.16,0.01,0,FINANCE(42)),COLOR00FF00;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.04,1,'主营收入:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.062,0.04,0,FINANCE(20)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.21,0.04,1,'主营利润:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.22,0.04,0,FINANCE(21)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.07,1,'每股净资产:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.062,0.07,0,FINANCE(34)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.21,0.07,1,'每股公积金:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.22,0.07,0,FINANCE(18)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.1,1,'每股收益 年:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.062,0.1,0,FINANCE(33)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.21,0.1,1,'每股未分配利润:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.22,0.1,0,FINANCE(32)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.13,1,'经营现金流量:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.062,0.13,0,FINANCE(25)),COLORFFAAFF;
DRAWTEXT_FIX(ISLASTBAR,0.21,0.13,1,'其它利润:'),COLORFFAAFF;
DRAWNUMBER_FIX(ISLASTBAR,0.22,0.13,0,FINANCE(22)),COLORFFAAFF;};
{涨停秘籍}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
A1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
A2:=BARSLAST(REF(CROSS(DIFF,DEA),1));
VAR1:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
HONGJU:=IF(VAR1>0,VAR1,0);
GAOPAO:=CROSS(DIFF,DEA) AND HONGJU>=40;
DRAWICON(GAOPAO,HIGH*1.01,6);
DRAWTEXT(GAOPAO,HIGH*1.02,'顶背'),COLORGREEN;
LLVV:=LLV(LOW,5);
DIXI:=CROSS(DEA,DIFF) AND REF(DEA,A1+1)>0 AND DEA<0;
DRAWICON(DIXI,LOW*0.90,38);
DRAWTEXT(DIXI,LOW*0.90,'波段低吸'),COLORYELLOW;
工作线:=EMA(CLOSE,17),COLORYELLOW;
生命线:=MA(CLOSE,56),COLORRED;
M0:=MA(CLOSE,5);
M10:=MA(CLOSE,12);
M1:=MA(CLOSE,20);
M30:=MA(CLOSE,30);
M2:=MA(CLOSE,60);
M3:=MA(CLOSE,240);
M4:=MA(CLOSE,120);
M41:=MA(CLOSE,41);
TJ2:=MA(CLOSE,3)<M2;
VAR2:=(CLOSE*2+HIGH+LOW)/4;
SK:=EMA(VAR2,13)-EMA(VAR2,73);
SD:=EMA(SK,2);
短线:=CROSS(SK,SD) AND SK<0.05 AND (VOL/MA(VOL,5)>2 OR CLOSE/REF(CLOSE,1)>0.035 AND CLOSE>EMA(CLOSE,17));
{STICKLINE(短线,HIGH,LOW,0.5,0),COLORFFFF00;
STICKLINE(短线,OPEN,CLOSE,10,1),LINETHICK2,COLORFFFF00;}
CY:=BARSLAST(短线);
MACD双底:=REF(LOW,A2+1)<CLOSE AND CROSS(DIFF,DEA);
介入:=COUNT(短线,4)=1 AND COUNT(MACD双底,1)=1 AND CLOSE/MA(CLOSE,56)*1000>980 AND CLOSE>OPEN AND VOL>=MA(VOL,5) AND DIFF>=-0.1;
DRAWTEXT(介入,LOW*0.92,'起涨点'),COLORRED;
DRAWICON(介入,LOW*0.92,1);
反向顶背:=REF(CLOSE,A2+1)>CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
逃顶:=CROSS(SD,SK) AND SK>0.2 AND VOL/MA(VOL,5)<2;
逃顶成立:=COUNT(逃顶,4)=1 AND COUNT(反向顶背,1)=1;
DRAWICON(逃顶成立,HIGH*1.01,15);
DRAWTEXT(逃顶成立,HIGH*1.01,'逃顶'),COLORGREEN;
N1G:=CLOSE/REF(CLOSE,1)>=1.097 AND HIGH=CLOSE AND NOT(OPEN=HIGH);
A1G:=BARSLAST(N1G);
A2G:=LLV(LOW,A1G-1)>REF(LOW,A1G) AND CLOSE/REF(OPEN,A1G)>1 AND CLOSE/REF(OPEN,A1G)<=1.04;
XGGG:=FILTER(A2G,3) AND A1G>=4 AND A1G<=20;
DRAWICON(XGGG,LOW*0.96,41);
DRAWTEXT(XGGG,LOW*0.96,'涨停秘笈'),COLORYELLOW;
XPP1:=CROSS(DEA,DIFF) AND CLOSE>MA20 AND MA20>REF(MA20,1) AND DIFF>REF(DIFF,A2+1);
DRAWICON(XPP1,LOW*0.96,3);
DRAWTEXT(XPP1,LOW*0.96,'强势洗盘'),COLORWHITE;
XPP2:=XPP1 AND A1G>=4 AND A1G<=20;
DRAWICON(XPP2,LOW*0.98,17);
通达信量能平台+趋势线主图指标公式实例图解:
通达信量能平台+趋势线主图指标公式