当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码:趋势波段,波段抄底,自动划线

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

趋势波段:

趋势波段操作使用方法简介:
趋势形成后,买入并采取波段操作的方式进行买卖操作即可
 
温馨提示:
1、此指标含未来函数ZIG,利用ZIG的拐点形成后再出信号。即:上升趋势---ZIG(3,10) 大于 REF(ZIG(3,10),1);
2、信号出现后不漂移(如,000035,可用沙盘推演看出),请放心使用。若在意的话就不用下载了!( 顶尖财经 股票学院: http://www.58188.com )
3、信号出现后在观察1天,确认是上升趋势后再利用盘中分时逢低买入,并设置好止损(很重要)!
指标的用法较多,请仔细观察和思考,具体就不多讲了!

{趋势波段操作 副图}
VAR8:=600*(EMA(CLOSE,3)-EMA(LOW,30))/EMA(LOW,30);
 VAR9:=EMA(VAR8,7);
 VARA:=(WINNER(120*CLOSE/100)-WINNER(100*CLOSE/100))*100;
 VARB:=(-100)*(WINNER(120*CLOSE/100)-WINNER(100*CLOSE/100))+5;
 OK1:=VARA+VARB<7 AND CROSS(VAR8,VAR9) AND VAR9<-18 AND VAR9<VARB;
 VARC:=HHV(HIGH,9)-LLV(LOW,9);
 VARD:=HHV(HIGH,9)-CLOSE;
 VARE:=CLOSE-LLV(LOW,9);
 VARF:=VARD/VARC*100-70;
 VAR10:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;
 VAR11:=(2*CLOSE+HIGH+LOW)/4;
 VAR12:=SMA(VARE/VARC*100,3,1);
 VAR13:=LLV(LOW,34);
 VAR14:=SMA(VAR12,3,1)-SMA(VARF,9,1);
 VAR15:=IF(VAR14>100,VAR14-100,0);
 VAR16:=HHV(HIGH,34);
 VAR17:=EMA((VAR11-VAR13)/(VAR16-VAR13)*100,8);
 VAR18:=EMA(VAR17,5);
动力:VAR17,NODRAW;
价差:(VAR17-VAR18),NODRAW;
 OK2:=CROSS(VAR17,15);
 
 
 
 STICKLINE(价差>0 AND 价差>REF(价差,1),VAR17,VAR18,3,0),COLOR0000CC;
 STICKLINE(价差>0 AND 价差<REF(价差,1),VAR17,VAR18,3,1),COLOR0000CC;
 STICKLINE(价差<0 AND 价差<REF(价差,1),VAR17,VAR18,3,0),COLORCCCC00;
 STICKLINE(价差<0 AND 价差>REF(价差,1),VAR17,VAR18,3,1),COLORCCCC00;
 
 UP:=ZIG(3,10)>REF(ZIG(3,10),1);
 STICKLINE(UP=1,50,50,1,0),COLORRED;
 STICKLINE(UP=0,50,50,1,0),COLORWHITE;
 
 STICKLINE(C>0,80,80,1,0),COLORC6C600;
 STICKLINE(C>0,20,20,1,0),COLORGREEN;
 
 OK:=(OK1=1 OR OK2=1) AND UP=1;
 OKOK:=FILTER(OK,5);
 STICKLINE(OKOK,30,70,0,-1),COLORYELLOW;{画垂直线}
IF(OKOK,50,DRAWNULL),POINTDOT,COLORRED,LINETHICK5;{画大圆点};




波段抄底:

资金波动:EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3),POINTDOT,
COLORRED,LINETHICK5;
I:=MA(BARSLAST(HIGH=HHV(HIGH,16))*IF(CLOSE<OPEN,VOL,1),3);
R:=MA(BARSLAST(LOW=LLV(LOW,18))*IF(CLOSE>OPEN,VOL,1),4);
超强势:84,POINTDOT,COLORMAGENTA,LINETHICK3;
强势:60,POINTDOT,COLORGREEN,LINETHICK3;
弱市:35,POINTDOT,COLORWHITE,LINETHICK3;
短线逃顶:=IF(I,0,1),COLORGREEN;
DRAWICON(短线逃顶,90,2);
VAR1:=(CLOSE-LLV(LOW,45))/(HHV(HIGH,45)-LLV(LOW,45))*100;
VAR2:=SMA(VAR1,3,1);
VAR3:=SMA(VAR2,3,1);
A6:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,
1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1); 
黑马线:EMA(A6,5),LINETHICK2,COLOR6600FF; 
贵:=12,COLOR00FF00;{分析家公式网 WWW.70822.COM}
VAR4:=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);
A7:=(黑马线-REF(黑马线,1))/REF(黑马线,1)*100; 
A8:=EMA(C,5);
VAR5:=CROSS(VAR4,10) AND VAR3<12;
抄底:IF(VAR5,90,1),COLORRED;
DRAWICON(VAR5,65,1);
DRAWTEXT(VAR5,30,'抄底'),COLORYELLOW;
A9:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100; 
趋势线: (MA(3*SMA(A9,6,1)-2*SMA(SMA(A9,5,1),5,1),2)),LINETHICK2,COLORYELLOW; 
A10:=(HHV(H,60)-C)/(HHV(H,60)-LLV(L,60))*100; 
备钱:IF(CROSS(10,VAR4),40,1),COLORFF00FF;
DRAWICON(CROSS(10,VAR4),45,1);
DRAWTEXT(CROSS(A6,黑马线)AND 黑马线<A10,黑马线,'黑马'); 
DRAWTEXT(CROSS(黑马线,A10)AND 趋势线<80,黑马线,'追涨'); 
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,5,'大黑马'); 
A1:=EMA(CLOSE,5);
A2:=EMA(CLOSE,10);
A3:=EMA(CLOSE,20);
A4:=EMA(CLOSE,40);
A5:=EMA(CLOSE,60);
DRAWTEXT(FILTER(REF(黑马线,1)>90 AND A2<0,7),黑马线,'跑'),COLOR00FF00;
上穿季线:IF(CROSS(A3,A4) AND CROSS(C,A5),50,0),COLORRED,LINETHICK2;
底部:(A7<-10 AND A7>REF(A7,1))*25,COLORRED; 
DRAWICON(底部 AND A8>REF(A8,1),25,4); 
CHNMONEY:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1),COLORF00FF0; 
大势已去:IF(CROSS(黑马线,A6)AND 黑马线>70 AND 趋势线>80,90,100),COLORFF0000;




自动划线:

A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); 
B1:=FILTER(A1,3); 
C1:=BACKSET(B1,3+1); 
D1:=FILTER(C1,3);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*3+1); 
B2:=FILTER(A2,3); 
C2:=BACKSET(B2,3+1); 
D2:=FILTER(C2,3);{低点}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; 
E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 AND E1=E2);
X1:=REF(BARSLAST(H1),1)+1; 
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1); 
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);{过滤后低点}
L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1; 
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1); 
I2:=BACKSET(G2,2); 
HD:=I2>REF(I2,1);{过滤后高点}
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); 
J2:=J1>REF(J1,1);
A3:=H; B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; 
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); 
HH:=E3>REF(E3,1);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H*1.01,8);     
DRAWICON(LL,L*0.999,7);
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一K线}
X3:=REF(BARSLAST(H3),1)+1; 
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);  
I3:=BACKSET(G3,2);  
LZ:=I3>REF(I3,1); {长期低点,也可供引用}
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1; 
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);  
I4:=BACKSET(G4,2);  
HZ:=I4>REF(I4,1);{长期高点,也可供引用}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); 
K2:=K1>REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
前一低:REF(L,BARSLAST(VV)),COLOR99FF66,LINETHICK1;
前二低:REF(L,BARSLAST(XX)),COLOR99FF66,LINETHICK1;
前一高:REF(H,BARSLAST(VV2)),COLORCYAN,LINETHICK1;
前二高:REF(H,BARSLAST(XX2)),COLORCYAN,LINETHICK1; 
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=5,前一低*0.995,'前一低'),COLOR99FF66;
DRAWTEXT(CURRBARSCOUNT=5,前二低*0.995,'前二低'),COLOR99FF66;
DRAWTEXT(CURRBARSCOUNT=1,前一高*1.01,'前一高'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,前二高*1.01,'前二高'),COLORCYAN; 
涨家数:INDEXADV,COLOR0080FF,NODRAW;
跌家数:INDEXDEC,COLORGREEN,NODRAW; 

上一篇:通达信源码:牛熊百彩K线,股性叠加,MACD趋势

下一篇:通达信源码:MACD波段,MACD趋势,MACD大牛启动,风控MACD