通达信定龙主图指标 判定龙头 源码
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT('[行业]-',HYBLOCK),STRCAT(' [地域]-',DYBLOCK)),STRCAT(' [概念]-',GNBLOCK)));
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');
上市天数:=STRCAT(' 上市天数: ',CON2STR(FINANCE(42),0));
股本市值:=STRCAT('股本市值: ',STRCAT(总股本,市值));
{主图显示}
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,所属板块),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.12,0,股本市值),COLORGREEN;
ZT:=C/REF(C,1)>1.0982 AND C=H;
STICKLINE(ZT,O,C,2,0),COLORRED;
DT:=C/REF(C,1)<0.913 AND C=L;
STICKLINE(DT,O,C,2,0),COLORLIGREEN;
MA5Z:=MA(C,5);MA10Z:=MA(C,10);MA20Z:=MA(C,20);MA30Z:=MA(C,30);
G5:=(C-MA5Z)/MA5Z*100;BB5:=ATAN((MA5Z/REF(MA5Z,1)-1)*100)*180/3.1416;
EW:=SMA(EMA((MA5Z-REF(MA5Z,1))/REF(MA5Z,1),3)*100,3,1);GY:=EMA((EW-REF(EW,1)),3);
G3:=(C-MA30Z)/MA30Z*100;BB30:=ATAN((MA30Z/REF(MA30Z,1)-1)*100)*180/3.1416;
TTBV:=MAX(ABS(HIGH-AMOUNT/VOL/100),ABS(AMOUNT/VOL/100-LOW));
TTYH:=ABS((OPEN+CLOSE)/2-AMOUNT/VOL/100);MV:=(TTBV+TTYH)/AMOUNT*VOL*100*50;
龙脉:MA(REF(HHV(C,30),1),2),COLORFFFFFF,LINETHICK4;
P:=6;
P1:=8;
M:=2;
M1:=3;
NZ:=11;
{=================多空布林=================}
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,COLORBLACK,LINETHICK1;
UPR:=BBI+P*STD(BBI,NZ),COLORCYAN,LINETHICK1;
DWN:=BBI-P*STD(BBI,NZ),COLORBLUE;
MA1:=MA(CLOSE,P1),COLORRED,LINETHICK1;
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,42);
指导线:=EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2),COLORYELLOW,LINETHICK1;
界: MA(CLOSE,27),COLORMAGENTA,LINETHICK3;
BU:=CROSS(指导线,界);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
AAA:=(DIF-DEA)*2;
ZT1:=C>=REF(C,1)*1.097 ;
起爆:=AAA>=2*REF(AAA,1) AND ZT1 AND ABS(AAA)<=1 AND C>MA(C,20) AND C<MA(C,20)*1.2 ;
DRAWTEXT(起爆,L*0.99,'↖暴涨'),COLORYELLOW,LINETHICK3;
VAR1:=EMA(EMA(EMA((CLOSE*6+LOW*2+HIGH+OPEN)/10,M),M),M);
短线:= VAR1-REF(VAR1,1)+VAR1;
中短:= MA(短线,M1);
{=================量柱=================}
TJ:=VOL>=REF(V,1)*1.91 AND C>REF(C,1)*1.01;
DRAWTEXT(TJ,LOW*1.1,'量'),COLORMAGENTA ;
K1:=SUMBARS(TJ,1);
{================走强线 ================};
HM1:=ABS(((3.48*CLOSE+HIGH+LOW)/4-EMA(CLOSE,20))/EMA(CLOSE,20));
HM2:=DMA(((2.15*CLOSE+LOW+HIGH)/4),HM1);
{=================必升=================};
VAR3AA:=IF((CLOSE>REF(CLOSE,1)),88,0);
VAR4AA:=IF(((CLOSE)/(REF(CLOSE,1))>1.05) AND ((HIGH)/(CLOSE)<1.01) AND (VAR3AA>0),91,0);
DRAWTEXT(FILTER((VAR4AA>90),45),(LOW)*(0.90),'波段开始 '),COLORMAGENTA;
DRAWTEXT(FILTER((VAR4AA>90),35),(LOW)*(0.8),'强势拉升'),COLOR00FFFF;
{============操作线:分水岭================}
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
分水岭:=IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORFF00FF,NODRAW;
操作线:分水岭-(EMA(C,3)-分水岭),COLORFF8000 ,LINETHICK3;
DRAWTEXT(ISLASTBAR,操作线,' ←拐点线'),COLORGREEN;
{========超级主升==========}
VAR4:=(((((REF(C,1)) * (1.1)) - C) < (0.01)) AND (H = C));
E5:=(EMA(C,5));
R:=(20 * H + 19 * (REF(H,1)) + 18 * (REF(H,2)) + 17 * (REF(H,3)));
R1:=16*(REF(H,4)) +15*(REF(H,5))+14 * (REF(H,6)) + 13 * (REF(H,7));
R2:=12*(REF(H,8))+11*(REF(H,9))+10 * (REF(H,10)) + 9 * (REF(H,11));
R3:=8 * (REF(H,12)) + 7 * (REF(H,13)) +6*(REF(H,14))+5*(REF(H,15));
R4:=4 * (REF(H,16)) + 3 * (REF(H,17)) +2 * (REF(H,18)) + REF(H,20);
VAR5:=(R+R1+R2+R3+R4)/(210);
VAR6:=(EMA(VAR5,90));
DOWN:=OPEN>CLOSE;
F:=COUNT(DOWN,6)=6;
AD:=COUNT(C<REF(C,1) ,6)=6;
BB:=(C<MA(C,30)*0.9);
E:=F AND AD AND BB;
AA:="MACD.DEA"(12,26,9)<=0.6;
ZT4:=C>=REF(C,1)*1.099 AND C< MA(C,20)*1.15 AND C>MA(C,20) AND "MACD.DEA"(12,26,9)<=0.3 AND"MACD.DEA"(12,26,9)>=0;
ZT3:=C>=REF(C,1)*1.099 AND C< MA(C,20)*1.16 AND C>MA(C,20) AND AA AND C>=HHV(C,20) { AND V>REF(V,1)*1.3 } ;
DRAWTEXT(ZT4 ,L*0.80,'C级起暴点');
DRAWTEXT(ZT3,L*0.95,'A级起暴点');
走强线:EMA(HM2,200)*1.118 ,LINETHICK3,COLORRED;
DRAWTEXT(ISLASTBAR,走强线,' ←走强线'),COLORRED;
妖股线:(VAR6 + (((C - (VAR6)) * C) - (VAR6)) / (VAR6)),COLORYELLOW,LINETHICK2;
VAR8:=(CROSS(妖股线,E5));
DRAWTEXT((VAR8) AND (VAR4),L,'↖后市有牛'),LINETHICK3,COLORRED ;
STICKLINE(C=ZTPRICE(REF(C,1),0.1) OR C=ZTPRICE(REF(C,1),0.2) AND L<>H ,O,C,3,1),COLORMAGENTA;
STICKLINE((H=ZTPRICE(REF(C,1),0.1) OR H=ZTPRICE(REF(C,1),0.2)) AND C<>H ,O,C,3,0),,COLORBROWN;
白龙:= MA(CLOSE,125);
强弱分界:= 白龙+2*STD(CLOSE,170),COLORGREEN,LINETHICK2;
紫龙:= 白龙-2*STD(CLOSE,145);
青龙: SAR(125,1,7), LINESTICK,COLORGREEN,LINETHICK1;
VAR2:=HHV(HIGH,120),NODRAW;
VAR3:=HHV(HIGH,40);
白龙40快线: VAR3*0.91,COLORMAGENTA,LINETHICK2;
红龙120慢线: VAR2*0.88,COLORLIBLUE,LINETHICK2;
{DRAWICON(CROSS(白龙40快线,强弱分界),C*0.94,27);}
DRAWTEXT_FIX(ISLASTBAR,0.01,0.01,0,EXTERNSTR(0,888)),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.01,0.07,0,EXTERNSTR(0,4442)),COLORLIRED;
N:=8;
DRAWNUMBER((C-REF(C,1))/REF(C,1)>0.05 AND L<>H,H,ROUND((C-REF(C,1))/REF(C,1)*100)),COLORYELLOW;
HLC:=REF(MA((HIGH+LOW+CLOSE)/3,N),1);
HV:=EMA(HHV(HIGH,N),3);
LV:=EMA(LLV(LOW,N),3);
STOR:=EMA(2*HV-LV,3);
强势线:=EMA(HLC+HV-LV,3),COLORMAGENTA;
ENE上轨:=(1+6/100)*MA(CLOSE,8),COLORYELLOW;{////////////////};
DRAWNUMBER((C-REF(C,1))/REF(C,1)>0.05 AND L<>H,H,ROUND((C-REF(C,1))/REF(C,1)*100)),COLORWHITE;
CV:=CLOSE;
BBIBOLL:=(MA(CV,3)+MA(CV,6)+MA(CV,12)+MA(CV,24))/4;
BBIBOLL上轨:=BBIBOLL+4*STD(BBIBOLL,11),COLORWHITE,LINETHICK2;
BBIBOLL下轨:=BBIBOLL-4*STD(BBIBOLL,10),COLORCYAN;
ENE上轨1:=(1+6/100)*MA(CLOSE,8),COLORYELLOW,LINETHICK2;
ENE下轨:=(1-6/100)*MA(CLOSE,8),COLORMAGENTA;
MA60:=MA(C,60),COLORGREEN;
MA5:=MA(C,5),COLORWHITE;
MA10:=MA(C,10),COLORYELLOW;
MA20:=MA(C,20),COLORLIMAGENTA;
A6:=CROSS(妖股线,操作线) AND CROSS(妖股线,界) AND C/REF(C,1)>1.05;
DRAWICON(A6,L,9);
A7:=CROSS(妖股线,操作线) AND CROSS(妖股线,界) AND CROSS(妖股线,青龙);
DRAWICON(A7,L*0.96,25);
A8:=CROSS(妖股线,龙脉) AND CROSS(妖股线,白龙40快线) AND CROSS(妖股线,红龙120慢线);
DRAWICON(A8,L*0.93,26);
A9:=妖股线>白龙40快线 AND 白龙40快线>红龙120慢线 AND 红龙120慢线>龙脉;
A10:=BARSLASTCOUNT(A9)=1;
DRAWICON(A10,L,33);
DRAWICON(走强线>操作线 AND (CROSS(界,走强线) OR 走强线=界),H*1.1,32);
DRAWTEXT(走强线>操作线 AND (CROSS(界,走强线) OR 走强线=界),H*1.15,'龙头'),COLORRED;
DRAWICON(走强线<界 AND CROSS(操作线,走强线),H*1.1,2);
DRAWICON(走强线<界 AND CROSS(操作线,界),H*1.1,2);
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT('[行业]-',HYBLOCK),STRCAT(' [地域]-',DYBLOCK)),STRCAT(' [概念]-',GNBLOCK)))
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿')
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿')
上市天数:=STRCAT(' 上市天数: ',CON2STR(FINANCE(42),0))
股本市值:=STRCAT('股本市值: ',STRCAT(总股本,市值))
当满足条件ISLASTBAR时,在横轴0.005纵轴0.06位置书写文字
当满足条件ISLASTBAR时,在横轴0.005纵轴0.12位置书写文字
ZT赋值:C/1日前的C>1.0982 AND C=H
当满足条件ZT时,在O和C之间画柱状线
DT赋值:C/1日前的C<0.913 AND C=L
当满足条件DT时,在O和C之间画柱状线
MA5Z赋值:C的5日简单移动平均
MA10Z赋值:C的10日简单移动平均
MA20Z赋值:C的20日简单移动平均
MA30Z赋值:C的30日简单移动平均
G5赋值:(C-MA5Z)/MA5Z*100
BB5赋值:ATAN((MA5Z/1日前的MA5Z-1)*100)*180/3.1416
EW赋值:SMA(525790788786619149MA((MA5Z-1日前的MA5Z)/1日前的MA5Z,3)*100,3,1)
GY赋值:525790788786619149MA((EW-1日前的EW),3)
G3赋值:(C-MA30Z)/MA30Z*100
BB30赋值:ATAN((MA30Z/1日前的MA30Z-1)*100)*180/3.1416
TTBV赋值:MAX(最高价-AMOUNT/成交量/100的绝对值,ABS(AMOUNT/成交量/100-最低价))
TTYH赋值:(OPEN+CLOSE的绝对值/2-AMOUNT/成交量/100)
MV赋值:(TTBV+TTYH)/AMOUNT*成交量*100*50
输出龙脉:MA(REF(30日内C最高值,1),2),COLORFFFFFF,LINETHICK4
P赋值:6
P1:=8
M赋值:2
M1:=3
NZ赋值:11
{=================多空布林=================}C2赋值:1日前的C
涨停赋值:IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0)
BBI赋值:(CLOSE的3日简单移动平均+CLOSE的6日简单移动平均+CLOSE的12日简单移动平均+CLOSE的24日简单移动平均)/4,COLORBLACK,LINETHICK1
UPR赋值:BBI+P*BBI的NZ估算标准差,COLORCYAN,LINETHICK1
DWN赋值:BBI-P*BBI的NZ估算标准差,COLORBLUE
MA1:=CLOSE的P1日简单移动平均,COLORRED,LINETHICK1
买线赋值:525790788786619149MAC的2日指数移动平均
卖线赋值:525790788786619149MA(SLOPE(C,21)*20+C,42)
指导线赋值:525790788786619149MA((525790788786619149MA(CLOSE,4)+525790788786619149MA(CLOSE,6)+525790788786619149MA(CLOSE,12)+525790788786619149MA(CLOSE,24))/4,2),COLORYEL最低价,LINETHICK1
输出界: CLOSE的27日简单移动平均,COLORMAGENTA,LINETHICK3
BU赋值:指导线上穿界
DIF赋值:525790788786619149MACLOSE的12日指数移动平均-525790788786619149MACLOSE的26日指数移动平均
DEA赋值:525790788786619149MADIF的9日指数移动平均
AAA赋值:(DIF-DEA)*2
ZT1:=C>=1日前的C*1.097
起爆赋值:AAA>=2*1日前的AAA AND ZT1 AND AAA的绝对值<=1 AND C>C的20日简单移动平均 AND C当满足条件起爆时,在L*0.99和'↖暴涨'位置书写文字
VAR1赋值:525790788786619149MA(525790788786619149MA(525790788786619149MA((CLOSE*6+最低价*2+最高价+OPEN)/10,M),M),M)
短线赋值: VAR1-1日前的VAR1+VAR1
中短赋值: 短线的M1日简单移动平均
{=================量柱=================}TJ赋值:成交量>=1日前的V*1.91 AND C>1日前的C*1.01
当满足条件TJ时,在最低价*1.1和'量'位置书写文字
K1赋值:TJ累加至1的天数
{================走强线 ================}
HM1:=((3.48*CLOSE+最高价+最低价的绝对值/4-525790788786619149MACLOSE的20日指数移动平均)/525790788786619149MACLOSE的20日指数移动平均)
HM2:=DMA(((2.15*CLOSE+最低价+最高价)/4),HM1)
{=================必升=================}
VAR3AA赋值:IF((CLOSE>1日前的CLOSE),88,0)
VAR4AA赋值:IF(((CLOSE)/(1日前的CLOSE)>1.05) AND ((最高价)/(CLOSE)<1.01) AND (VAR3AA>0),91,0)
DRAWTEXT(FILTER((VAR4AA>90),45),(最低价)*(0.90),'波段开始 '),COLORMAGENTA
DRAWTEXT(FILTER((VAR4AA>90),35),(最低价)*(0.8),'强势拉升'),COLOR00FFFF
{============输出操作线:分水岭================}B:=CLOSE的17日简单移动平均+CLOSE的17日简单移动平均-REF(CLOSE的17日简单移动平均,1)
分水岭赋值:IF(CLOSE的17日简单移动平均输出操作线:分水岭-(525790788786619149MAC的3日指数移动平均-分水岭),COLORFF8000 ,LINETHICK3
当满足条件ISLASTBAR时,在操作线和' ←拐点线'位置书写文字
{========超级主升==========}VAR4赋值:(((((1日前的C) * (1.1)) - C) < (0.01)) AND (H = C))
E5赋值:(525790788786619149MAC的5日指数移动平均)
R赋值:(20 * H + 19 * (1日前的H) + 18 * (2日前的H) + 17 * (3日前的H))
R1:=16*(4日前的H) +15*(5日前的H)+14 * (6日前的H) + 13 * (7日前的H)
R2:=12*(8日前的H)+11*(9日前的H)+10 * (10日前的H) + 9 * (11日前的H)
R3:=8 * (12日前的H) + 7 * (13日前的H) +6*(14日前的H)+5*(15日前的H)
R4:=4 * (16日前的H) + 3 * (17日前的H) +2 * (18日前的H) + 20日前的H
VAR5:=(R+R1+R2+R3+R4)/(210)
VAR6:=(525790788786619149MAVAR5的90日指数移动平均)
DOWN赋值:OPEN>CLOSE
F赋值:统计6日满足DOWN的天数=6
AD赋值:COUNT(C<1日前的C ,6)=6
BB赋值:(CE赋值:F AND AD AND BB
AA赋值:"MACD.DEA"(12,26,9)<=0.6
ZT4:=C>=1日前的C*1.099 AND C< C的20日简单移动平均*1.15 AND C>C的20日简单移动平均 AND "MACD.DEA"(12,26,9)<=0.3 AND"MACD.DEA"(12,26,9)>=0
ZT3:=C>=1日前的C*1.099 AND C< C的20日简单移动平均*1.16 AND C>C的20日简单移动平均 AND AA AND C>=20日内C最高值 { AND V>1日前的V*1.3 }
当满足条件ZT4 时,在L*0.80和'C级起暴点'位置书写文字
当满足条件ZT3时,在L*0.95和'A级起暴点'位置书写文字
输出走强线:525790788786619149MAHM2的200日指数移动平均*1.118 ,LINETHICK3,COLORRED
当满足条件ISLASTBAR时,在走强线和' ←走强线'位置书写文字
输出妖股线:(VAR6 + (((C - (VAR6)) * C) - (VAR6)) / (VAR6)),COLORYEL最低价,LINETHICK2
VAR8:=(妖股线上穿E5)
DRAWTEXT((VAR8) AND (VAR4),L,'↖后市有牛'),LINETHICK3,COLORRED
STICKLINE(C=ZTPRICE(1日前的C,0.1) OR C=ZTPRICE(1日前的C,0.2) AND L<>H ,O,C,3,1),COLORMAGENTA
STICKLINE((H=ZTPRICE(1日前的C,0.1) OR H=ZTPRICE(1日前的C,0.2)) AND C<>H ,O,C,3,0),,COLORBROWN
白龙赋值: CLOSE的125日简单移动平均
强弱分界赋值: 白龙+2*CLOSE的170估算标准差,COLORGREEN,LINETHICK2
紫龙赋值: 白龙-2*CLOSE的145估算标准差
输出青龙: SAR(125,1,7), LINESTICK,COLORGREEN,LINETHICK1
VAR2:=120日内最高价最高值,NODRAW
VAR3:=40日内最高价最高值
白龙40快线: VAR3*0.91,COLORMAGENTA,LINETHICK2
输出红龙120慢线: VAR2*0.88,COLORLIBLUE,LINETHICK2
{DRAWICON(白龙40快线上穿强弱分界,C*0.94,27)
}DRAWTEXT_FIX(ISLASTBAR,0.01,0.01,0,EXTERNSTR(0,888)),COLORYEL最低价
DRAWTEXT_FIX(ISLASTBAR,0.01,0.07,0,EXTERNSTR(0,4442)),COLORLIRED
N赋值:8
DRAWNUMBER((C-1日前的C)/1日前的C>0.05 AND L<>H,H,ROUND((C-1日前的C)/1日前的C*100)),COLORYEL最低价
HLC赋值:REF(MA((最高价+最低价+CLOSE)/3,N),1)
HV赋值:EN日内最高价最高值的3日简单移动平均
LV赋值:EN日内最低价最低值的3日简单移动平均
STOR赋值:525790788786619149MA2*HV-LV的3日指数移动平均
强势线赋值:525790788786619149MAHLC+HV-LV的3日指数移动平均,COLORMAGENTA
ENE上轨:=(1+6/100)*CLOSE的8日简单移动平均,COLORYEL最低价
{////////////////}
DRAWNUMBER((C-1日前的C)/1日前的C>0.05 AND L<>H,H,ROUND((C-1日前的C)/1日前的C*100)),COLORWHITE
CV赋值:CLOSE
BBIBOLL:=(CV的3日简单移动平均+CV的6日简单移动平均+CV的12日简单移动平均+CV的24日简单移动平均)/4
BBIBOLL上轨:=BBIBOLL+4*BBIBOLL的11估算标准差,COLORWHITE,LINETHICK2
BBIBOLL下轨:=BBIBOLL-4*BBIBOLL的10估算标准差,COLORCYAN
ENE上轨1:=(1+6/100)*CLOSE的8日简单移动平均,COLORYEL最低价,LINETHICK2
ENE下轨:=(1-6/100)*CLOSE的8日简单移动平均,COLORMAGENTA
MA60:=C的60日简单移动平均,COLORGREEN
MA5:=C的5日简单移动平均,COLORWHITE
MA10赋值:C的10日简单移动平均,COLORYEL最低价
MA20:=C的20日简单移动平均,COLORLIMAGENTA
A6赋值:妖股线上穿操作线 AND 妖股线上穿界 AND C/1日前的C>1.05
当满足条件A6时,在L和9之间画图标
A7赋值:妖股线上穿操作线 AND 妖股线上穿界 AND 妖股线上穿青龙
当满足条件A7时,在L*0.96和25之间画图标
A8赋值:妖股线上穿龙脉 AND 妖股线上穿白龙40快线 AND 妖股线上穿红龙120慢线
当满足条件A8时,在L*0.93和26之间画图标
A9赋值:妖股线>白龙40快线 AND 白龙40快线>红龙120慢线 AND 红龙120慢线>龙脉
A10赋值:BARSLASTCOUNT(A9)=1
当满足条件A10时,在L和33之间画图标
DRAWICON(走强线>操作线 AND (界上穿走强线 OR 走强线=界),H*1.1,32)
DRAWTEXT(走强线>操作线 AND (界上穿走强线 OR 走强线=界),H*1.15,'龙头'),COLORRED
DRAWICON(走强线<界 AND 操作线上穿走强线,H*1.1,2)
DRAWICON(走强线<界 AND 操作线上穿界,H*1.1,2)