通达信指标公式源码概况:指标类别: 通达信指标公式授权方式: 免费版指标评级: ★★★★★指标分类: 策略画线方法: 副图一、通达信黑牛均线指标公式 买线:=EMA(C,2); 卖线:=EMA(SLOPE(C,21)*20+C,42); BU:=CROSS(买线,卖线); SEL:=CROSS(卖线,买线); DRAWICON(BU,L-0.1,1); DRAWICON(SEL,H+0.1,2); STICKLINE(买线 =卖线,LOW,HIGH,0.0,1),COLORRED; STICKLINE(买线 =卖线,CLOSE,OPEN,2,1),COLORRED; STICKLINE(买线 卖线,LOW,HIGH,0.0,1),COLORGREEN; STICKLINE(买线 卖线,CLOSE,OPEN,2,1),COLORGREEN; 散户:EMA(CLOSE,5),COLORWHITE; 操盘:MA(CLOSE,9),COLORCYAN,LINETHICK2; 界点:MA(CLOSE,20),COLORMAGENTA; LC:=REF(CLOSE,1); RSI:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100); FF:=EMA(CLOSE,3); MA15:=EMA(CLOSE,21); 日:=150;昨前:=3; 高1:=REF(HHV(H,日),昨前); 低1:=REF(LLV(L,日),昨前); H1:=高1-(高1-低1)*0.191; H2:=高1-(高1-低1)*0.382; H3:=高1-(高1-低1)*0.5; H4:=高1-(高1-低1)*0.618; H5:=高1-(高1-低1)*0.809; 顶:REFDATE(高1,DATE),COLORRED; 一0.809:REFDATE(H1,DATE),COLORYELLOW; 二0.618:REFDATE(H2,DATE),COLORMAGENTA; 三0.500:REFDATE(H3,DATE),COLORWHITE; 四0.382:REFDATE(H4,DATE),COLORGREEN; 五0.191:REFDATE(H5,DATE),COLORYELLOW; 低:REFDATE(低1,DATE),COLORRED; AA:=WINNER(C+C*15/100)*100; BB:=WINNER(C+C*0/100)*100; CC:=AA-BB; DD:=(WINNER(C-C*0.1/100)-WINNER(C-C*15/100))*100; EE:=CC 3ANDDD 0.5ANDO { } A1:=DYNAINFO(6); A2:=IF(L A1,0,IF(H A1,1,(A1-L+0.01)/(H-L+0.01))); A3:=V/WINNER(L); A4:=REF(HHV(C,120),1); A5:=REF(LLV(C,120),1); A6:=100*(C-A5)/(A4-A5); A7:=A2 0ORA2=1; A8:=A7ANDA3/REF(A3,3) =3ANDA6 A9:=REF(A8,1)ORREF(A8,2)ORREF(A8,3)ORREF(A8,4); A10:=A8ANDA9; A11:=IF(FILTER(A8,3),30,0); A12:=IF(FILTER(A10,3)OREE,20,0); 私募机构进场日:STICKLINE(A11,0,30,5,0),COLORFF8000; 私募机构加仓日:STICKLINE(A12,0,20,5,0),COLORRED; STICKLINE(A11,0,5,5,0),COLORFF7700; STICKLINE(A11,0,5,4.5,0),COLORFF8800; STICKLINE(A11,0,5,4,0),COLORFF9900; STICKLINE(A11,0,5,3.5,0),COLORFFAA00; STICKLINE(A11,0,5,3,0),COLORFFBB00; STICKLINE(A11,0,5,2.5,0),COLORFFCC00; STICKLINE(A11,0,5,2,0),COLORFFDD00; STICKLINE(A11,0,5,1,0),COLORFFEE00; STICKLINE(A12,0,15,4.5,0),COLOR102099; STICKLINE(A12,0,15,4,0),COLOR1020AA; STICKLINE(A12,0,15,3.5,0),COLOR1020BB; STICKLINE(A12,0,15,3,0),COLOR1020CC; STICKLINE(A12,0,15,2.5,0),COLOR1020DD; STICKLINE(A12,0,15,2,0),COLOR1020EE; STICKLINE(A12,0,15,1,0),COLOR1020FF; DRAWTEXT(A11,LOW, 进场 ),COLORYELLOW; DRAWTEXT(A12,LOW, 加仓 ),COLORWHITE; HH:=1; II:=(((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9)))*100); JJ:=IF(((((AMOUNT/CLOSE)/(HHV(AMOUNT,9)/HHV(CLOSE,9)))*100) 100),100,(((AMOUNT/CLOSE)/(HHV(AMOUNT,9)/HHV(CLOSE,9)))*100)); KK:=(II/JJ); 价异动排序:=IF(HH,(KK/REF(KK,1)),0),STICK,COLOR0000FF; LL:=(JJ/II); 量异动排序:=IF(HH,(LL/REF(LL,1)),0),STICK,COLORFFFF00; AAA:=((XMA(CLOSE,5)-REF(XMA(CLOSE,5),1))/REF(XMA(CLOSE,5),1)); BBB:=((XMA(INDEXC,5)-REF(XMA(INDEXC,5),1))/REF(XMA(INDEXC,5),1)); CCC:=REF(HHV(CLOSE,120),1); DDD:=REF(LLV(CLOSE,120),1); WW:=((100*(CLOSE-DDD))/(CCC-DDD)); 今日资金:=(AMOUNT/100000000); 五日资金:=(EMA(今日资金,5)/REF(EMA(今日资金,5),5)); 庄股:=((((((五日资金 =2)AND(AAA BBB))AND(WW 35))ANDHH)AND(BARSCOUNT(CLOSE) 30))OR(((((五日资金 =2)AND(AAA BBB))AND(WW 100))ANDHH)AND(BARSCOUNT(CLOSE) 50))); 庄家显形:=IF(庄股,88,0),LINETHICK1,COLORGREEN; A01:=DYNAINFO(7); A02:=MA(AMOUNT/VOL/100.000,VOL/CAPITAL); A03:=BARSCOUNT(CLOSE); A04:=SMA(CLOSE/HHV(HIGH,120.000),3.000,1.000)*100.000; A05:=IF((A03 20.000),A04,0); A06:=IF(((LOW A01)),0,IF(((HIGH A01)),1.000,((A01-LOW)+0.009)/((HIGH-LOW)+0.009))); A07:=DMA(A06,VOL/CAPITAL)*100.000; A08:=IF((A02 A01),(100.000-A07),A07); A09:IF(((((A07 0)AND(A07 REF(A07,1.000))))AND(A05 =88.000)),A07,0),COLORLIGREEN,LINETHICK1; STICKLINE(A09 0,0,A09,0,0),COLORFF00FF; 大户1:=EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),COLORFF00FF,LINETHICK2; 大户:=MA(大户1,2),COLORFF00FF,LINETHICK2; 散户1:=(WINNER(C*1.1)-WINNER(C*0.9))*100; 散户:=MA(散户1,12),COLORWHITE,LINETHICK1; VAR1:=1; VAR5:=LLV(LOW,75); VAR6:=HHV(HIGH,75); VAR7:=(VAR6-VAR5)/100; VAR8:=SMA((CLOSE-VAR5)/VAR7,20,1); VARA:=3*VAR8-2*SMA(VAR8,15,1); 主力1:=(100-VARA)*VAR1; 主力:=MA(主力1,2),COLORRED,LINETHICK2; 游资1:=MA(WINNER(CLOSE*0.95)*100,3)*VAR1*1.1; 游资:=MA(游资1,2),COLORGREEN,LINETHICK1; 主升浪:IF((CROSS(大户,主力)AND(MA(C,20)-LLV(MA(C,20),30))/LLV(MA(C,20),30)*100 10 AND主力 50AND(主力-REF(主力,50)) 20AND(C-MA(C,20))/MA(C,20)*100 12AND 散户 70)OR(CROSS(大户,主力)AND(MA(C,20)-LLV(MA(C,20),30))/LLV(MA(C,20),30)*100 10 AND主力 70AND(主力-REF(主力,50)) 30AND(C-MA(C,20))/MA(C,20)*100 20AND 散户 70)OR(CROSS(游资,主力)AND大户 80AND散户 80AND (REF(主力,100)-主力)/主力*100 80),80,0),COLORRED,LINETHICK2; DRAWTEXT(主升浪=80,30, 主升浪 ),COLORRED; 大黑马飚升:IF((CROSS(游资,散户)ANDREF(主力,5) 75AND((游资-REF(游资,3))/3 8 OR(大户-REF(大户,3))/3 7)AND(HHV(HIGH,100)-C)/C*100 40),80,0),COLORFF00FF,LINETHICK2; DRAWTEXT(大黑马飚升=80,60, 大黑马飚升 ),COLORYELLOW; 黑马飚升:IF(((CROSS(大户,散户)ANDREF(主力,5) 75AND((游资-REF(游资,3))/3 6 OR(大户-REF(大户,3))/3 6)AND(HHV(HIGH,50)-C)/C*100 40)OR(CROSS(游资,散户) ANDREF(主力,5) 50AND((游资-REF(游资,3))/3 6OR (大户-REF(大户,3))/3 6)AND(HHV(HIGH,50)-C)/C*100 40)),80,0),,COLORFF00FF,LINETHICK2; DRAWTEXT(黑马飚升=80,30, 黑马飚升 ),COLORYELLOW; 长线大黑马:IF((CROSS(游资,大户)AND游资 90ANDC REF(C,20)AND主力 30),80,0), COLORRED,LINETHICK2; DRAWTEXT(长线大黑马=80,60, 长线大黑马 ),COLORRED; M1:=5;M2:=10;M3:=20;M4:=60; MA1:MA(CLOSE,M1); MA2:MA(CLOSE,M2); MA3:MA(CLOSE,M3); MA4:MA(CLOSE,M4); DRAWICON((ZIG(3,5) REF(ZIG(3,5),1))AND(REF(ZIG(3,5),1) =REF(ZIG(3,5),2))AND(REF(ZIG(3,5),2) =REF(ZIG(3,5),3)),LOW*0.98,1); DRAWICON((ZIG(3,5) REF(ZIG(3,5),1))AND(REF(ZIG(3,5),1) =REF(ZIG(3,5),2))AND(REF(ZIG(3,5),2) =REF(ZIG(3,5),3)),HIGH*1.01,2); VAR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100; VAR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100; VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100; VAR6:=(VAR3+VAR4+VAR5)/3; VAR7:=EMA(VAR6,5); ZB:=EMA(EMA(VAR3,5),5)*3,COLORSTICK; VAR8:=IF(VAR6 =-20,10,0); VAR9:=HHV(VAR8,10); VARA:=IF(VAR9ANDCROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0); K:=EMA(VAR7,5)*2,,COLORFF00FF; D:=EMA(K,5),,COLORWHITE; J:=K*3-D*2,,COLORYELLOW; VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5))ANDJ HS:=VOL/CAPITAL*100,,COLORGREEN; DRAWTEXT(VAR8=10ANDFILTER(VAR8=10,5),LOW*0.93, 接近底部 )COLORMAGENTA; DRAWTEXT(VARA=20,LOW*0.95, 底部 )COLORYELLOW; VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20; VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1); VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1); VAR11:=VARF REF(VAR10,1)ANDVOL REF(VOL,1)ANDCLOSE REF(CLOSE,1); DRAWTEXT(VAR11ANDCOUNT(VAR11,30)=1,LOW*0.95, 大资金活动 ),LINETHICK1,COLORFF00FF; VAR12:=(HIGH+LOW+CLOSE)/3; VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14)); VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70)); VAR15:=IF(VAR13 =150ANDVAR13 200ANDVAR14 =150ANDVAR14 200,10,0); VAR16:=IF(VAR13 =-150ANDVAR13 -200ANDVAR14 =-150ANDVAR14 -200,-10,VAR15); VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100; VAR18:=100-ABS(VAR17); VAR19:=IF(VAR18 90,VAR18,100); VAR1A:=IF(VARE 0,VARE,0); VAR1B:=IF(VAR14 =200ANDVAR13 =150,15,IF(VAR14 =-200ANDVAR13 =-150,-15,VAR16))+60; VAR1C:=VAR1A 48ANDVAR1B 60ANDVAR19 DRAWTEXT(VAR1CANDCOUNT(VAR1C,30)=1,LOW*0.95, 大笔成交 )COLORWHITE;二、通达信黑牛均线 M1:=5;M2:=10;M3:=20;M4:=30;M5:=60;M6:=120; MA5:MA(CLOSE,M1),LINETHICK1; MA10:MA(CLOSE,M2),LINETHICK1; MA20:MA(CLOSE,M3),LINETHICK1; MA30:MA(CLOSE,M4),LINETHICK1; MA60:MA(CLOSE,M5),LINETHICK1; IF(MA5 =REF(MA5,1)ANDMA5 =MA10,MA5,DRAWNULL),COLORRED,LINETHICK1; IF(MA10 =REF(MA10,1)ANDMA10 =MA20,MA10,DRAWNULL),COLORRED,LINETHICK1; IF(MA20 =REF(MA20,1)ANDMA20 =MA30,MA20,DRAWNULL),COLORRED,LINETHICK1; IF(MA30 =REF(MA30,1)ANDMA30 =MA60,MA30,DRAWNULL),COLORRED,LINETHICK1; 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; V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20); V2:=(1-7/100)*(DMA(CLOSE,V1)); V3:=(1+7/100)*(DMA(CLOSE,V1)); V5:=MA((LOW+HIGH+CLOSE)/3,5); 支撑:REFDATE(V2,DATE),POINTDOT,LINETHICK3,COLORCC66FF; 阻力:REFDATE(V3,DATE),POINTDOT,LINETHICK3,COLORGREEN; 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(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17ORVAR18,1)ANDVAR1; STICKLINE(VAR19,L,L*0.98,3,0),COLORYELLOW; VAR1A:=REF(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBORVARC,1)ANDVARD; STICKLINE(VAR1A,H*1.01,H,3,0),COLOR00FF00{98FD}; MA3:MA(C,3); MA5:MA(C,5),COLORWHITE; MA10:=MA(C,10),NODRAW; MA30:MA(C,34),NODRAW; 五日乖离率:=(C-MA5)/MA5*100; BB5:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416; IF(BB5 30ANDMA5 REF(MA5,1),MA5,DRAWNULL),LINETHICK1,COLORRED; BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416; IF(BB5 0ANDMA5 REF(MA5,1),MA5,DRAWNULL),LINETHICK1,COLORGREEN; DD5:=MA5 REF(MA5,1); IF(DD5,MA5,DRAWNULL),COLOR00FF00; X:=(3*C+L+O+H)/6; 多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6) +13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12) +7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+ REF(X,20))/210,COLORFF00FF,LINETHICK1; {用法:黄托底买进,绿压顶买出。} DD:=多空线 REF(多空线,1); IF(DD,多空线,DRAWNULL),COLORBLUE,LINETHICK2; A:=(MA5 多空线); IF(A,多空线,DRAWNULL),COLORYELLOW,POINTDOT; A1:=(MA5 多空线); IF(A1,多空线,DRAWNULL),COLORWHITE; A2:=3*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)-2*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5); A4:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34))*100; A5:=EMA(CLOSE,12)-EMA(CLOSE,26); A6:=EMA(A5,9); A7:=(A5 -0.1ANDA5 财神:IF(A7,LLV(L,21),DRAWNULL)COLORRED,CIRCLEDOT; CYS:=(EMA((CLOSE-V2)/V2,1)*100); AA:=CYS; MIDD:=MA(CYS,20); CC:=MIDD+0.85*STD(CYS,10); TM6:=AA IF(TM6,MA5,DRAWNULL),COLORRED,LINETHICK1; A0:=(L+H+C*2)/4; 工作:=EMA(A0,14)COLORYELLOW,LINETHICK1; 度假:=EMA(A0,25)COLORYELLOW,LINETHICK1; A1X:=(工作-REF(工作,1))/REF(工作,1)*100; A2X:=(度假-REF(度假,1))/REF(度假,1)*100; G:=BARSLAST(CROSS(A1X,0)); {KDJ} 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; 金叉:=CROSS(J,D); 死叉:=CROSS(D,J); 买1:=(VAR14ORVAR15)ANDVAR11; 买2:=(VAR14ORVAR15)ANDVAR4; 买3:=(VAR14ORVAR15)ANDVAR2; 买4:=(VAR2ANDVAR11)OR(VAR4ANDVAR11); 买5:=(金叉ANDVAR4)OR(金叉ANDVAR2)OR(金叉ANDVAR11); {涨停} STICKLINE(CLOSE REF(CLOSE,1)*1.0985ANDCLOSE=HIGH,CLOSE,OPEN,4,-1),COLOR00FFFF; {跌停} STICKLINE(CLOSE REF(CLOSE,1)*0.9015ANDCLOSE=LOW,CLOSE,OPEN,4,-1),COLORGREEN; {蓝} STICKLINE(OPEN =CLOSE,CLOSE,OPEN,3,0),COLORFF7700; STICKLINE(OPEN =CLOSE,CLOSE,OPEN,2.2,0),COLORFF9900; STICKLINE(OPEN =CLOSE,CLOSE,OPEN,1.5,0),COLORFFBB00; STICKLINE(OPEN =CLOSE,CLOSE,OPEN,0.5,0),COLORCYAN; {红} STICKLINE(CLOSE OPEN,CLOSE,OPEN,3,0),COLOR000099; STICKLINE(CLOSE OPEN,CLOSE,OPEN,2.2,0),COLOR0000CC; STICKLINE(CLOSE OPEN,CLOSE,OPEN,1.5,0),COLOR0000FF; STICKLINE(CLOSE OPEN,CLOSE,OPEN,0.5,0),COLORCC66FF; {绿} STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,3,0),COLOR009900; STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,2.2,0),COLOR00BB00; STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,1.5,0),COLOR00DD00; STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,0.5,0),COLOR00FF00; {灰} STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,3,0),COLOR999999; STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,2.2,0),COLORBBBBBB; STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,1.5,0),COLORDDDDDD; STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,0.5,0),COLORFFFFFF; STICKLINE(金叉,OPEN,CLOSE,0.5,0),COLORYELLOW; STICKLINE(死叉,OPEN,CLOSE,0.5,0),COLOR000099; DRAWICON(VAR16,LOW-0.02,7); DRAWICON(死叉ORVAR12ORCROSS(40,VAR9),HIGH+0.01,2); STICKLINE(CROSS(A1X,0),C,O,1,0)COLORFFFFFF;[源码注释]通达信公式动态公式解读A赋值:1日前的最高价/2日前的收盘价的5日指数移动平均*1日前的收盘价的5日线性回归预测值的5日指数移动平均B赋值:收盘价的5日指数移动平均输出OBS:B上穿A AND 1日前的收盘价 2日前的收盘价*1.03 AND 收盘价 1日前的收盘价推荐阅读:通达信黑马线指标公式 VAR1:=EMA(SMA((CLOSE-LLV(LOW,19))/(HHV(HIGH,19)-LLV(LOW,19))*100,8,1),3); STICKLINE(VAR1 20ANDVAR1 80,VAR1,VAR1,10,1),COLORRED; STICKLINE(VAR1 REF(VAR1,1),VAR1,VAR1,10,1),COLORFFCC66; STICKLINE(VAR1 80,VAR1,VAR1,8,1),COLOR00FF00; STICKLINE(VAR1 20,VAR1,VAR1,8,1),COLORYELLOW; V0:=EMA(C,5); V1:=EMA(C,10); V2:=EMA(C,15); V3:=EMA(C,30); V4:=EMA(C,60); M1:=1000*V1/V4 =1015AND1000*V1/V4 =975; M2:=1000*V2/V4 =1020AND1000*V2/V4 =980; M3:=1000*V3/V4 =1015AND1000*V3/V4 =985; M4:=M1ANDM2ANDM3ANDCROSS(V0,V1); M5:=M1ANDM2ANDM3ANDCROSS(V0,V3); 粘合:IF(M4ORM5,40,0),COLORYELLOW,POINTDOT; STICKLINE(粘合,40,0,1,1),COLORYELLOW; W1:=C=HHV(C,20); W2:=BARSLAST(W1); W3:=IF(W2 0,REF(C,W2),REF(C,W2)); W4:=CROSS(C,REF(W3,1)); 突破盘整:IF(W4ANDCOUNT(W4,5)=1,35,0),COLORFF00FF,POINTDOT; STICKLINE(突破盘整,35,0,1,1),COLORFF00FF; MA8:MA(CLOSE,8),COLORWHITE,LINETHICK1; MA21:MA(CLOSE,21),COLORMAGENTA,LINETHICK1; MA60:MA(CLOSE,60),COLORGREEN,LINETHICK1; 买线:=EMA(C,2); 卖线:=EMA(SLOPE(C,8)*1+C,8); BUY1:=CROSS(买线,卖线); SEL:=CROSS(卖线,买线);DRAWTEXT(BUY1,LOW*0.95, 出击 ),COLORWHITE,LINETHICK5; DRAWTEXT(SEL,HIGH*1.05, 回营 ),COLORWHITE,LINETHICK5; STICKLINE(买线 =卖线,LOW,HIGH,0.1,0),COLORRED; STICKLINE(买线 =卖线,CLOSE,OPEN,3,3),COLORRED; STICKLINE(买线 卖线,CLOSE,OPEN,3,3),COLORCYAN; STICKLINE(买线 卖线,LOW,HIGH,0.1,0),COLORCYAN; STICKLINE(CROSS(买线,卖线)ORCROSS(卖线,买线),OPEN,CLOSE,2.5,0),COLORWHITE; VAR8:=VOL 2*MA(VOL,30); VAR9:= DMI.ADX (12,6); VARA:= DMI.ADXR (12,6); VARB:=CLOSE MA(CLOSE,30)ANDCLOSE MA(CLOSE,30)*1.04; VARC:=MA(CLOSE,30) REF(MA(CLOSE,30),1); VARD:=BARSLAST(CROSS(MA(CLOSE,5),MA(CLOSE,10))) BARSLAST(CROSS(MA(CLOSE,10),MA(CLOSE,5))); VARF:=TROUGHBARS(3,15,1) VARF1:=PEAKBARS(3,15,1) VAR10:=EMA(CLOSE,30) REF(EMA(CLOSE,30),2); VAR11:=IF(VARF=1,50,0); 多空:EMA((CLOSE-MA((2*CLOSE+HIGH+LOW)/4,30))/MA((2*CLOSE+HIGH+LOW)/4,30)*100,3),COLORWHITE; IF(多空 0,多空,DRAWNULL),LINETHICK3,COLORRED; IF(多空 0,多空,DRAWNULL),LINETHICK3,COLORGREEN; IF((多空 0AND多空 REF(多空,1)),多空,DRAWNULL),LINETHICK3,COLORLIMAGENTA; STICKLINE(FILTER(VARF=1,5)AND多空 -10,31,0,6,0),COLORRED; STICKLINE(FILTER(VARF=1,5),28,0,4,0),COLORYELLOW; STICKLINE(FILTER(VARF1=1,5)AND多空 10,31,0,5,0),COLORMAGENTA; STICKLINE(FILTER(VARF1=1,5),28,0,4,0),COLORGREEN; DRAWTEXT(FILTER(VARF=1,3),25, 大黑马 ),COLORRED; DRAWTEXT(FILTER(VARF1=1,3),25, 大黑驴 ),COLORLIMAGENTA; STICKLINE(多空 -10,0,多空,1.1,0),COLORYELLOW; STICKLINE(多空 10,0,多空,0.9,0),COLORRED; STICKLINE(多空 0,0,0.1,5,0),COLORRED; STICKLINE(多空 0,0,0.1,5,0),COLORGREEN; STICKLINE(VARF=1,0,VARF,8,0),COLORMAGENTA; STICKLINE(VARF1=1,0,VARF1,8,0),COLORWHITE;每日公式解答: 公式编写要求: 请老师帮忙把“黑马起飞”做个预警!预警要求如下:1、乖离率小于02、关注等于1先谢了,老师!!源码如下:乖离率:(c-ma(c,250))/ma(c,250)*100;n1:=barslast(cross(c,MA(c,250)));n2:=barslast(cross(MA(c,250),c));长期趋势:if(n1 n2,n1+1,0);峰值乖离:hhv(乖离率,长期趋势);长涨幅:(c-ref(c,长期趋势))/ref(c,长期趋势)*100;n3:=barslast(cross(c,MA(c,20)));n4:=barslast(cross(MA(c,20),c));黑马跟踪:if(n3 n4,n3+1,0);涨幅跟踪:(c-ref(c,黑马跟踪))/ref(c,黑马跟踪)*100;换手:VOL/CAPITAL*100LINETHICK0;百日换手:sum(换手,100)LINETHICK0;换手跟踪:sum(换手,0)-ref(sum(换手,0),黑马跟踪),colorff937fLINETHICK0;跟踪系数:换手跟踪/涨幅跟踪,color00ff00LINETHICK0;VAR2:=(2*CLOSE+HIGH+LOW)/4;VAR4:=LLV(LOW,5);VAR5:=HHV(HIGH,4);散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4);庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2);关注:CROSS(散户,庄家)AND散户 30; 公式编写方法: 乖离率:=(C-MA(C,250))/MA(C,250)*100; XG:乖离率