通达信指标公式源码概况:指标类别: 通达信指标公式授权方式: 免费版指标评级: ★★★★★指标分类: 策略画线方法: 副图一、通达信k线副图指标公式 DRAWKLINE(REVERSE(L),REVERSE(O),REVERSE(H),REVERSE(C)); 五:MA(-CLOSE,5),COLORWHITE; 拾:MA(-CLOSE,10),COLORYELLOW; 贰拾:MA(-CLOSE,20),COLORMAGENTA; 陆拾:MA(-CLOSE,60)COLORLIGREEN,LINETHICK3; DRAWICON(-C -O,-H,0); DRAWICON(-C -O,-L,0); BC:=BARSCOUNT(C)+1; CB:=CURRBARSCOUNT; F1:=IF(N 1,MOD(BC,N)=1,1); F2:=MOD(BC,N)=0ORISLASTBAR; A1:=COUNT(F1,0); A2:=CONST(A1)-A1+1; B2:=CB-A2+IF(F2,1,0);B:=IF(B2=1,BARSLAST(F2),SUMBARS(F2,B2)-1); DATE1:REF(DATE,B),NODRAW,COLORFFFF00; TIME1:REF(TIME,B),NODRAW,COLORFFFF00; O1:REF(REF(O,BARSLAST(F1)),B),NODRAW,COLOR00FF00; H1:REF(HHV(H,BARSLAST(F1)+1),B),NODRAW,COLOR00FF00; L1:REF(LLV(L,BARSLAST(F1)+1),B),NODRAW,COLOR00FF00; C1:REF(C,B),NODRAW,COLOR00FF00; V1:REF(SUM(V,BARSLAST(F1)+1),B),NODRAW,COLOR00FF00; AMO1:REF(SUM(AMO,BARSLAST(F1)+1),B),NODRAW,COLOR00FF00; DRAWKLINE(H1,O1,L1,C1); V1:=REF(MA(C,20),10); 低:=L-V1; LW:=8; A1:=REF(低,LW)=LLV(低,2*LW+1); Y1:=BACKSET(A1,LW+1); C1:=FILTER(Y1,LW)AND低=LLV(低,LW+1); XH:REF(C1,1) 收:C-V1; S:收 =-1.5; 收进:CROSS(收,0); XA_1:=1170415; XA_2:=1; DRAWBAND(MA( 999999$CLOSE ,5)*XA_2,RGB(160,0,0),MA( 999999$CLOSE ,10),RGB( 0,168,0)); DRAWBAND(MA( 999999$CLOSE ,5)*XA_2,RGB(55,0,0),MA( 999999$CLOSE ,20),RGB(0 ,91,0)); DRAWKLINE( 999999$HIGH , 999999$OPEN , 999999$LOW , 999999$CLOSE 上证: 999999$CLOSE *XA_2,NODRAW,COLORWHITE; ±: 999999$CLOSE *XA_2-REF( 999999$CLOSE ,1),NODRAW,COLORLIGRAY; MA5:MA( 999999$CLOSE ,5)*XA_2,COLORYELLOW; MA10:MA( 999999$CLOSE ,10)*XA_2,COLORCC66FF; MA20:MA( 999999$CLOSE ,20)*XA_2,COLORFFCC66,LINETHICK2; MA60:MA( 999999$CLOSE ,60)*XA_2,COLOR00FF99,LINETHICK2; 来势线:EMA(CLOSE,7)-EMA(CLOSE,21),COLORYELLOW; 福星:EMA(来势线,7),COLORSTICK,COLORRED; VAR1:=CLOSE/REF(LLV(LOW,35),5) 决策:IF(VAR1,0.5,0),STICK,COLORBLUE; 必买:IF(TROUGHBARS(3,15,1)=0ANDHIGH LOW+0.01,1,-1),COLORYELLOW,LINETHICK1; 必卖:IF(PEAKBARS(3,15,1)=1,1,2),COLORWHITE,LINETHICK1; 趋势线:(EMA(WINNER(CLOSE),7)-EMA(WINNER(CLOSE),35))*5,COLORRED; 逃顶线:EMA(CLOSE/REF(HHV(CLOSE,7),50),1),COLOR007000,LINETHICK1; AA:0,COLORBROWN; DRAWICON(CROSS(趋势线,AA),AA,1); DRAWICON(CROSS(逃顶线,趋势线),逃顶线,2);二、通达信副图显示k线公式 CA:=C;OA:=REF(MIN(C,O),1);HA:=H;LA:=REF(L,1);CH:=REF(MAX(C,O),1); STICKLINE(CA OA,HA,LA,0.1,0),COLORFF00FF; STICKLINE(CA=OAANDCA REF(CA,1),HA,LA,0.1,1),COLOR0000FF; STICKLINE(CA=OA,HA,LA,0.1,1),COLORFF00FF,LINETHICK1; STICKLINE(CA CH,HA,LA,0.1,1),COLOR0000FF; STICKLINE(CA OA,CA,OA,3,0),COLORFF00FF; STICKLINE(CA=OAANDCA REF(CA,1),CA,OA,3,0),COLOR0000FF; STICKLINE(CA=OA,CA,OA,3,0),COLORFF00FF,LINETHICK1; STICKLINE(CA CH,CA,OA,3,0),COLOR0000FF; STICKLINE(CA OA,HA,LA,0.1,1),COLOR38FC3A,LINETHICK1; STICKLINE(CA OA,CA,OA,3,0),COLOR38FC3A,LINETHICK1; EXP50:EMA(CA,40),COLOR00FFFF; EXP12:EMA(CA,10),COLORFFFFFF;DRAWICON(CROSS(EXP12,EXP50),EXP12,1); DRAWICON(CROSS(EXP50,EXP12),EXP50,2); 开:OA,POINTDOT,COLORFF9966;高:HA,POINTDOT,COLORFF00FF; 低:LA,POINTDOT,COLOR00FF00;收:CA,POINTDOT,COLORFF00FF; 开1:OA,POINTDOT,COLOR000000;高1:HA,POINTDOT,COLOR000000;低 1:LA,POINTDOT,COLOR000000;收1:CA,POINTDOT,COLOR000000; N:=60; M:=3; VAR11:=MA(C,9),COLORRED; 上升通道:IF(VAR11 REF(VAR11,1),VAR11,DRAWNULL),LINETHICK4,COLORRED; 下降通道:IF(VAR11 DIFF:=(EMA(CLOSE,7)-EMA(CLOSE,19)); DEA:=EMA(DIFF,9); MACD:=0.90*(DIFF-DEA); TJ:=(DIFF =DEA); TJ1:=(DIFF STICKLINE(TJ,H,L,0.4,0),COLORYELLOW; STICKLINE(TJ,O,C,4,1),COLOR0088FF; STICKLINE(TJ,O,C,3.4,1),COLOR00AAFF; STICKLINE(TJ,O,C,2.8,1),COLOR00CCFF; STICKLINE(TJ,O,C,2,1),COLOR00DDFF; STICKLINE(TJ,O,C,1.2,1),COLOR55FFFF; STICKLINE(TJ,O,C,0.4,1),COLOR99FFFF; STICKLINE(TJ1ANDTJ,H,L,0.4,0),COLORF00FF0; STICKLINE(TJ1ANDTJ,O,C,4,1),COLORFF33FF; STICKLINE(TJ1ANDTJ,O,C,3.4,1),COLORFF55FF; STICKLINE(TJ1ANDTJ,O,C,2.8,1),COLORFF77FF; STICKLINE(TJ1ANDTJ,O,C,2,1),COLORFF99FF; STICKLINE(TJ1ANDTJ,O,C,1.2,1),COLORFFBBFF; STICKLINE(TJ1ANDTJ,O,C,0.4,1),COLORFFDDFF; STICKLINE(DIFF STICKLINE(DIFF STICKLINE(DIFF STICKLINE(DIFF STICKLINE(DIFF STICKLINE(DIFF STICKLINE(DIFF VAR1:=(CLOSE*2+HIGH+LOW)/4; SK:=EMA(VAR1,13)-EMA(VAR1,73); SD:=EMA(SK,2); SJ:=(CROSS(SK,SD)ANDSK=0.03)OR(CROSS(SK,SD) ANDSK =-0.14)OR(CROSS(SK,SD)ANDSK =0.05and(v 2ORC/REF(C,1) 0.035)); STICKLINE(SJ,H,L,0.5,0),COLORRED; STICKLINE(SJ,O,C,5.5,0),LINETHICK3,COLOR000055; STICKLINE(SJ,O,C,4.5,0),LINETHICK3,COLOR000077; STICKLINE(SJ,O,C,3.5,0),LINETHICK3,COLOR000099; STICKLINE(SJ,O,C,2.5,0),LINETHICK3,COLOR0000BB; STICKLINE(SJ,O,C,1.5,0),LINETHICK3,COLOR0000DD; STICKLINE(SJ,O,C,0.5,0),LINETHICK3,COLOR0000FF; EMA13:=EMA(C,13),COLORWHITE; EMA21:=EMA(C,21),COLORYELLOW; EMA34:=EMA(C,34),COLORFF00FF; EMA60:=MA(C,60),COLORFFCC66; VAR2:=(2*CLOSE+HIGH+LOW)/4; VAR3:=IF(YEAR =2099ANDMONTH 2,0,1); VAR4:=LLV(LOW,5);VAR5:=HHV(HIGH,4); 散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3; 庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3; LC:=REF(CLOSE,1); RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100; DRAWTEXT(CROSS(84,RSI),HIGH, ←-----逃 ),COLORGREEN; 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), ←---⼤胆搏 ),COLORYELLOW; VAR51:=3; VAR52:=(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)); DRAWTEXT(CROSS(VAR52,VAR51),LOW, ←启动 )COLORMAGENTA; DRAWKLINE(H,O,L,C); ZKP:=IF(C REF(C,1),REF(C,1),DRAWNULL); ZSP:=IF(C REF(C,1),C,DRAWNULL); DKP:=IF(C =REF(C,1),REF(C,1),DRAWNULL); DSP:=IF(C =REF(C,1),C,DRAWNULL); DRAWKLINE(H,DKP,L,DSP); STICKLINE(C =REF(C,1),DKP,DSP,3.05,0),COLORBLUE; STICKLINE(C =REF(C,1),DKP,DSP,2.2,0),COLORFF7700; STICKLINE(C =REF(C,1),DKP,DSP,1.5,0),COLORFF9900; STICKLINE(C =REF(C,1),DKP,DSP,0.5,0),COLORFFBB00; DRAWKLINE(H,ZKP,L,ZSP); STICKLINE(C REF(C,1),ZKP,ZSP,3.05,0),COLOR000099; STICKLINE(C REF(C,1),ZKP,ZSP,2.2,0),COLOR0000CC; STICKLINE(C REF(C,1),ZKP,ZSP,1.5,0),COLOR0000FF; STICKLINE(C REF(C,1),ZKP,ZSP,0.5,0),COLORCC66FF; STICKLINE(V/REF(V,1) 2ANDCLOSE =OPEN,ZKP,ZSP,1,0),COLORYELLOW;[源码注释]通达信公式动态公式解读SHORT赋值:5LONG赋值:34MID赋值:5输出龙头:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均,线宽为3,NODRAW输出龙尾:龙头的MID日指数移动平均,线宽为3,NODRAW输出海平面:(龙头-龙尾)*2,画蓝色画带状线如果龙头 龙尾,返回龙头,否则返回无效数,画黄色,线宽为1如果龙尾 龙头,返回龙尾,否则返回无效数,画黄色,线宽为1推荐阅读:通达信均线主图指标公式 M1=5M2=10M3=20M4=30M5=60M6=120 MA5MA(CLOSE,M1),LINETHICK1 MA10MA(CLOSE,M2),LINETHICK1 MA20MA(CLOSE,M3),LINETHICK1 MA30MA(C 股票 LOSE,M4),LINETHICK1 MA60MA(CLOSE,M5),LINETHICK1 股票公式网站} IF(MA5=REF(MA5,1)ANDMA5=MA10,MA5,DRAWNULL),COLORRED,LINETHICK1 IF(MA10=REF(MA10,1)ANDMA10=MA20,MA10,DRAWNULL),COLORRED,LINETHICK 1 IF(MA20=REF(MA20,1)ANDMA20=MA30,MA20,DRAWNULL),COLORRED,LINETHICK 1 IF(MA30=REF(MA30,1)ANDMA30=MA60,MA30,DRAWNULL),COLORRED,LINETHICK 1 DRAWICON(CROSS(MA10,MA5),H,2) DRAWICON(CROSS(MA20,MA10),H,2) DRAWICON(CROSS(MA30,MA20),H,2) DRAWTEXT(CROSS(MA5,MA10),MA5, ○ ),LINETHICK1,COLORYELLOW DRAWTEXT(CROSS(MA10,MA20),MA10, ◎ ),LINETHICK1,COLORYELLOW DRAWTEXT(CROSS(MA20,MA30),MA20, ● ),LINETHICK1,COLORYELLOW DRAWTEXT(CROSS(MA30,MA60),MA30, ☆ ),LINETHICK1,COLORYELLOW D:=5;S:=10;W:=20;F:=60;Q:=120; 攻击线:MA(CLOSE,D),COLORRED,LINETHICK1; 短线:MA(CLOSE,S),COLORMAGENTA,LINETHICK1; 万能线:MA(CLOSE,W),COLORWHITE,LINETHICK1; 分界线:MA(CLOSE,F),COLORYELLOW,LINETHICK1; 半年线:MA(CLOSE,Q),COLORBLUE,LINETHICK1; VAR1:=(CLOSE REF(CLOSE,1)ANDCLOSE REF(CLOSE,2)); VAR2:=(REF(VAR1,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR3:=(REF(VAR2,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR4:=(REF(VAR3,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR5:=(REF(VAR4,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR6:=(REF(VAR5,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR7:=(REF(VAR6,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR8:=(REF(VAR7,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR9:=(REF(VAR8,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VARA:=(REF(VAR9,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VARB:=(REF(VARA,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VARC:=(REF(VARB,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VARD:=(CLOSE REF(CLOSE,1)ANDCLOSE REF(CLOSE,2)); VARE:=(REF(VARD,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VARF:=(REF(VARE,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR10:=(REF(VARF,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR11:=(REF(VAR10,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR12:=(REF(VAR11,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR13:=(REF(VAR12,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR14:=(REF(VAR13,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR15:=(REF(VAR14,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR16:=(REF(VAR15,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR17:=(REF(VAR16,1)ANDCLOSE =ref(close,1)andclose =REF(CLOSE,2)); VAR18:=(REF(VAR17,1)ANDCLOSE =REF(CLOSE,1)ANDCLOSE =REF(CLOSE,2)); VAR19:=((REF(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13 ORVAR14ORVAR15ORVAR16ORVAR17ORVAR18,1))ANDVAR1); 黄色:STICKLINE(VAR19,O,O*1.003,3,0),COLOR33FFCC; HD:=FILTER(BACKSET(FILTER(REF(C,10)=HHV(C,2*10+1),10),10+1),10); LD:=FILTER(BACKSET(FILTER(REF(C,10)=LLV(C,2*10+1),10),10+1),10); 压 T; 支撑:IF(BARSLAST(HD) BARSLAST(LD)AND NOT(LD),REF(C,BARSLAST(LD)),REF(C,BARSLAST(LD))),COLOR80FF00,POINTDOT; 突破:=CROSS(C,压力)ANDVOL MA(VOL,25)ANDC/REF(C,1) 1.057; DRAWTEXT(突破,L*0.870, 突破 ),COLORMAGENTA; {P:0102;M1:050024;M2:050080;M3:0500160;} {BBI:(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,COLOR 00FF00;{多空线}} MID中轨:=MA(CLOSE,M1); MA80:MA(CLOSE,M2); MA160:MA(CLOSE,M3); VART1:=POW((C-MID中轨),2); VART2:=MA(VART1,M1); VART3:=SQRT(VART2); UPPER:=MID中轨+P*VART3; LOWER:=MID中轨-P*VART3; BOLL:=REF(MID中轨,1); UPPEB上轨:REF(UPPER,1),COLOR333333,LINETHICK2; LOWEB下轨:REF(LOWER,1),COLOR333333,LINETHICK2; {变色中轨} AA:=MID中轨; BB:AA REF(AA,1),LINETHICK0; MID中轨,COLORFFFFFF,DOTLINE; IF(BB,MID中轨,DRAWNULL),COLORRED,DOTLINE; STICKLINE(CLOSE =OPENANDCLOSE =MID中 轨,OPEN,CLOSE,2,0),COLOR000077; STICKLINE(CLOSE =OPENANDCLOSE =MID中轨,H,L,0,0),COLOR000077; STICKLINE(OPEN CLOSEANDCLOSE =MID中 轨,OPEN,CLOSE,2,0),COLOR777700; STICKLINE(OPEN CLOSEANDCLOSE =MID中轨,H,L,0,0),COLOR777700; STICKLINE(CROSS(CLOSE,MID中轨),CLOSE,OPEN,0.5,0),COLOR0080FF; DRAWICON(突破,L*0.97,1);