以下是一些常见的 “主力波段王” 相关主图源码,以通达信软件为例:
源码一
plaintext今日保护价:=(REF(C,2)+REF(C,1)+O)/3 ,COLOR4080FF,NODRAW; 乖离:=TGLXS,LINETHICK1,COLORWHITE,NODRAW; 跌:=(斜率< -0.1 OR 降 OR 速率< 0 OR 乖离< 0) AND ZA5< 0 AND NOTEXT下笔划线 ,COLORCYAN; Q2:=(CLOSE-LLV(LOW, 18))/(HHV(HIGH, 18)-LLV(LOW, 18))*100; Q3:=SMA(Q2, 9, 1); Q4:=SMA(Q3, 3, 1); 长趋势:=3*Q3-2*Q4,COLORRED,LINETHICK3; 趋势线:=EMA(Q3, 3),COLORWHITE,LINETHICK3; 升1:=CROSS(MA(C,5),MA(C,33)) AND MID>REF(MID,1) AND ZA5>0 AND (长趋势>=趋势线 OR 长趋势>=REF(长趋势,1)),NODRAW,COLORRED; 升:=(NOT(跌) OR 涨 OR 升1) AND (ZA5>0.05 ) AND NOTEXT上笔划线 AND 斜率>=0,COLORMAGENTA; DRAWTEXT(升 AND COUNT(升,5)=1,(B4+0.08),'升'),COLORYELLOW; DRAWTEXT(跌 AND COUNT(跌 ,3)=1 AND ZA5< -0.05 AND 斜率<=-0.1,(B4 + 0.04),'跌'),COLORWHITE; VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100; VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57; VAR400:=EMA(VAR300,5); 操盘:=3*VAR300-2*VAR400; AW:=CROSS(操盘,VAR300) AND VAR300< 2.1 AND C>O; MAR3:=MA(C,3); 角度:=ATAN((MAR3/REF(MAR3,1)-1)*100)*180/3.14159>45 ,NODRAW; RSV2:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100; K2:=SMA(RSV2,3,1); D2:=SMA(K2,3,1); kd金:=K2< 30 AND D2< 30 ; plaintext99123456789101112131415161718192021222324›今日保护价:=(REF(C,2)+REF(C,1)+O)/3 ,COLOR4080FF,NODRAW;乖离:=TGLXS,LINETHICK1,COLORWHITE,NODRAW;跌:=(斜率< -0.1 OR 降 OR 速率< 0 OR 乖离< 0) AND ZA5< 0 AND NOTEXT下笔划线 ,COLORCYAN;Q2:=(CLOSE-LLV(LOW, 18))/(HHV(HIGH, 18)-LLV(LOW, 18))*100;Q3:=SMA(Q2, 9, 1);Q4:=SMA(Q3, 3, 1);长趋势:=3*Q3-2*Q4,COLORRED,LINETHICK3;趋势线:=EMA(Q3, 3),COLORWHITE,LINETHICK3;升1:=CROSS(MA(C,5),MA(C,33)) AND MID>REF(MID,1) AND ZA5>0 AND (长趋势>=趋势线 OR 长趋势>=REF(长趋势,1)),NODRAW,COLORRED;升:=(NOT(跌) OR 涨 OR 升1) AND (ZA5>0.05 ) AND NOTEXT上笔划线 AND 斜率>=0,COLORMAGENTA;DRAWTEXT(升 AND COUNT(升,5)=1,(B4+0.08),'升'),COLORYELLOW;DRAWTEXT(跌 AND COUNT(跌 ,3)=1 AND ZA5< -0.05 AND 斜率<=-0.1,(B4 + 0.04),'跌'),COLORWHITE;VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;VAR400:=EMA(VAR300,5);操盘:=3*VAR300-2*VAR400;AW:=CROSS(操盘,VAR300) AND VAR300< 2.1 AND C>O;MAR3:=MA(C,3);角度:=ATAN((MAR3/REF(MAR3,1)-1)*100)*180/3.14159>45 ,NODRAW;RSV2:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;K2:=SMA(RSV2,3,1);D2:=SMA(K2,3,1);kd金:=K2< 30 AND D2< 30 ;
源码二
plaintextP:=14;WW:=(LLV(H,55)+HHV(L,55))/2; WW2:=(C*4+L*3+H*2+O)/10; OBV:=WW2; A1:=REF(OBV,P)=HHV(OBV,2*P+1); B1:=FILTER(A1,P); C1:=BACKSET(B1,P+1); D1:=FILTER(C1,P); A2:=REF(OBV,P)=LLV(OBV,2*P+1); B2:=FILTER(A2,P); C2:=BACKSET(B2,P+1); D2:=FILTER(C2,P); A111:=REF(H,3)=HHV(H,2*6+1); B111:=FILTER(A111,3); C111:=BACKSET(B111,3+1); D111:=FILTER(C111,3+1); A112:=REF(L,3)=LLV(L,2*6+1); B112:=FILTER(A112,3+1); C112:=BACKSET(B112,3+1); D112:=FILTER(C112,3); E111:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2; E112:=(H+L)/2; H111:=(D111 AND NOT(D112 AND E111>=E112)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
源码三
plaintextMA25:=MA(C,25); EMA135:=EMA(C,135); EMA250:=EMA(C,250); 涨停:=C>=ZTPRICE(REF(C,1),0.1); LINE1:=MA25; {简单移动平均线 25日} LINE2:=EMA250; {指数移动平均线 250日} LINE3:=EMA135; {指数移动平均线 135日} STICKLINE(NOT(涨停) AND C>LINE1 AND C>O,C,O,3,1),COLOR15CFD9; STICKLINE(NOT(涨停) AND C<LINE1,C,O,3,0),COLORD32C5E; STICKLINE(涨停,C,O,3,1),COLOR00FFFF; STICKLINE(涨停,L,H,0.3,1),COLOR00FFFF; {WWW.GPXIAZAI.COM} STICKLINE( C>LINE1 AND H>=REF(H,1),LINE1*1.02,LINE1,0.3,0),COLOR00FFFF; STICKLINE( C<LINE1,H,LINE1,0.3,0),COLORFF8080; L01A:LINE1,LINETHICK3,COLOR0000FF; L01B:IF(C<LINE1,LINE1,DRAWNULL),LINETHICK3,COLOR00FF00; DRAWICON(CROSS(LINE2,C),LINE2,23); DRAWICON(CROSS(LINE3,C),LINE3,23); 牛熊135A: LINE3,LINETHICK3,COLOR000080; 牛熊135B: IF(C<LINE3,LINE3,DRAWNULL),LINETHICK3,COLOR008000; 牛熊250A: LINE2,LINETHICK3,COLORC0C0C0; 牛熊250B: IF(C<LINE2,LINE2,DRAWNULL),LINETHICK3,COLORFF0080;
以上源码可在通达信软件中通过 “公式管理器”-“新建” 来创建主图指标,将代码复制粘贴进去即可。不过需要注意的是,不同的源码可能适用于不同的市场环境和股票类型,且指标只是辅助工具,不能完全依赖它们进行投资决策。