通达信智能诊股主图指标
N:=5;M1:=10;M2:=20;
牛熊线:(EMA(CLOSE,30)+EMA(CLOSE,72))/2,LINETHICK2,COLORRED;
DRAWTEXT(ISLASTBAR,牛熊线,'牛熊线'),COLORRED;
M5:MA(CLOSE,N),COLORWHITE,LINETHICK0;
M10:MA(CLOSE,M1),COLORYELLOW;
M20:MA(CLOSE,M2),COLORFF00FF;
VAR1:=IF(CLOSE>OPEN,CLOSE,OPEN);
VAR2:=MEMA(CLOSE,5);
{股票指标网}
VAR3:=ATAN((VAR2/REF(VAR2,1)-1)*100);
VAR4:=IF(VAR3>0,VAR3,VAR3);
VAR5:=(CLOSE/REF(CLOSE,1)-1)*100;
VAR6:=VAR5<1.5 AND VAR5>-1.5;
强势:IF(VAR4>=REF(VAR4,1) AND VAR4>=0,M10,DRAWNULL),COLORRED,LINETHICK4;
整理:IF(VAR4<REF(VAR4,1) AND VAR4>0,M10,DRAWNULL),COLORGREEN,LINETHICK4;
A1:=REF(H,8)=HHV(H,2*8+1);
B1:=FILTER(A1,8);
C1:=BACKSET(B1,8+1);
D1:=FILTER(C1,8);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1);
DRAWLINE(D1,H,S11,H,1),COLORWHITE;
A2:=REF(L,8)=LLV(L,2*8+1);
B2:=FILTER(A2,8);
C2:=BACKSET(B2,8+1);
D2:=FILTER(C2,8);{低点}
AA05:=MA(C,5),COLOR0099CC;
五日乖离率:=(C-AA05)/AA05*100;
BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((AA05-REF(AA05,1))/REF(AA05,1),3)*100,3,1);
加速度5:EMA((速度5-REF(速度5,1)),3),NODRAW;
AA10:=MA(C,10);
AA20:=MA(C,20);BB10:=ATAN((AA10/REF(AA10,1)-1)*100)*180/3.1416;
AA30:=MA(C,30);
三拾日乖离率:=(C-AA30)/AA30*100;
VAR11:=(AA20-AA30)>REF((AA20-AA30),1)
AND AA20>REF(AA20,1) AND AA30>REF(AA30,1);
VAR22:=(AA30-AA20)<REF((AA30-AA20),1) AND AA20<REF(AA20,1) AND
AA30<REF(AA30,1);
BB30:=ATAN((AA30/REF(AA30,1)-1)*100)*180/3.1416;
强势狙击:=FILTER(BB30>30 AND BB10>45 AND
CROSS(BB05,60),10);
加仓:=FILTER(COUNT(CROSS(BB05,30),5)>=1 AND
AA05>REF(AA05,1) AND 三拾日乖离率>REF(三拾日乖离率,1) AND
AA10>REF(AA10,1)
AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1) ,10) ;
清仓:=FILTER(COUNT(CROSS(30,BB05),5)>=1 AND (C>AA30 OR O>AA30) AND
AA05<REF(AA05,1) AND 三拾日乖离率<REF(三拾日乖离率,1) AND
AA10<REF(AA10,1),10);
DRAWICON(加仓 ,LOW*0.99,23);
DRAWICON(清仓 ,HIGH*1.01,15);
DRAWICON(强势狙击 ,LOW*0.99,13);
HH0:=HHV(H,N);
LL0:=LLV(L,N);
MM0:=CONST((HH0+LL0)*0.5);
S01:=CONST(IF(REF(C,N-15)>MM0,1.00,-0.04));
S02:=CONST(IF(REF(C,N-15)>MM0,-1,1));
S1:=IF(FINDSTR(EXTERNSTR(0,13),'万元'),S01+(0.04*S02),S01);
S2:=IF(FINDSTR(EXTERNSTR(0,12),'。'),S1+(0.04*S02),S1);
S3:=IF(FINDSTR(EXTERNSTR(0,8),'公告'),S2+(0.04*S02),S2);
S4:=IF(FINDSTR(EXTERNSTR(0,10),','),S3+(0.04*S02),S3);
S5:=IF(FINDSTR(EXTERNSTR(0,15),'-'),S4+(0.04*S02),S4);
S6:=IF(FINDSTR(EXTERNSTR(0,1),','),S5+(0.04*S02),S5);
S7:=IF(FINDSTR(EXTERNSTR(0,14),'-'),S6+(0.04*S02),S6);
S8:=IF(FINDSTR(EXTERNSTR(0,11),'-'),S7+(0.04*S02),S7);
S9:=IF(FINDSTR(EXTERNSTR(0,9),'-'),S8+(0.04*S02),S8);
M:=13;{股票指标网}
M3:MA(CLOSE,3),COLORRED,LINETHICK;
M13:MA(CLOSE,13),COLORRED,LINETHICK;
M34:MA(CLOSE,34),COLORRED,LINETHICK;
X:=BARSLAST(REF(CROSS(C,MA(C,120)),1)) AND CROSS(MA(C,20),MA(C,120));
IF(M34<REF(M34,1),M34,DRAWNULL),COLORGREEN,LINETHICK;
STICKLINE(M3>=M13 AND M34>=REF(M34,1) ,H ,L ,0.1 ,0 ),COLORRED;
STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3 ,1 ),COLORRED;
STICKLINE(M3>=M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3 ,0 ),COLORRED;
STICKLINE(M3<M13 AND M34>=REF(M34,1) ,H ,L ,0.1 ,0 ),COLORYELLOW;
STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C>=O ,O ,C ,3 ,1 ),COLORYELLOW;
STICKLINE(M3<M13 AND M34>=REF(M34,1) AND C<O ,O ,C ,3 ,0 ),COLORYELLOW;
STICKLINE(M3<M13 AND M34<REF(M34,1) ,H ,L ,0.1 ,0 ),COLORGREEN;
STICKLINE(M3<M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3 ,1 ),COLORGREEN;
STICKLINE(M3<M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3 ,0 ),COLORGREEN;
STICKLINE(M3>=M13 AND M34<REF(M34,1) ,H ,L ,0.1 ,0 ),COLORMAGENTA;
STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C>=O ,O ,C ,3 ,1 ),COLORMAGENTA;
STICKLINE(M3>=M13 AND M34<REF(M34,1) AND C<O ,O ,C ,3 ,0 ),COLORMAGENTA;
STICKLINE(ISLASTBAR,HHV(C,5),HHV(C,5),218,1)COLORRED;
STICKLINE(ISLASTBAR,HHV(C,5)*0.95,HHV(C,5)*0.95,218,1)COLORRED;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,1,1.1,8,STRCAT(Z3,GNBLOCK)),COLORFFFF80;
DRAWTEXT_FIX(1,0.8,0.8,0,'★ 筹码峰 ★'),COLORRED;
DRAWNUMBER_FIX(1,0.9,0.8,0,CONST(WINNER(C)*100));
AA:=(REF(CLOSE,1)+REF(CLOSE,2)+OPEN)/3;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.9,0.9,1,'《 今日保护价 》'),LINETHICK2,COLOR00FFFF;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.95,0.9,1,AA),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.96,0.9,0,'元');
线断走人:IF(ZIG(MA((H+L)/2,3),3)>REF(ZIG(MA((H+L)/2,3),3),1),ZIG(MA((H+L)/2,3),3),DRAWNULL),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(1,0.32,2,0,'黄s断◆ 线断走人出局 ◆'),COLORYELLOW;
DRAWRECTREL(0,480,205,589,RGB(10,1,30));
资金流入:=SUM(IF(C>REF(C,1),V,0),FROMOPEN),NODRAW;
资金流出:=-SUM(IF(C<REF(C,1),V,0),FROMOPEN),NODRAW;
资金出入:=资金流入+资金流出,NODRAW;
DRAWBAND(资金出入,RGB(150,0,150),0,RGB(0,100,0)),NODRAW;
资金流量:资金出入,NODRAW;
资金比:资金出入/SUM(V,FROMOPEN)*100,NODRAW;
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-ABS((资金比-100)/2)),NODRAW;
攻击量:=((HSL*0.50+REF(HSL,1)*0.33)+(REF(HSL,2)*0.17))*SUM(C,FROMOPEN)/FROMOPEN,NODRAW;
攻击量A:=SUM(IF(C>REF(C,1),攻击量*V,0),FROMOPEN),NODRAW;
攻击量B:=-SUM(IF(C<REF(C,1),攻击量*V,0),FROMOPEN),NODRAW;
攻击流量:攻击量A+攻击量B,NODRAW;
NOTEXT攻击线:攻击流量,NODRAW;
攻击比:攻击流量/SUM(V,FROMOPEN)*100,COLORRED,NODRAW;
资金攻击度:=IF(攻击比>=0,(攻击比+50),100-ABS((攻击比-50)));
{STICKLINE(资金流量A>0,资金流量A,0,1,0),COLOR0000FF;
STICKLINE(资金流量B<0,资金流量B,0,1,0),COLORFF0000;};
DRAWRECTREL(20,570,180,540,RGB(0,75,200));
DRAWRECTREL(20,570,30,540,RGB(0,250,50));
DRAWRECTREL(20,570,15+CONST(资金流量比*150/100),540,RGB(200,50,0));
DRAWTEXT_FIX(1,0.0,0.5,0,STRCAT(STRCAT(' 【资金流量比】',CON2STR(资金流量比,2)),'%买')),COLORYELLOW;{股票指标网}
DRAWTEXT_FIX(1,5.0,0.9,0,EXTERNSTR(0,5))COLOR0000FF;
DRAWTEXT_FIX(1,0.0,0.2,0,EXTERNSTR(0,5))COLOR0000FF;
DRAWTEXT_FIX(C>0,0.004,0.11,0,STRCAT('智能诊股:',EXTERNSTR(0,2))),COLORFFFF00,LINETHICK2;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:BACKSET
该公式包含未来函数:WINNER
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:5
M1赋值:10
M2赋值:20
输出
牛熊线:(收盘价的30日指数移动平均+收盘价的72日指数移动平均)/2,LINETHICK2,画红色
当满足条件ISLASTBAR时,在牛熊线和'牛熊线'位置书写文字
输出
M5:收盘价的N日简单移动平均,画白色,LINETHICK0
M10:收盘价的M1日简单移动平均,画黄色
M20:收盘价的M2日简单移动平均,COLORFF00FF
如果收盘价>OPEN返回收盘价否则返回OPEN
VAR2赋值:收盘价的5日平滑移动平均
{股票指标网}
VAR3赋值:ATAN((VAR2/1日前的VAR2-1)*100)
如果VAR3>0返回VAR3否则返回VAR3
VAR5赋值:(收盘价/1日前的收盘价-1)*100
VAR6赋值:VAR5<1.5 AND VAR5>-1.5
输出
强势:IF(VAR4>=1日前的VAR4 AND VAR4>=0,M10,DRAWNULL),画红色,LINETHICK4
输出
整理:IF(VAR4<1日前的VAR4 AND VAR4>0,M10,DRAWNULL),COLORGREEN,LINETHICK4
A1赋值:8日前的H=2*8+1日内H最高值
B1赋值:A1的8过滤
C1赋值:BACKSET(B1,8+1)
D1赋值:C1的8过滤
{高点}
R11赋值:BACKSET(ISLASTBAR,上次D1距今天数+1)
S11赋值:R11>1日前的R11
DRAWLINE(D1,H,S11,H,1),画白色
A2赋值:8日前的L=2*8+1日内L最低值
B2赋值:A2的8过滤
C2赋值:BACKSET(B2,8+1)
D2赋值:C2的8过滤
{低点}
AA05赋值:C的5日简单移动平均,COLOR0099CC
五日乖离率赋值:(C-AA05)/AA05*100
BB05赋值:ATAN((AA05/1日前的AA05-1)*100)*180/3.1416
速度5赋值:SMA(EMA((AA05-1日前的AA05)/1日前的AA05,3)*100,3,1)
输出
加速度5:EMA((速度5-1日前的速度5),3),NODRAW
AA10赋值:C的10日简单移动平均
AA20赋值:C的20日简单移动平均
BB10赋值:ATAN((AA10/1日前的AA10-1)*100)*180/3.1416
AA30赋值:C的30日简单移动平均
三拾日乖离率赋值:(C-AA30)/AA30*100
VAR11:=(AA20-AA30)>REF((AA20-AA30),1)
AND AA20>REF(AA20,1) AND AA30>REF(AA30,1)
VAR22:=(AA30-AA20)
AA30
BB30赋值:ATAN((AA30/1日前的AA30-1)*100)*180/3.1416
强势狙击:=FILTER(BB30>30 AND BB10>45 AND
BB05上穿60,10)
加仓赋值:FILTER(统计5日满足BB05上穿30的天数>=1 AND
AA05>1日前的AA05 AND 三拾日乖离率>1日前的三拾日乖离率 AND
AA10>1日前的AA10
AND 加速度5>1日前的加速度5 AND 速度5>1日前的速度5 ,10)
清仓赋值:FILTER(统计5日满足30上穿BB05的天数>=1 AND (C>AA30 OR O>AA30) AND
AA05<1日前的AA05 AND 三拾日乖离率<1日前的三拾日乖离率 AND
AA10<1日前的AA10,10)
当满足条件加仓 时,在最低价*0.99和23之间画图标
当满足条件清仓 时,在最高价*1.01和15之间画图标
当满足条件强势狙击 时,在最低价*0.99和13之间画图标
HH0赋值:N日内H最高值
LL0赋值:N日内L最低值
MM0赋值:CONST((HH0+LL0)*0.5)
S01赋值:CONST(IF(N-15日前的C>MM0,1.00,-0.04))
S02赋值:CONST(IF(N-15日前的C>MM0,-1,1))
S1赋值:IF(FINDSTR(EXTERNSTR(0,13),'万元'),S01+(0.04*S02),S01)
S2赋值:IF(FINDSTR(EXTERNSTR(0,12),'。'),S1+(0.04*S02),S1)
S3赋值:IF(FINDSTR(EXTERNSTR(0,8),'公告'),S2+(0.04*S02),S2)
S4赋值:IF(FINDSTR(EXTERNSTR(0,10),','),S3+(0.04*S02),S3)
S5赋值:IF(FINDSTR(EXTERNSTR(0,15),'-'),S4+(0.04*S02),S4)
S6赋值:IF(FINDSTR(EXTERNSTR(0,1),','),S5+(0.04*S02),S5)
S7赋值:IF(FINDSTR(EXTERNSTR(0,14),'-'),S6+(0.04*S02),S6)
S8赋值:IF(FINDSTR(EXTERNSTR(0,11),'-'),S7+(0.04*S02),S7)
S9赋值:IF(FINDSTR(EXTERNSTR(0,9),'-'),S8+(0.04*S02),S8)
M赋值:13
{股票指标网}
M3:收盘价的3日简单移动平均,画红色,LINETHICK
M13:收盘价的13日简单移动平均,画红色,LINETHICK
M34:收盘价的34日简单移动平均,画红色,LINETHICK
X赋值:上次REF(CROSS(C,C的120日简单移动平均距今天数,1)) AND CROSS(C的20日简单移动平均,C的120日简单移动平均)
IF(M34<1日前的M34,M34,DRAWNULL),COLORGREEN,LINETHICK
STICKLINE(M3>=M13 AND M34>=1日前的M34 ,H ,L ,0.1 ,0 ),画红色
STICKLINE(M3>=M13 AND M34>=1日前的M34 AND C>=O ,O ,C ,3 ,1 ),画红色
STICKLINE(M3>=M13 AND M34>=1日前的M34 AND C
STICKLINE(M3=1日前的M34 ,H ,L ,0.1 ,0 ),画黄色
STICKLINE(M3=1日前的M34 AND C>=O ,O ,C ,3 ,1 ),画黄色
STICKLINE(M3=1日前的M34 AND C
STICKLINE(M3
STICKLINE(M3=O ,O ,C ,3 ,1 ),COLORGREEN
STICKLINE(M3
STICKLINE(M3>=M13 AND M34<1日前的M34 ,H ,L ,0.1 ,0 ),COLORMAGENTA
STICKLINE(M3>=M13 AND M34<1日前的M34 AND C>=O ,O ,C ,3 ,1 ),COLORMAGENTA
STICKLINE(M3>=M13 AND M34<1日前的M34 AND C
STICKLINE(ISLASTBAR,5日内C最高值,5日内C最高值,218,1)画红色
STICKLINE(ISLASTBAR,5日内C最高值*0.95,5日内C最高值*0.95,218,1)画红色
Z1赋值:STRCAT(HYBLOCK,' ')
Z2赋值:STRCAT(Z1,DYBLOCK)
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(ISLASTBAR,1,1.1,8,STRCAT(Z3,GNBLOCK)),COLORFFFF80
当满足条件1时,在横轴0.8纵轴0.8位置书写文字
DRAWNUMBER_FIX(1,0.9,0.8,0,CONST(C计算的获利盘比例*100))
AA赋值:(1日前的收盘价+2日前的收盘价+OPEN)/3
当满足条件CURRBARSCOUNT=1时,在横轴0.9纵轴0.9位置书写文字
当满足条件CURRBARSCOUNT=1时,在横轴0.95纵轴0.9位置书写数字
当满足条件CURRBARSCOUNT=1时,在横轴0.96纵轴0.9位置书写文字
输出
线断走人:IF(ZIG(MA((H+L)/2,3),3)>REF(ZIG(MA((H+L)/2,3),3),1),ZIG(MA((H+L)/2,3),3),DRAWNULL),画黄色,LINETHICK2
当满足条件1时,在横轴0.32纵轴2位置书写文字
DRAWRECTREL(0,480,205,589,RGB(10,1,30))
资金流入赋值:SUM(IF(C>1日前的C,V,0),FROMOPEN),NODRAW
资金流出赋值:-SUM(IF(C<1日前的C,V,0),FROMOPEN),NODRAW
资金出入赋值:资金流入+资金流出,NODRAW
DRAWBAND(资金出入,RGB(150,0,150),0,RGB(0,100,0)),NODRAW
输出
资金流量:资金出入,NODRAW
输出
资金比:资金出入/FROMOPEN的V日累和*100,NODRAW
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-(资金比-100的绝对值/2)),NODRAW
攻击量赋值:((HSL*0.50+1日前的HSL*0.33)+(2日前的HSL*0.17))*FROMOPEN的C日累和/FROMOPEN,NODRAW
攻击量A:=SUM(IF(C>1日前的C,攻击量*V,0),FROMOPEN),NODRAW
攻击量B:=-SUM(IF(C<1日前的C,攻击量*V,0),FROMOPEN),NODRAW
输出
攻击流量:攻击量A+攻击量B,NODRAW
NOTEXT攻击线:攻击流量,NODRAW
输出
攻击比:攻击流量/FROMOPEN的V日累和*100,画红色,NODRAW
资金攻击度赋值:IF(攻击比>=0,(攻击比+50),100-(攻击比-50的绝对值))
当满足条件资金流量A>0时,在资金流量A和0之间画柱状线
当满足条件资金流量B<0时,在资金流量B和0之间画柱状线
}
DRAWRECTREL(20,570,180,540,RGB(0,75,200))
DRAWRECTREL(20,570,30,540,RGB(0,250,50))
DRAWRECTREL(20,570,15+CONST(资金流量比*150/100),540,RGB(200,50,0))
DRAWTEXT_FIX(1,0.0,0.5,0,STRCAT(STRCAT(' 【资金流量比】',CON2STR(资金流量比,2)),'%买')),画黄色
{股票指标网}
DRAWTEXT_FIX(1,5.0,0.9,0,EXTERNSTR(0,5))COLOR0000FF
DRAWTEXT_FIX(1,0.0,0.2,0,EXTERNSTR(0,5))COLOR0000FF
DRAWTEXT_FIX(C>0,0.004,0.11,0,STRCAT('智能诊股:',EXTERNSTR(0,2))),COLORFFFF00,LINETHICK2