以下是通达信六组趋势线主图指标公式源码和使用说明

通达信六组趋势线主图指标公式源码:

   n1=5;/*0~100*/

   n2=8;/*0~100*/

   n3=13;/*0~100*/

   n4=21;/*0~100*/

   m=21;/*0~100*/

   n5=13;/*0~100*/

   IF(CLOSE>OPEN)

   MA$1:MA(CLOSE,N1);

   MA$2:MA(CLOSE,N2);

   MA$3:MA(CLOSE,N3);

   MA$4:MA(CLOSE,N4);

   SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,n5)/HHV(C,n5))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,N5)/HHV(C,N5))*100);

   glba1:=MA$1>REF(MA$1,1);

   glba2:=MA$2>REF(MA$2,1);

   glba3:=MA$1>REF(MA$3,1);

   glba4:=MA$1>REF(MA$4,1);

   dtpl:=CLOSE>=MA$1ANDMA$2>=MA$1ANDMA$3>=MA$4;

   dtpl0=COUNT(dtpl,20);

   gzd:=glba1ANDglba2ANDglba3ANDglba4;

   MA0:=(MA$1+MA$2+MA$3+MA$4)/4;

   MA1:=MA(MA0,8);

   gzdnum:=LONGCROSS(MA0,MA1,1);

   satcount:=LONGCROSS(sat,100,21);

   glbbif$5:=LONGCROSS(CLOSE,MA$4,m);

   Vglbh:=VOL/CAPITAL*100;

   Lbglb:=VOL/MA(VOL,5);

   TIPTEXT(glbbif$5,LOW,’葛兰碧第一买点’),colorblue;

   PARTLINE(MA(CLOSE,20),CLOSE>=MA$4,colorred,CLOSE<MA$1,colorgreen),Linethick2;

   TIPTEXT(gzdnumANDgzdANDC>MA$4,LOW,’多周期向上共振—积极介入点’),colorred;

   TIPTEXT(satcountANDVglbh>2.0ANDLbglb>1.0,LOW-1.0,’量能饱和点,即将起飞’),coloryellow;

   周期:=5;

   QA短:=REF(H,周期)=HHV(H,2*周期+1);

   QB短:=BacKSET(QA短,周期+1);

   QC短:=FILTER(QB短,周期)ANDH=HHV(H,周期+1);

   QD短:=BArslAST(QC短);

   QE短:=IF(QC短,CURRBARSCOUNT,0);

   QF短:=IF(QD短,REF(QE短,QD短),QE短);

   QG短:=CONST(QF短),NODRAW;

   QH短:=REF(QF短,QD短+1);

   QW短:=CONST(QH短),NODRAW;

   NOTEXT短长压:DRAWLINE(CURRBARSCOUNT=QW短,H,CURRBARSCOUNT=QG短,H,1),COLORGREEN;

   NOTEXT短长远高:DRAWLINE(CURRBARSCOUNT=QW短,H,ISLASTBAR,REF(H,QW短-1),1),COLORGREEN,DOTLINE;

   NOTEXT短长近高:DRAWLINE(CURRBARSCOUNT=QG短,H,ISLASTBAR,REF(H,QG短-1),1),COLORGREEN,DOTLINE;

   TPD短长期:=DRAWLINE(CURRBARSCOUNT=QW短,H,CURRBARSCOUNT=QG短,H,1);

   DRAWICON(REF(C,1)<TPD短长期ANDC>TPD短长期ANDREF(TPD短长期,1)>TPD短长期,L*0.98,1);

   QA中:=REF(H,周期*2)=HHV(H,2*周期*2+1);

   QB中:=BACKSET(QA中,周期*2+1);

   QC中:=FILTER(QB中,周期*2)ANDH=HHV(H,周期*2+1);

   QD中:=BARSLAST(QC中);

   QE中:=IF(QC中,CURRBARSCOUNT,0);

   QF中:=IF(QD中,REF(QE中,QD中),QE中);

   QG中:=CONST(QF中);

   QH中:=REF(QF中,QD中+1);

   QW中:=CONST(QH中);

   DRAWLINE(CURRBARSCOUNT=QW中,H,CURRBARSCOUNT=QG中,H,1),COLORGREEN;

   DRAWLINE(CURRBARSCOUNT=QW中,H,ISLASTBAR,REF(H,QW中-1),1),COLORGREEN,DOTLINE;

   DRAWLINE(CURRBARSCOUNT=QG中,H,ISLASTBAR,REF(H,QG中-1),1),COLORGREEN,DOTLINE;

   TPD中长期:=DRAWLINE(CURRBARSCOUNT=QW中,H,CURRBARSCOUNT=QG中,H,1);

   DRAWICON(REF(C,1)<TPD中长期ANDC>TPD中长期ANDREF(TPD中长期,1)>TPD中长期,L*0.98,1);

   QA长:=REF(H,3*周期)=HHV(H,2*3*周期+1);

   QB长:=BACKSET(QA长,3*周期+1);

   QC长:=FILTER(QB长,3*周期)ANDH=HHV(H,3*周期+1);

   QD长:=BARSLAST(QC长);

   QE长:=IF(QC长,CURRBARSCOUNT,0);

   QF长:=IF(QD长,REF(QE长,QD长),QE长);

   QG长:=CONST(QF长),NODRAW;

   QH长:=REF(QF长,QD长+1);

   QW长:=CONST(QH长),NODRAW;

   NOTEXT长长压:DRAWLINE(CURRBARSCOUNT=QW长,H,CURRBARSCOUNT=QG长,H,1),COLORGREEN;

   NOTEXT长长远高:DRAWLINE(CURRBARSCOUNT=QW长,H,ISLASTBAR,REF(H,QW长-1),1),COLORGREEN,DOTLINE;

   NOTEXT长长近高:DRAWLINE(CURRBARSCOUNT=QG长,H,ISLASTBAR,REF(H,QG长-1),1),COLORGREEN,DOTLINE;

   TPD长长期:=DRAWLINE(CURRBARSCOUNT=QW长,H,CURRBARSCOUNT=QG长,H,1);

   DRAWICON(REF(C,1)<TPD长长期ANDC>TPD长长期ANDREF(TPD长长期,1)>TPD长长期,L*0.98,1);

   QA久:=REF(H,4*周期)=HHV(H,2*4*周期+1);

   QB久:=BACKSET(QA久,4*周期+1);

   QC久:=FILTER(QB久,4*周期)ANDH=HHV(H,4*周期+1);

   QD久:=BARSLAST(QC久);

   QE久:=IF(QC久,CURRBARSCOUNT,0);

   QF久:=IF(QD久,REF(QE久,QD久),QE久);

   QG久:=CONST(QF久),NODRAW;

   QH久:=REF(QF久,QD久+1);

   QW久:=CONST(QH久),NODRAW;

   NOTEXT久压:DRAWLINE(CURRBARSCOUNT=QW久,H,CURRBARSCOUNT=QG久,H,1),COLORGREEN;

   NOTEXT久远高:DRAWLINE(CURRBARSCOUNT=QW久,H,ISLASTBAR,REF(H,QW久-1),1),COLORGREEN,DOTLINE;

   NOTEXT久近高:DRAWLINE(CURRBARSCOUNT=QG久,H,ISLASTBAR,REF(H,QG久-1),1),COLORGREEN,DOTLINE;

   TPD久期:=DRAWLINE(CURRBARSCOUNT=QW久,H,CURRBARSCOUNT=QG久,H,1);

   DRAWICON(REF(C,1)<TPD久期ANDC>TPD久期ANDREF(TPD久期,1)>TPD久期,L*0.98,1);

   QAA短:=REF(L,周期)=LLV(L,2*周期+1);

   QBB短:=BACKSET(QAA短,周期+1);

   QCC短:=FILTER(QBB短,周期)ANDL=LLV(L,周期+1);

   QDD短:=BARSLAST(QCC短);

   QEE短:=IF(QCC短,CURRBARSCOUNT,0);

   QFF短:=IF(QDD短,REF(L,QDD短),L);

   QGG短:=IF(QDD短,REF(QEE短,QDD短),QEE短);

   QHH短:=CONST(QGG短);

   QWW短:=REF(QFF短,QDD短+1);

   QMM短:=REF(QGG短,QDD短+1);

   QRR短:=CONST(QMM短);

   NOTEXT短长支:DRAWLINE(CURRBARSCOUNT=QRR短,L,CURRBARSCOUNT=QHH短,L,1),COLORYELLOW;

   NOTEXT短长近低:DRAWLINE(CURRBARSCOUNT=QHH短,L,ISLASTBAR,REF(L,QHH短-1),1),COLORYELLOW,DOTLINE;

   NOTEXT短长远低:DRAWLINE(CURRBARSCOUNT=QRR短,L,ISLASTBAR,REF(L,QRR短-1),1),COLORYELLOW,DOTLINE;

   QAA中:=REF(L,周期*2)=LLV(L,2*周期*2+1);

   QBB中:=BACKSET(QAA中,周期*2+1);

   QCC中:=FILTER(QBB中,周期*2)ANDL=LLV(L,周期*2+1);

   QDD中:=BARSLAST(QCC中);

   QEE中:=IF(QCC中,CURRBARSCOUNT,0);

   QFF中:=IF(QDD中,REF(L,QDD中),L);

   QGG中:=IF(QDD中,REF(QEE中,QDD中),QEE中);

   QHH中:=CONST(QGG中);

   QWW中:=REF(QFF中,QDD中+1);

   QMM中:=REF(QGG中,QDD中+1);

   QRR中:=CONST(QMM中);

   NOTEXT中长支:DRAWLINE(CURRBARSCOUNT=QRR中,L,CURRBARSCOUNT=QHH中,L,1),COLORYELLOW;

   NOTEXT中长近低:DRAWLINE(CURRBARSCOUNT=QHH中,L,ISLASTBAR,REF(L,QHH中-1),1),COLORYELLOW,DOTLINE;

   NOTEXT中长远低:DRAWLINE(CURRBARSCOUNT=QRR中,L,ISLASTBAR,REF(L,QRR中-1),1),COLORYELLOW,DOTLINE;

   QAA长:=REF(L,周期*3)=LLV(L,2*周期*3+1);

   QBB长:=BACKSET(QAA长,周期*3+1);

   QCC长:=FILTER(QBB长,周期*3)ANDL=LLV(L,周期*3+1);

   QDD长:=BARSLAST(QCC长);

   QEE长:=IF(QCC长,CURRBARSCOUNT,0);

   QFF长:=IF(QDD长,REF(L,QDD长),L);

   QGG长:=IF(QDD长,REF(QEE长,QDD长),QEE长);

   QHH长:=CONST(QGG长);

   QWW长:=REF(QFF长,QDD长+1);

   QMM长:=REF(QGG长,QDD长+1);

   QRR长:=CONST(QMM长);

   NOTEXT长长支:DRAWLINE(CURRBARSCOUNT=QRR长,L,CURRBARSCOUNT=QHH长,L,1),COLORYELLOW;

   NOTEXT长长近低:DRAWLINE(CURRBARSCOUNT=QHH长,L,ISLASTBAR,REF(L,QHH长-1),1),COLORYELLOW,DOTLINE;

   NOTEXT长长远低:DRAWLINE(CURRBARSCOUNT=QRR长,L,ISLASTBAR,REF(L,QRR长-1),1),COLORYELLOW,DOTLINE;

   {2画k线}

   STICKLINE(C=O,C,O,2,1),COLORWHITE;

   STICKLINE(C=O,H,L,0,0),COLORWHITE;

   STICKLINE(C>O,C,O,2,1),COLORLIRED;

   STICKLINE(C>O,H,MAX(O,C),0,0),COLORLIRED;

   STICKLINE(C>O,L,MIN(O,C),0,0),COLORLIRED;

   STICKLINE(C<O,C,O,2,1),COLORLIBLUE;

   STICKLINE(C<O,H,MAX(O,C),0,0),COLORLIBLUE;

   STICKLINE(C<O,L,MIN(O,C),0,0),COLORLIBLUE;

   EMA13:=EMA(C,13),NODRAW;

   ZR:=TFILTER(C<=EMA13ANDREF(C,1)>EMA13,C>EMA13,1);

   ZQ:=TFILTER(C>EMA13ANDREF(C,1)<=EMA13,C<=EMA13,1);

   转强周期:=BARSLAST(ZQ),NODRAW;

   转弱周期:=BARSLAST(ZR),NODRAW;

   STICKLINE(ZR,H,L,0,0),COLORFFF370;

   STICKLINE(ZR,O,C,2,0),COLORFFF370;

   STICKLINE(ZQ,H,L,0,0),COLORMAGENTA;

   STICKLINE(ZQ,O,C,2,0),COLORMAGENTA;

   ZT1:=C/REF(C,1)>1.097;

   BH1:=BARSLAST(ZT1);

   STICKLINE(ZT1,REF(O,BH1),REF(C,BH1),2,0),COLORYELLOW;

   STICKLINE(ZT1,REF(H,BH1),REF(L,BH1),0,0),COLORYELLOW;

   生命线:MA(CLOSE,22),LINETHICK2,colorred;

   A:=(3*C+L+O+H)/6;

   X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+REF(A,20))/210;

   S2:=SMA(C,3,1);

   S6:=SMA(C,5,1);

   DK:=2*(S2-S6);

   主力成本:EMA(X,13),COLORFF00FF,LINETHICK0;

   短期底部:LLV(HIGH,30),LINETHICK2,COLORFFCC00;

   IF(MA(C,3),MA(C,3),DRAWNULL),coloryellow,LINETHICK2;

   IF(MA(C,9),MA(C,9),DRAWNULL),colormagenta,LINETHICK2;

   IF(MA(C,23.5),MA(C,23.5),DRAWNULL),colorwhite;

   DRAWKLINE(HIGH,OPEN,LOW,CLOSE);

   MA5:=MA(C,5);MA10:=MA(C,10);MA30:=MA(C,30);

   FA:=BARSLAST(CROSS(MA10,MA5))ANDCROSS(MA5,MA10);

   FB:=FAANDMA5>MA30ANDMA10>MA30ANDMA10>REF(MA10,1);

   DRAWTEXT(FB,L-0.58,’持股’),colorred;V1:=EMA(CLOSE,5);

   V2:=EMA(EMA(CLOSE,90)*1.01,10);

   DRAWTEXT(CROSS(V1,V2),V1+0.05,’待涨’),colorgreen;VAR1:=LLV(LOW,21);

   VAR2:=HHV(HIGH,21);

   AK1:=EMA((((CLOSE-VAR1)/(VAR2-VAR1))*100),5);

   AK:=EMA((((CLOSE-VAR1)/(VAR2-VAR1))*50),13);

   AB:=CROSS(AK1,AK);

   DRAWTEXT((AB=1),(LOW*0.99),’低吸’),colormagenta;

   AA1:=AMOUNT/V;BB1:=L

   CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;

   DD1:=L

   EE1:=V

   慢建仓:=BB1ANDCC1ANDDD1ANDEE1,LINETHICK0,COLOR0099FF;

   DRAWTEXT(慢建仓,L*0.99,’慢建仓’),COLOR0099FF;

   VAR3AA:=IF((CLOSE>REF(CLOSE,1)),88,0);VAR4AA:=IF(((CLOSE)/(REF(CLOSE,1))>1.05)AND((HIGH)/(CLOSE)<1.01)AND(VAR3AA>0),91,0);

   DRAWTEXT(FILTER((VAR4AA>90),45),(LOW)*(0.93),’黑牛’),COLOR00FFFF;

   DRAWTEXT(FILTER((VAR4AA>90),35),(LOW)*(0.99000001),’莫观望’),COLOR00FFFF;

   A1AA:=9;A2AA:=(REF(CLOSE,A1AA+1)

   DRAWTEXT(FILTER((A2AA>-0.5),84),(HIGH)*(1.05),’手勿痒’),COLORFFFFFF;

   VAR6:=REF(C,1);

   VAR7:=SMA(MAX(C-VAR6,0),6,1)/SMA(ABS(C-VAR6),6,1)*100;

   DRAWTEXT(CROSS(82,VAR7),H*1.01,’高抛’),colorblue;

通达信六组趋势线主图指标公式截图

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。