通达信指标公式源码概况:指标类别: 通达信指标公式授权方式: 免费版指标评级: ★★★★★指标分类: 策略画线方法: 副图一、炒股主图指标公式 源码:{n12100013}{n22100021}{n32100034}{n42100055} N:=5; A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); HD:=FILTER(C1,N); RH:=BACKSET(CURRBARSCOUNT=2,BARSLAST(HD)+1); SH:=RH REF(RH,1); H1:REF(H,BARSLAST(SH)),LINETHICK1; A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); LD:=FILTER(C2,N); RL:=BACKSET(CURRBARSCOUNT=2,BARSLAST(LD)+1); SL:=RL REF(RL,1); L1:REF(L,BARSLAST(SL)),LINETHICK1; HH0:=CONST(HHV(H,120))*1; LL0:=CONST(LLV(L,120))*1; MM0:=CONST((HH0+LL0)/2); HH1:=IF(CONST(C) MM0,LL0-(HH0-LL0)*0.4,LL0-(HH0-LL0)*0.2),COLORRE D; LL1:=LL0;HLMAX:=MAX(HH1,LL1); HLMIN:=MIN(HH1,LL1); HLMN1:=(HLMAX+HLMIN)/2; HLMN2:=(HLMAX-HLMIN); HLMN3:=HHV(V,250)/2; HLMN4:=HHV(V,250); VSTD:=STD(VOL,10),VOLSTICK; VZ:=(VSTD-HLMN3)*HLMN2/HLMN4+HLMN1; STICKLINE(C O,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,2,1),COLOR881888; STICKLINE(C =O,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,2,0),COLOR888518; {N21000100} MAVSTD5:=MA(VSTD,5); MAVSTD10:=MA(VSTD,10); STICKLINE(IF(CURRBARSCOUNT =N,V=CONST(LLV(V,N)),DRAWNULL),VZ,(0 -HLMN3)*HLMN2/HLMN4+HLMN1,3,0)COLORFF00FF; 倍:=V/REF(V,1); VOL1:=VOL,VOLSTICK; 换手:=VOL*10000/FINANCE(7); 倍量拄:=VOL =REF(V,1)*1.95ANDC REF(C,1); 梯量拄:=V =REF(V,1)ANDREF(V,1) =REF(V,2)ANDC OANDREF(C O,1); STICKLINE(梯量 拄,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,1,0),COLORLIRED{粉}; STICKLINE(倍量 拄,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,1,0),COLORYELLOW{黄}; STICKLINE(IF(CURRBARSCOUNT =N1,V=CONST(LLV(V,N1)),DRAWNULL),VZ ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,3,0)COLORFF00FF; STICKLINE(IF(CURRBARSCOUNT =N2,V=CONST(LLV(V,N)),DRAWNULL),VZ,( 0-HLMN3)*HLMN2/HLMN4+HLMN1,3,0)COLORFF00FF; STICKLINE(IF(CURRBARSCOUNT =N3,V=CONST(LLV(V,N)),DRAWNULL),VZ,( 0-HLMN3)*HLMN2/HLMN4+HLMN1,3,0)COLORFF00FF; STICKLINE(IF(CURRBARSCOUNT =N4,V=CONST(LLV(V,N)),DRAWNULL),VZ,( 0-HLMN3)*HLMN2/HLMN4+HLMN1,3,0)COLORFF00FF; {VAR2:=0.0001*AMOUNT,VOLSTICK; 百日地量:LV(VAR2,100)=VAR2,STICK,COLORMAGENTA,NODRAW;} N3:=100; 百日地量:=V=LLV(V,N3)ANDV 0ANDBARSCOUNT(V) STICKLINE(百日地量,OPEN,CLOSE,1.8,0),COLORMAGENTA; N1:=13; N2:=55; 地量10日:=V=LLV(V,N1)ANDV 0ANDBARSCOUNT(V) 地量50日:=V=LLV(V,N2)ANDV 0ANDBARSCOUNT(V) STICKLINE(地量10日,OPEN,CLOSE,1.8,0),COLORWHITE; STICKLINE(地量50日,OPEN,CLOSE,1.8,0),COLORWHITE; G2:=REF(C,1); 涨停:=IF((C-G2)*100/G2 =(10-0.01*100/G2),1,0); STICKLINE(涨停,OPEN,CLOSE,-1,0),COLORMAGENTA; {STICKLINE(涨停,H,L,0,0),COLORMAGENTA;} 跌停:=IF((G2-C)*100/G2 =(10-0.01*100/G2),1,0); STICKLINE(跌停,OPEN,CLOSE,-1,0),COLORBLUE; STICKLINE(跌停,H,L,0,1),COLORBLUE; 涨家数:INDEXADV,NODRAW,COLORLIMAGENTA; 跌家数:INDEXDEC,NODRAW,COLORGREEN; HHH0:=CONST(HHV(H,120))*1; LLL0:=CONST(LLV(L,120))*1; MMM0:=CONST((HHH0+LLL0)/2); HHH1:=IF(CONST(C) MMM0,LLL0-(HHH0-LLL0)*0.4,LLL0-(HHH0-LLL0)*0.2), COLORRED; LLL1:=LLL0;HHLMAX:=MAX(HHH1,LLL1); HHLMIN:=MIN(HHH1,LLL1); HHLMN1:=(HHLMAX+HHLMIN)/2; HHLMN2:=(HHLMAX-HHLMIN); HHLMN3:=HHV(V,250)/2; HHLMN4:=HHV(V,250); VVZ:=(V-HHLMN3)*HHLMN2/HHLMN4+HHLMN1; STICKLINE(C =O,VVZ,(0-HHLMN3)*HHLMN2/HHLMN4+HHLMN1,2,1),COLOR RED; STICKLINE(C O,VVZ,(0-HHLMN3)*HHLMN2/HHLMN4+HHLMN1,2,0),COLORC YAN; {(MA(V,5)-HHLMN3)*HHLMN2/HHLMN4+HHLMN1,COLORFFFFFF; (MA(V,10)-HHLMN3)*HHLMN2/HHLMN4+HHLMN1,COLOR00FFFF;}; A11:=CLOSE OPEN; A12:=OPEN-CLOSE;{第一个阴线的实柱长} B11:=BARSLAST(CLOSE =OPEN); B12:=REF(CLOSE,B11)-REF(OPEN,B11);{第一个阳线的实柱长} C10:=B11 C11:=A12-B12 C12:=VOL REF(VOL,B11); C13:=VOL REF(VOL,B11)ANDREF(VOL,1) REF(VOL,2); C14:=IF(B11=2,C13,C12); CC:=C10ANDC11ANDC13;{必须条件} G11:=VOL SUM(VOL,5)/5;{好,不坏} G17:=VOL (REF(VOL,B11)*1/4+REF(VOL,12)*3/4);{有副作用,禁用} G21:=VOL (1/3*SUM(VOL,5)/5+1/3*REF(VOL,B11)+1/3*LLV(VOL,5));{好,不 坏} G22:=10.00 100*SUM(DYNAINFO(37),5)/5;{小测试无副作用} G23:=10000000*(HIGH-LOW)/VOL; G24:=10000000*(REF(HIGH,B11)-REF(LOW,B11))/REF(VOL,B11); G241:=SUM(G24,12)/12; G25:=G23 G241; GG:=G11ANDG21ANDG22ANDG25;{重要的限制条件} F11:=CCANDGG; DRAWICON(F11,HIGH*1.01,27);{输出三:长阴短柱}; T1:=CONST(LLVBARS(LOW,10)); T1HIGH:=CONST(REF(HIGH,T1)); CCB:=CONST(CURRBARSCOUNT); T2:=CONST(BARSLAST(CURRBARSCOUNT CCB+T1ANDH T1HIGH)); T2HIGH:=CONST(REF(HIGH,T2)); T3:=CONST(BARSLAST(CURRBARSCOUNT CCB+T2ANDHIGH T2HIGH)); T3HIGH:=CONST(REF(HIGH,T3)); 凹口淘金:DRAWLINE(CURRBARSCOUNT=T3+1,T3HIGH,ISLASTBAR,T3HIGH, 1),COLOR00FFFF,LINETHICK1; DRAWTEXT(ISLASTBAR,T3HIGH, 凹口淘金 )LINETHICK1,COLOR00FFFF; STICKLINE(C/REF(C,1) 1.095,C,O,2,0),DOTLINE,COLORYELLOW; MAXV:=CONST(HHV(VOL,21)); MAXS:=CONST(HHV(HIGH,21)); BS:=MAXV/MAXS; VOLUME:=VOL/BS*0.10; ORIGIN:=CONST(LLV(LOW,0))-CONST(0.5*HHV(VOLUME,0)); NOTEXT1:MA(VOLUME,2)+ORIGIN; NOTEXT2:MA(VOLUME,6)+ORIGIN; NOTEXT3:MA(VOLUME,30)+ORIGIN; 说明:画线包含高底价,凹口掏金平衡线;成交量包含百日地量,百日地量群, 5日10日20日量线; 主图还包含长阴短拄,长阴短拄群。 N:=10;P:=2; MID:MA(CLOSE,N)COLORYELLOW,DOTLINE; UP:MID+P*STD(CLOSE,N)COLORLIMAGENTA,DOTLINE,LINETHICK2; LO:MID-P*STD(CLOSE,N)COLORLICYAN,DOTLINE,LINETHICK2; KDJ_K:= KDJ.K (9,3,3); KDJ_D:= KDJ.D (9,3,3); KDJ_J:= KDJ.J (9,3,3); 买股票1:=CROSS(KDJ_J,0)OR(CROSS(KDJ_J,KDJ_K)ANDKDJ_D 买股票2:=CROSS( RSI.RSI1 (6,2,2),20)OR CROSS( RSI.RSI1 (6,12,24), RSI.RSI2 (6,12,24)); 买股票3:=CROSS( MACD.DIF , MACD.DEA )ORCROSS( MACD.MACD ,0); 买股票0:=买股票1+买股票2+买股票3; 买股票:=IF(买股票0 1,买股票0,0); DRAWICON(买股票0 1,L*0.97,34); 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 OR VAR14ORVAR15ORVAR16ORVAR17ORVAR18,1)ANDVAR1; VAR1A:=REF(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBORVARC,1)ANDVARD; {粉} STICKLINE(CLOSE REF(CLOSE,1),HIGH,LOW,0,0),COLOR00DD00; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,3.2,0),COLORFF33FF; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLORFF55FF; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLORFF77FF; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLORFF99FF; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLORFFBBFF; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLORFFDDFF; {金} STICKLINE(CLOSE REF(CLOSE,1),HIGH,LOW,0,0),COLOR000DDD; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,3.2,0),COLOR003333; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR005555; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR007777; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR009999; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR00BBBB; STICKLINE(CLOSE REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR00DDDD; {红} STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBOR VARC,CLOSE,REF(CLOSE,1),3.2,0),COLOR000555; STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBOR VARC,CLOSE,REF(CLOSE,1),2.7,0),COLOR000777; STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBOR VARC,CLOSE,REF(CLOSE,1),2.1,0),COLOR000999; STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBOR VARC,CLOSE,REF(CLOSE,1),1.5,0),COLOR000BBB; STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBOR VARC,CLOSE,REF(CLOSE,1),0.9,0),COLOR000DDD; STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8 {绿} STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17OR VAR18,CLOSE,REF(CLOSE,1),3.2,0),COLOR005500; STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17OR VAR18,CLOSE,REF(CLOSE,1),2.7,0),COLOR007700; STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17OR VAR18,CLOSE,REF(CLOSE,1),2.1,0),COLOR009900; STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17OR VAR18,CLOSE,REF(CLOSE,1),1.5,0),COLOR00BB00; STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17OR VAR18,CLOSE,REF(CLOSE,1),0.9,0),COLOR00DD00; STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14 {紫} STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),3.2,0),COLOR550055; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.7,0),COLOR770077; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.1,0),COLOR990099; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLORBB00BB; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),0.9,0),COLORDD00DD; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),0.3,0),COLORFF00FF; {蓝} STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),3.2,0),COLORFF3300; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),2.7,0),COLORFF5500; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),2.1,0),COLORFF7700; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLORFF9900; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),0.9,0),COLORFFBB00;二、最好用的主图指标公式 指标 王:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SM A(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1) REF(10 0-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),1)AND VOL REF(VOL,1)ANDCLOSE REF(CLOSE,1); DRAWTEXT(指标王ANDCOUNT(指标王,30)=1,LOW*0.95, 资金出击 ),LINETHICK1,COLORYELLOW; 指标王都:0.82*MA(FORCAST(CLOSE,2),40),COLORRED; A:EMA(C,21)COLORBLUE,LINETHICK3; B:=A REF(A,1); IF(B-1,A,DRAWNULL)COLORRED,LINETHICK3; AA:=EMA(C,3) EMA(C,21); BB:=EMA(C,3) EMA(C,21); CC:=EMA(C,3) EMA(C,8); CC1:=EMA(C,3) EMA(C,8); DD:=CLOSE OPEN; STICKLINE(AA,H,L,0,0),COLOR007FFF; STICKLINE(AA,O,C,3,1),COLOR007FFF; STICKLINE(AAANDDD,O,C,3,0),COLOR007FFF; STICKLINE(BB,H,L,0,0),COLORGREEN; STICKLINE(BB,O,C,3,1),COLORGREEN; STICKLINE(BBANDDD,O,C,3,0),COLORGREEN; STICKLINE(BBANDCC,H,L,0,1),COLORF00FF0; STICKLINE(BBANDCC,O,C,3,1),COLORF00FF0; STICKLINE(BBANDCCANDDD,O,C,3,0),COLORF00FF0; STICKLINE(AAANDCC1,H,L,0,0),COLORBLUE; STICKLINE(AAANDCC1,O,C,3,1),COLORBLUE; STICKLINE(AAANDCC1ANDDD,O,C,3,0),COLORBLUE; 买线:=MA(CLOSE,9),LINETHICK2; 卖线:=MA(CLOSE,20); BU:=CROSS(买线,卖线); SEL:=CROSS(卖线,买线); DRAWTEXT(BU,L-0.1, 建仓 )COLORYELLOW; DRAWTEXT(SEL,H+0.1, 空仓 A2:=(C-REF(C,1))/REF(C,1)*100 1.02; A3:=H MA(C,5)*1.12; AAA:=A2ANDA3; DRAWTEXT(AAA,H*1.05, 卖点 ),COLORWHITE; EMA13:=EMA(C,13),COLOR0000FF,LINETHICK2; EMA34:=EMA(C,34),COLORYELLOW; EMA55:=EMA(C,55),COLORFF00FF; EMA120:=EMA(C,120),COLORFFCC66; AR1:=EMA55 EMA34ANDEMA34 EMA13; AR2:=BARSLAST((C-EMA13)/EMA13*100 AR3:=EMA13 =REF(EMA13,2); AR4:=COUNT(CROSS(C,EMA13),AR2)=1; AR5:=AR1ANDAR2ANDAR3ANDAR4; AR6:=AR5ANDFILTER(AR5,10); DRAWTEXT(AR6,L-0.09, 启动 ),COLORYELLOW; STICKLINE(AR6,H,L,3,0),LINETHICK2,COLORYELLOW; BR1:=COUNT(BETWEEN((C-REF(C,1))/REF(C,1)*100,0,5),5)=5; BR2:=ABS((EMA13-EMA34)+(EMA34-EMA55))/C BR3:=C EMA55AND(REF(C,1) REF(EMA55,1)ORREF(C,2) REF(EMA55,2)OR REF(C,3) REF(EMA55,3)ORREF(C,4) REF(EMA55,4)ORREF(C,5) REF(EMA55,5)); BR4:=BR1ANDBR2ANDBR3; DRAWTEXT(BR4ANDFILTER(BR4,10),L-0.09, 上升 ),COLOR00C5FF; STICKLINE(BR4ANDFILTER(BR4,10),O,C,3,1),LINETHICK2,COLOR00C5FF; CR1:=(C-REF(C,1))/REF(C,1)*100 CR2:=V MA(V,5)*0.6; CR3:=COUNT(CROSS(EMA13,EMA55),3)=1; CR4:=ABS(EMA34-EMA55)/EMA55 0.03; CR5:=EMA55 =EMA120ANDEMA55 =REF(EMA55,1); CR6:=FILTER(CR1ANDCR2ANDCR3ANDCR4ANDCR5,2); STICKLINE(CR6,O,C,3,1),LINETHICK2,COLORF00FF0; DRAWTEXT(CR6,L-0.09, 涨升 ),COLORF00FF0; DR1:=EMA13 EMA34ANDEMA34 EMA55; DR2:=BARSLAST(CROSS(C,EMA55)); DR3:=H=HHV(H,DR2); DR4:=BARSLAST(DR3); DR5:=COUNT(O CANDC REF(C,1)ANDC EMA55AND BETWEEN((C-EMA55)/EMA55,0,0.02),DR4)=1; DR6:=C REF(C,1); DR7:=DR1ANDDR5ANDDR6; DR8:=DR7ANDFILTER(DR7,10); DRAWTEXT(DR8,L-0.09, 出击 ),COLORD6BA63; ER:=BARSLAST(REF(CROSS(EMA55,EMA34),1))ANDCROSS(EMA34,EMA55); DRAWTEXT(ER,L-0.09, 金叉 ),COLOR0099FF; FR:=BARSLAST(REF(CROSS(EMA34,EMA13),1))ANDCROSS(EMA13,EMA34); DRAWTEXT(FR,L-0.09, 加仓 ),COLORWHITE; GR1:=BARSLAST(BETWEEN( BIAS.BIAS2 (6,13,24),0,5)); GR2:=EMA13 EMA34ANDEMA34 EMA55ANDEMA13 REF(EMA13,1); GR3:=COUNT( BIAS.BIAS2 (6,13,24) 10ANDH=HHV(H,GR1),GR1); GR4:=H=HHV(H,GR1); GR5:= MACD.MACD (12,26,9) REF( MACD.MACD (12,26,9),1); GR6:=GR2ANDGR3ANDGR4; GR7:=GR2ANDGR3ANDGR4ANDGR5; DRAWTEXT(GR6ANDGR7,H+0.13, 了结 ),COLOR00FF00; HR2:=EMA13 =REF(EMA13,3)ANDEMA34 =REF(EMA34,1)AND EMA55 =REF(EMA55,1)ANDCROSS(C,EMA13)ANDCROSS(C,EMA34)AND CROSS(C,EMA55); DRAWTEXT(HR2ANDFILTER(HR2,10),L-0.3, 推进 ),COLORFFC8FF; STICKLINE(HR2ANDFILTER(HR2,10),O,C,3,1),LINETHICK2,COLORFFC8FF; VAR1:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3); VAR2:=CROSS(VAR1,0.9); VAR3:=BACKSET(REF(LOW,2)=LLV(LOW,5),3); VAR4:=CROSS(VAR3,0.9); 压力:=REF(HIGH,BARSLAST(VAR2)),POINTDOT,COLOREA91B5; STICKLINE(CLOSE,REF(HIGH,BARSLAST(VAR2)),REF(HIGH,BARSLAST(VAR2)),2,1), COLOREA91B5,LINETHICK3; 支撑:=REF(LOW,BARSLAST(VAR4)),POINTDOT,COLOR00B4FF; STICKLINE(CLOSE,REF(LOW,BARSLAST(VAR4)),REF(LOW,BARSLAST(VAR4)),2,1), COLOR00B4FF,LINETHICK3; 下档线:=(((CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13)))*100); ARSV:=SMA(下档线,3,1); AK:=SMA(ARSV,3,1); AD:=((3*ARSV)-(2*AK)); AJ12:=(((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55)))*100); ARSV24:=SMA(AJ12,3,1); AK24:=SMA(ARSV24,3,1); AD24:=((3*ARSV24)-(2*AK24)); 撑:=IF(CROSS(AD24,AD),HIGH,REF(HIGH,BARSLAST(CROSS(AD24,AD)))); 撑压位:=IF(ISLASTBAR,撑,DRAWNULL); 底底:=LLV(HIGH,30); 底:=IF(ISLASTBAR,底底,DRAWNULL); STICKLINE(ISLASTBAR,撑压位,撑压位,100,1),LINETHICK1,COLORFFFFFF; STICKLINE(ISLASTBAR,底,底,80,1),COLOR00FF00,LINETHICK1; 布林轨:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORRED,LINETHICK2; 倍量攻击:=V REF(V,1)*2AND(C =0ORC REF(CZ1)),COLORRED,NODRAW; 角线:=(ATAN((MA(CZ5)/REF(MA(C,5),1)-1)*100)*180/3.14115926); 角线MA:=MA(角线,5); ANA:=PLOYLINE(CROSS(角线,角线MA),角线MA),COLORRED; ANB:=PLOYLINE(CROSS(角线MA,角线),角线MA)ZCOLORFFOOFF; 角买点:=CROSS(角线,角线MA)AND((ANB REF(ANB,1)ANDANB ANAAND角线 MA =0)OR ((角线MA =-45ORCROSS(角线MA,・45))AND(ANB -60ORLLV(“KDJ.J“,3)v=・49) AND ANB 0)), COLORGREEN; 角买入:IF(角买点,1,0),COLORRED,LINETHICK2; 角起涨:=COUNT(CROSS(角线,角线MA),ANAvREF(ANA,5)ANDANB REF(ANB,5)); 起涨点:IF(角起涨,1,0),COLORLIRED,LINETHICK2; 角卖点:=(CROSS(角线MA,角线)AND(ANB REF(ANB,1)ORANA REF(ANA,1))AND ANB ANA{ANDANB 0}AND角线MA 0)*l; 角卖出:IF(角卖点zl,0),COLORGREEN,LINETHICK2; 角始跌:=COUNT(CROSS(角线MA,角线),ANAvREF(ANA,5)ANDANB REF(ANB,5)); 起跌点:IF(角始跌,1,0)[源码注释]通达信公式动态公式解读V111赋值:120日内最高价的最低值飞鱼赋值:100*(收盘价-V111)/V111,画黄色,线宽为1V211赋值:120日内最高价的最高值海洋赋值:100*(V211-收盘价)/收盘价,画绿色,线宽为1海1赋值:22日内海洋的最高值,画绿色,线宽为1当满足条件飞鱼 海1时,在日期日130日内最高价的最高值和日期日130日内最低价的最低值位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLOR545454 K线输出 上:(开盘价和收盘价的较大值-开盘价和收盘价的较小值)*2/3+开盘价和收盘价的较小值,画洋红色,NODRAW输出中:(开盘价+收盘价)/2,画红色,NODRAW输出下:(开盘价和收盘价的较大值-开盘价和收盘价的较小值)/3+开盘价和收盘价的较小值,画黄色,NODRAWF10赋值:100*(收盘价-开盘价)/开盘价F20赋值:100*(收盘价-1日前的收盘价)/1日前的收盘价振幅赋值:(最高价-最低价)/1日前的收盘价*100RQ赋值:如果日期 =1200824,返回1,否则返回0KCB赋值:如果属于某板块,返回1,否则返回0CYB赋值:如果属于某板块ANDRQ,返回1,否则返回0ZT1赋值:F20 =9.5 AND 收盘价=最高价 AND 取反ZT2赋值:F20 =19.5 AND 收盘价=最高价 AND (KCB OR CYB)ZT3赋值:平盘AND 收盘价=最低价 AND 收盘价=最高价 AND (ZT1 OR ZT2)ZT4赋值:ZT1 OR ZT2 OR ZT3当满足条件ZT4时,在开盘价和收盘价位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLORFF00FF当满足条件ZT4时,在最高价和最低价位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLORFF00FF输出强弱分界80:获利盘为85%的成本分布的10日指数移动平均,画红色输出强弱分界99:获利盘为99%的成本分布的10日指数移动平均,画绿色强弱分界80向上赋值:强弱分界80 1日前的强弱分界80强弱分界99向上赋值:强弱分界99 1日前的强弱分界99输出LC:100*(最低价-1日前的收盘价)/1日前的收盘价,画绿色,NODRAW输出HC:100*(最高价-1日前的收盘价)/1日前的收盘价,画白色,NODRAW当满足条件LC =-5时,在中和最低价位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLORFF8000当满足条件LC =-8时,在中和最低价位置之间画柱状线,宽度为0,0不为0则画空心柱.,画黄色当满足条件(最高价/1日前的收盘价 =1.03)时,在中和最高价位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLOR838383当满足条件(最高价/1日前的收盘价 =1.05)时,在中和最高价位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLORFF8000当满足条件(最高价/1日前的收盘价 =1.08)时,在中和最高价位置之间画柱状线,宽度为0,0不为0则画空心柱.,画黄色,线宽为2推荐阅读:主图趋势线指标公式 ZGD:=HHV(H,210)*0.99; ZGD2:=CONST(ZGD); ZDD:=LLV(L,210); ZDD2:=CONST(ZDD); 急速超跌:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100 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; VAR1A:=((REF(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR VAR8ORVAR9ORVARAORVARBORVARC,1))ANDVARD); 红色持股:VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7ORVAR8 ORVAR9ORVARAORVARBORVARC,NODRAW,COLOR0000FF; 青色观望:VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR VAR14ORVAR15ORVAR16ORVAR17ORVAR18,NODRAW,COLORFFFF00; 黄底短买:VAR19,NODRAW,COLOR33FFCC; 品红离场:VAR1A,NODRAW,COLORFF00FF; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.8,0),COLOR33AACC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.6,0),COLOR33AACC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.4,0),COLOR33BBCC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2,2),COLOR33CCCC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2.0,0),COLOR33DDCC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),1.8,0),COLOR33EECC; STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLOR33FFCC; DRAWTEXT(VAR19,REF(CLOSE,1), ←短买 ),COLOR33FFCC; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),2.8,0),COLORFF33FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),2.3,0),COLORFF44FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),2,0),COLORFF55FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1.8,0),COLORFF66FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLORFF77FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1.3,0),COLORFF88FF; STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1,0),COLORFF99FF; DRAWTEXT(VAR1A,REF(CLOSE,1)+0.1, ←离场 ),COLORFF99FF; MA05:MA(C,5)LINETHICK3,COLOR00CCFF; MA10:=MA(C,10); MA20:=MA(C,20); MA30:=MA(C,30); 五日乖离率:=(C-MA05)/MA05*100; BB05:=ATAN((MA05/REF(MA05,1)-1)*100)*180/3.1416; 速度5:=SMA(EMA((MA05-REF(MA05,1))/REF(MA05,1),3)*100,3,1); 加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW; IF(BB05 30ANDMA05 REF(MA05,1),MA05,DRAWNULL),LINETHICK3,COLORRED; BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416; IF(BB05 0ANDMA05 REF(MA05,1),MA05,DRAWNULL),LINETHICK3,COLORGREEN; 三拾日乖离率:=(C-MA30)/MA30*100,NODRAW; VAR1:=(MA20-MA30) REF((MA20-MA30),1)ANDMA20 REF(MA20,1)AND MA30 REF(MA30,1); VAR2:=(MA30-MA20) REF((MA30-MA20),1)ANDMA20 REF(MA20,1)AND MA30 REF(MA30,1); BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416; 强势狙击:=FILTER(BB30 30ANDBB10 45ANDCROSS(BB05,60),10); 加仓:=FILTER(COUNT(CROSS(BB05,30),5) =1ANDMA05 REF(MA05,1)AND三拾日 乖离率 REF(三拾日乖离率,1)ANDMA10 REF(MA10,1) AND加速度5 REF(加速度5,1)AND速度5 REF(速度5,1),10); 清仓:=FILTER(COUNT(CROSS(30,BB05),5) =1AND(C MA30ORO MA30)AND MA05 REF(MA05,1)AND三拾日乖离率 REF(三拾日乖离率,1)AND MA10 REF(MA10,1),10); DRAWTEXT(加仓,LOW*0.98, ←加仓 ),COLORRED; JC:=CROSS(0,五日乖离率)AND三拾日乖离率 REF(三拾日乖离率,1)AND MA10 REF(MA10,1); 减仓:=FILTER(JC,10); MR:=COUNT(CROSS(五日乖离率,0),3) =1AND三拾日乖离率 REF(三拾日乖离率,1) ANDMA05 REF(MA05,1)AND(C/REF(C,1)-1)*100 5ANDREF(C,1) MA30; 买入:=FILTER(MR,10); DRAWTEXT(减仓,HIGH*1.02, ←风险 ),COLORCYAN; DRAWTEXT(买入,LOW*0.98, ←买入 ),COLORYELLOW; DRAWTEXT(清仓,HIGH*1.02, ←清仓 ),COLORGREEN; DRAWTEXT(强势狙击,LOW*0.98, ←强势狙击 ),COLORYELLOW; VAR21:=MAX(ABS(HIGH-AMOUNT/VOL/100),ABS(AMOUNT/VOL/100-LOW)); VAR3:=ABS((OPEN+CLOSE)/2-AMOUNT/VOL/100); MV:=(VAR21+VAR3)/AMOUNT*VOL*100*50; 压力:MA(REF(HHV(C,30),1),2),COLOR9DFFFF; 支撑:MA(REF(LLV(C,30),1),2),COLORABFF46; 主图: MA1:MA(C,2); MA5:MA(C,5); MA7:MA(C,7); MA10:MA(C,10); DRAWICON(CROSS(MA(C,2),MA(C,5)),L,1); 副图: LONGGGG发财线:=38,COLORFF3311; STICKLINE(C 0,38,38,1,1),COLORFF9911; LONGGGG趋势线:=51,COLORFF1155; STICKLINE(C 0,51,51,1,1),COLORFF1199; OK:=REF(CLOSE,1); RSI1:SMA(MAX(CLOSE-OK,0),7,1)/SMA(ABS(CLOSE-OK),7,1)*100,COLORFFFFFF; RSI2:SMA(MAX(CLOSE-OK,0),7,1)/SMA(ABS(CLOSE-OK),7,1)*100,COLORFFFFFF; RSI3:SMA(MAX(CLOSE-OK,0),7,1)/SMA(ABS(CLOSE-OK),7,1)*100,COLORFFFFFF; RSI4:SMA(RSI3,7,1),LINETHICK2,COLOR00CD00; 趋势 A:=MA(((CLOSE-LLV(LOW,48))/(HHV(HIGH,48)-LLV(LOW,48))*50),17)+9,COLOR FFFFFF; 趋势 B:=MA(((CLOSE-LLV(LOW,53))/(HHV(HIGH,53)-LLV(LOW,53))*50),17)+9,COLOR 3377DD; 趋势 C:EMA(((CLOSE-LLV(LOW,38))/(HHV(HIGH,38)-LLV(LOW,38))*50),17)+18,COLO RYELLOW,LINETHICK2; W1:MA(趋势A,7)*1.372,COLORRED,LINETHICK2; W2:=W1*1.0887; W3:(1.5*(趋势 B+RSI4)-(W2+W1))+12,COLOR3377FF,COLORRED,LINETHICK2,COLORFF0000; W4:IF((CROSS(W1,趋势C)ORCROSS(W1,W3)ANDW3 LONGGGG发财线AND RSI2 LONGGGG趋势线),48,38),COLORFFFFFF; XG:IF((CROSS(RSI2,RSI4)ORCROSS(RSI2,W3)ANDW3 LONGGGG发财线AND RSI1 LONGGGG趋势线),48,38),COLORFF6655;