通达信【主力痕迹】分时主图指标 源码分享
DRAWTEXT_FIX(1,0.00,0.00,0,STRCAT(STRCAT(STRCAT(STRCAT(HYBLOCK,'__'),GNBLOCK),'__'),DYBLOCK)),COLORLIBLUE;
ABC股:=NAMEINCLUDE('ST');
涨停倍率:=IF(FINANCE(3)=2,0.3,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,0.2,0.1));
涨停价:=ZTPRICE(REF(CLOSE,1),IF(ABC股,0.05,涨停倍率));
跌停价:=DTPRICE(REF(CLOSE,1),IF(ABC股,0.05,涨停倍率));
AT:=REF(C,BARSLAST(DAY!=REF(DAY,1)));
AT1:=DYNAINFO(4);
AT2:=AT-AT1;
D:=DYNAINFO(20);
SPEED:=AT2/AT1*100;
好股网6:=STRCAT('【主力值】',CON2STR(SPEED,2));
DRAWTEXT_FIX(ISLASTBAR AND SPEED< 2 AND SPEED>0.432,0.38,0.85,0,好股网6),COLOR00FFFF;
DRAWTEXT_FIX(ISLASTBAR AND SPEED>=2.0,0.38,0.85,0,好股网6),COLOR0000FF;
ABC1:=BARSLAST(DATE!=REF(DATE,1));
ABC2:=DYNAINFO(3);
ABC3:=(CLOSE/ABC2-1)*100;
ABC4:=CROSS(ABC3,5) OR CROSS(ABC3,7) OR CROSS(ABC3,9);
指标:=HHVBARS(CLOSE,ABC1)=0 AND ABC4;
DRAWICON(指标,CLOSE,38);
正偏差:=IF(NAMELIKE('ST') OR NAMELIKE('*'),4.8,IF(FINANCE(3)=2,28.8,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,19.2,9.6)));
负偏差:=IF(NAMELIKE('ST') OR NAMELIKE('*'),-4.8,IF(FINANCE(3)=2,-28.8,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,-19.2,-9.6)));
ABCA:=IF(ABC股,1.0432,IF(FINANCE(3)=2,1.2592,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),1.1728,1.0864)));
ABCB:=IF(ABC股,1.0216,IF(FINANCE(3)=2,1.1296,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),1.0864,1.0432)));
ABCC:=IF(ABC股,0.9784,IF(FINANCE(3)=2,0.8704,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),0.9136,0.9568)));
ABCD:=IF(ABC股,0.9568,IF(FINANCE(3)=2,0.7048,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),0.8272,0.9136)));
现价:=CLOSE;
均价:=SUM(CLOSE*VOL,240)/SUM(VOL,240);
量价齐升:=HHV(V,0)>REF(EMA(HHV(V,0),5),1) AND CLOSE>REF(EMA(CLOSE,7),1);
EMA7:EMA(CLOSE,7),COLORRED,DOTLINE;
ABC05:IF(EMA7< REF(EMA7,1) AND CLOSE<=EMA7,EMA7,DRAWNULL),COLORFFA800;
ABC06:IF(HHV(V,0)>REF(EMA(HHV(V,0),5),1) AND CLOSE>REF(EMA(CLOSE,7),1) AND BETWEEN(TIME,0930,1030),EMA7,DRAWNULL),COLORMAGENTA,LINETHICK2;
ABC07:IF(HHV(V,0)>REF(EMA(HHV(V,0),5),1) AND CLOSE>REF(EMA(CLOSE,7),1) AND BETWEEN(TIME,1030,1130),EMA7,DRAWNULL),COLORRED,LINETHICK2;
EMA2:=EMA(CLOSE,26);
SWS:=DMA(EMA(CLOSE,26),MAX(1,100*(SUM(VOL,5)/(3*CAPITAL))));
EMA26:IF(CODELIKE('11') OR CODELIKE('12'),EMA2,SWS),COLORGREEN,DOTLINE;
DRAWTEXT(ISLASTBAR,EMA26*1.005,VARCAT(VAR2STR(EMA26,2),'←支撑')),COLORGREEN;
ABC08:IF(EMA26< REF(EMA26,1) AND CLOSE<=EMA26,EMA26,DRAWNULL),COLOR9B6C00;
支撑有效:BARSLASTCOUNT(EMA26>=REF(EMA26,1))>=2 AND CLOSE>EMA26 AND 均价>=REF(均价,1),COLORYELLOW,NODRAW;
突破有效:EMA26>=REF(EMA26,1) AND EMA7>=REF(EMA7,1) AND CLOSE>=MAX(EMA7,EMA26) AND 均价>=REF(均价,1) AND 量价齐升,COLORRED,NODRAW;
DRAWICON(FILTER(CROSS(支撑有效,0.5),7),EMA26,42);
DRAWICON(FILTER(CROSS(突破有效,0.5),7),EMA7,1);
管住手:(EMA7< REF(EMA7,1) AND CLOSE<=EMA7) OR (EMA26< REF(EMA26,1) AND CLOSE<=EMA26),COLORFF8000,NODRAW;
好股网:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(V*100,BARSCOUNT(CLOSE));
主力:=EXPMA(CLOSE/好股网,20);
大户:=EXPMA(CLOSE/好股网,60);
散户:=EXPMA(CLOSE/好股网,120);
主力来了:=主力>大户 AND 大户>散户 AND C>EXPMA(C,20) AND EXPMA(C,10)>EXPMA(C,20) AND EXPMA(C,20)>EXPMA(C,60) AND 主力=HHV(主力,30) AND CROSS(主力,1.003);
DRAWICON(主力来了,C,9);
DRAWTEXT(主力来了,C,'←主力'),COLORYELLOW;
DIF12:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA12:=EMA(DIF12,9);
MACD12:=(DIF12-DEA12)*2;
AA0:=MACD12>00 AND DIF12>0 AND DEA12>0;
NX:=MA(((SLOPE(C,20)*5)+C),10);
A100:=HOUR=10 AND MINUTE=0;
A20:=HHV(H,30);
A30:=BARSLAST(A100);
A40:=REF(A20,A30);
A50:=CONST(A40);
A80:=CLOSE>A50 AND REF(C<=A50,1) AND CLOSE>NX;
AB:=FILTER(A80,100);
A90:=DYNAINFO(3);
AC:=CLOSE<=A90*1.04 AND CLOSE>A90;
量比:=V/REF(MA(V,5),1);
捉牛:=AA0 AND AB AND AC AND A40>A90 AND 量比>=1;
DRAWICON(捉牛,A50,38);
DRAWTEXT(捉牛,C*0.998,'←牛'),COLORMAGENTA;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:DYNAINFO
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DRAWTEXT_FIX(1,0.00,0.00,0,STRCAT(STRCAT(STRCAT(STRCAT(HYBLOCK,'__'),GNBLOCK),'__'),DYBLOCK)),COLORLIBLUE
ABC股赋值:NAMEINCLUDE('ST')
涨停倍率赋值:IF(FINANCE(3)=2,0.3,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,0.2,0.1))
如果ABC股返回0.05否则返回涨停倍率
如果ABC股返回0.05否则返回涨停倍率
AT赋值:REF(C,上次DAY!=REF(DAY,1距今天数))
AT1:=DYNAINFO(4)
AT2:=AT-AT1
D赋值:DYNAINFO(20)
SPEED赋值:AT2/AT1*100
好股网6赋值:STRCAT('【主力值】',CON2STR(SPEED,2))
当满足条件ISLASTBAR AND SPEED< 2 AND SPEED>0.432时,在横轴0.38纵轴0.85位置书写文字
当满足条件ISLASTBAR AND SPEED>=2.0时,在横轴0.38纵轴0.85位置书写文字
ABC1赋值:上次DATE!=1日前的DATE距今天数
ABC2赋值:DYNAINFO(3)
ABC3赋值:(收盘价/ABC2-1)*100
ABC4赋值:ABC3上穿5 OR ABC3上穿7 OR ABC3上穿9
指标赋值:HHVBARS(收盘价,ABC1)=0 AND ABC4
当满足条件指标时,在收盘价和38之间画图标
正偏差赋值:IF(NAMELIKE('ST') OR NAMELIKE('*'),4.8,IF(FINANCE(3)=2,28.8,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,19.2,9.6)))
负偏差赋值:IF(NAMELIKE('ST') OR NAMELIKE('*'),-4.8,IF(FINANCE(3)=2,-28.8,IF(FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6,-19.2,-9.6)))
ABCA赋值:IF(ABC股,1.0432,IF(FINANCE(3)=2,1.2592,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),1.1728,1.0864)))
ABCB赋值:IF(ABC股,1.0216,IF(FINANCE(3)=2,1.1296,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),1.0864,1.0432)))
ABCC赋值:IF(ABC股,0.9784,IF(FINANCE(3)=2,0.8704,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),0.9136,0.9568)))
ABCD赋值:IF(ABC股,0.9568,IF(FINANCE(3)=2,0.7048,IF((FINANCE(3)=3 OR FINANCE(3)=4 OR FINANCE(3)=6),0.8272,0.9136)))
现价赋值:收盘价
均价赋值:240的收盘价*成交量日累和/240的成交量日累和
量价齐升赋值:0日内V最高值>REF(E0日内V最高值的5日简单移动平均,1) AND 收盘价>REF(E收盘价的7日简单移动平均,1)
输出EMA7:收盘价的7日指数移动平均,COLORRED,DOTLINE
输出ABC05:IF(EMA7< 1日前的EMA7 AND 收盘价<=EMA7,EMA7,DRAWNULL),COLORFFA800
输出ABC06:IF(0日内V最高值>REF(E0日内V最高值的5日简单移动平均,1) AND 收盘价>REF(E收盘价的7日简单移动平均,1) AND BETWEEN(TIME,0930,1030),EMA7,DRAWNULL),画洋红色, 线宽为2
输出ABC07:IF(0日内V最高值>REF(E0日内V最高值的5日简单移动平均,1) AND 收盘价>REF(E收盘价的7日简单移动平均,1) AND BETWEEN(TIME,1030,1130),EMA7,DRAWNULL),COLORRED, 线宽为2
EMA2赋值:收盘价的26日指数移动平均
SWS赋值:DMA(收盘价的26日指数移动平均,MAX(1,100*(5的成交量日累和/(3*当前流通股本))))
EMA26:IF(CODELIKE('11') OR CODELIKE('12'),EMA2,SWS),画绿色,DOTLINE
DRAWTEXT(ISLASTBAR,EMA26*1.005,VARCAT(VAR2STR(EMA26,2),'←支撑')),画绿色
输出ABC08:IF(EMA26< 1日前的EMA26 AND 收盘价<=EMA26,EMA26,DRAWNULL),COLOR9B6C00
输出支撑有效:BARSLASTCOUNT(EMA26>=1日前的EMA26)>=2 AND 收盘价>EMA26 AND 均价>=1日前的均价,画黄色,NODRAW
输出突破有效:EMA26>=1日前的EMA26 AND EMA7>=1日前的EMA7 AND 收盘价>=EMA7和EMA26较大值 AND 均价>=1日前的均价 AND 量价齐升,COLORRED,NODRAW
DRAWICON(FILTER(支撑有效上穿0.5,7),EMA26,42)
DRAWICON(FILTER(突破有效上穿0.5,7),EMA7,1)
输出管住手:(EMA7< 1日前的EMA7 AND 收盘价<=EMA7) OR (EMA26< 1日前的EMA26 AND 收盘价<=EMA26),COLORFF8000,NODRAW
好股网赋值:SUM(成交额,收盘价的有效数据周期数)/SUM(V*100,收盘价的有效数据周期数)
主力赋值:收盘价/好股网的20日指数移动平均
大户赋值:收盘价/好股网的60日指数移动平均
散户赋值:收盘价/好股网的120日指数移动平均
主力来了:=主力>大户 AND 大户>散户 AND C>C的20日指数移动平均 AND C的10日指数移动平均>C的20日指数移动平均 AND C的20日指数移动平均>C的60日指数移动平均 AND 主力=30日内主力最高值 AND 主力上穿1.003
当满足条件主力来了时,在C和9之间画图标
当满足条件主力来了时,在C和'←主力'位置书写文字
DIF12:=收盘价的12日指数移动平均-收盘价的26日指数移动平均
DEA12:=DIF12的9日指数移动平均
MACD12:=(DIF12-DEA12)*2
AA0赋值:MACD12>00 AND DIF12>0 AND DEA12>0
NX赋值:MA(((SLOPE(C,20)*5)+C),10)
A100赋值:HOUR=10 AND MINUTE=0
A20赋值:30日内H最高值
A30赋值:上次A100距今天数
A40赋值:A30日前的A20
A50赋值:CONST(A40)
A80赋值:收盘价>A50 AND 1日前的C<=A50 AND 收盘价>NX
AB赋值:A80的100过滤
A90赋值:DYNAINFO(3)
AC赋值:收盘价<=A90*1.04 AND 收盘价>A90
量比赋值:V/REF(V的5日简单移动平均,1)
捉牛赋值:AA0 AND AB AND AC AND A40>A90 AND 量比>=1
当满足条件捉牛时,在A50和38之间画图标
当满足条件捉牛时,在C*0.998和'←牛'位置书写文字