夜龙分时图V1通达信公式 主图 源码附图
DD1:=1;
成交额:=V*C/100,NODRAW;{万元}
A20:=SUM((IF(((成交额/8>18) AND (CLOSE>(REF(CLOSE,1)))),成交额,0)),0);
A30:=SUM((IF(((成交额/8>18) AND (CLOSE<(REF(CLOSE,1)))),成交额,0)),0);
A60:=(A20+A30);
AAA30:=STRCAT(STRCAT('机构净',CON2STR((100*(A20-A30))/A60,0)),'%');
DRAWTEXT_FIX(DD1=1,0,0.05,0,AAA30),COLORLIRED;
现价:C,COLORWHITE,LINETHICK1;
量价:=(VOL/CLOSE)/3;
A2:=SUM((IF(((量价>0.20) AND (CLOSE>(REF(CLOSE,1)))),量价,0)),0);
A3:=SUM((IF(((量价>0.20) AND (CLOSE<(REF(CLOSE,1)))),量价,0)),0);
A6:=A2+A3;比:=A2/A3;
AAA3:=STRCAT(STRCAT('差= ',CON2STR((100*(A2-A3))/A6,0)),'%');
DRAWTEXT_FIX(DD1=1,0,0.01,0,AAA3),COLORYELLOW;
DRAWTEXT_FIX(比>2,0,0.40,0,'预'),COLORLIRED;
DRAWTEXT_FIX(比>2,0,0.48,0,'涨'),COLORMAGENTA;
DRAWTEXT_FIX(比>2,0,0.56,0,'停'),COLORRED;
中期线:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4)+100;
IF((比>1.1 AND 中期线<5),C,DRAWNULL),COLORRED,LINETHICK3;
IF((比<1.1 AND 中期线>98.0),C,DRAWNULL),COLORGREEN,LINETHICK3;
均价1:=SUM(C*V,240)/SUM(V,240),COLORYELLOW;
TT:=BARSCOUNT(C);均:=MA(C,TT);
上均线:=均+2*STD(C,3);下均线:=均-2*STD(C,3);
TT1:=SUM(V*C,0)/SUM(V,0);
TT2:=TT1>C AND C<REF(C,1) AND REF(C,1)<REF(C,2) AND REF(V,1)>REF(HHV(V,25),2) AND REF(COUNT(V=HHV(V,10),3)>=1,1);
TT3:=TT1<C AND C<REF(C,1) AND REF(C,1)>REF(C,2) AND REF(V,1)>REF(HHV(V,99),2) AND V/REF(V,1)>=0.5;
V1:=MA(V,1);
C1:=MA(C,1);
H1:=C1>REF(C1,1) AND V1<REF(V1,1) AND C/均价1>(1+0.001);
H2:=C1>REF(C1,1) AND V1<REF(V1,1) AND C/均价1>(1+0.02);
H3:=C1>REF(C1,1) AND V1<REF(V1,1) AND C/均价1>(1+0.034);
L1:=C1<REF(C1,1) AND V1>REF(V1,1) AND C/均价1<(1-0.001);
L2:=C1<REF(C1,1) AND V1>REF(V1,1) AND C/均价1<(1-0.02);
L3:=C1<REF(C1,1) AND V1>REF(V1,1) AND C/均价1>(1+0.034);
IF(FILTER(H,240),C,DRAWNULL),COLORLIRED,LINETHICK3;
IF(FILTER(L,240),C,DRAWNULL),COLORGREEN,LINETHICK3;
IF(FILTER(H1,240),C,DRAWNULL),COLORLIRED,LINETHICK3;
IF(FILTER(L1,240),C,DRAWNULL),COLORCYAN,LINETHICK3;
IF(TT2,C,DRAWNULL),COLORRED,LINETHICK3;
IF(TT3,C,DRAWNULL),COLORGREEN,LINETHICK3;
VV:=CROSS(SUM(C<=REF(C,1),BARSLAST(H1))=1,0.5);
VVB:=CROSS(SUM(C>=REF(C,1),BARSLAST(L1))=1,0.5);
VV1:=CROSS(SUM(C<=REF(C,1),BARSLAST(H2))=1,0.5);
VVB1:=CROSS(SUM(C>=REF(C,1),BARSLAST(L2))=1,0.5);
VV23:=CROSS(SUM(C<=REF(C,1),BARSLAST(H3))=1,0.5);
VVB23:=CROSS(SUM(C>=REF(C,1),BARSLAST(L3))=1,0.5);
VVB2:=CROSS(SUM(VVB,0.5),0.5) ;
VV2:=CROSS(SUM(VV,0.5),0.5) ;
VAR2:CONST(SUM(IF(VVB2,REF(C,1),DRAWNULL),0)),COLORLIRED,LINETHICK1;
VAS2:CONST(SUM(IF(VV2,REF(C,1),DRAWNULL),0)),COLORCYAN,LINETHICK1;
VVB21:=CROSS(SUM(VVB1,0.5),0.5) ;
VV21:=CROSS(SUM(VV1,0.5),0.5) ;
VAR21:CONST(SUM(IF(VVB21,REF(C,1),DRAWNULL),0)),COLORLIRED,LINETHICK1;
VAS21:CONST(SUM(IF(VV21,REF(C,1),DRAWNULL),0)),COLORCYAN,LINETHICK1;
VVB22:=CROSS(SUM(VVB23,0.5),0.5) ;
VV22:=CROSS(SUM(VV23,0.5),0.5) ;
VAR22:CONST(SUM(IF(VVB22,REF(C,1),DRAWNULL),0)),COLORLIRED,LINETHICK1;
VAS22:CONST(SUM(IF(VV22,REF(C,1),DRAWNULL),0)),COLORCYAN,LINETHICK1;
VVB3:=IF(CROSS(SUM(CROSS(VVB AND C/VAR2<0.95,0.5),0),0.5) AND SUM(VVB,0)>1,1,0);
VV3:=IF(CROSS(SUM(CROSS(VV AND C/VAS2>1.05,0.5),0),0.5) AND SUM(VV,0)>1,1,0);
VAR3:CONST(SUM(IF(VVB3,REF(C,1),DRAWNULL),0)),COLORLIRED;
VAS3:CONST(SUM(IF(VV3,REF(C,1),DRAWNULL),0)),COLORCYAN;
VVB31:=IF(CROSS(SUM(CROSS(VVB1 AND C/VAR21<0.95,0.5),0),0.5) AND SUM(VVB1,0)>1,1,0);
VV31:=IF(CROSS(SUM(CROSS(VV1 AND C/VAS21>1.05,0.5),0),0.5) AND SUM(VV1,0)>1,1,0);
VAR31:CONST(SUM(IF(VVB31,REF(C,1),DRAWNULL),0)),COLORLIRED;
VAS31:CONST(SUM(IF(VV31,REF(C,1),DRAWNULL),0)),COLORCYAN;
VVB32:=IF(CROSS(SUM(CROSS(VVB2 AND C/VAR22<0.95,0.5),0),0.5) AND SUM(VVB23,0)>1,1,0);
VV32:=IF(CROSS(SUM(CROSS(VV2 AND C/VAS22>1.05,0.5),0),0.5) AND SUM(VV23,0)>1,1,0);
VAR32:CONST(SUM(IF(VVB32,REF(C,1),DRAWNULL),0)),COLORLIRED;
VAS32:CONST(SUM(IF(VV32,REF(C,1),DRAWNULL),0)),COLORCYAN;
DRAWTEXT(VVB31 AND REF(COUNT(V=HHV(V,6),5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED;
DRAWTEXT(VVB3 AND REF(COUNT(V=HHV(V,6),5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED;
DRAWTEXT(VVB21 AND REF(COUNT(V=HHV(V,6),5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED;
DRAWTEXT(VV31 ,REF(C,1)*1.003,'S'),COLORCYAN;
DRAWTEXT(VV3 ,REF(C,1)*1.003,'S'),COLORCYAN;
DRAWTEXT(VV21 ,REF(C,1)*1.003,'S'),COLORCYAN;
DRAWTEXT(VV22 ,REF(C,1)*1.003,'S'),COLORCYAN;
H11:=MAX(DYNAINFO(3),DYNAINFO(5));
L1K:=MIN(DYNAINFO(3),DYNAINFO(6));
P1K:=H11-L1;
阻力:L1K+P1K*7.7/8,NODRAW;
支撑:L1K+P1K*0.3/8,NODRAW;
STICKLINE(CROSS(支撑,现价),支撑,阻力,1,0),NODRAW;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DD1赋值:1
成交额赋值:V*C/100,NODRAW
{万元}
A20赋值:SUM((IF(((成交额/8>18) AND (收盘价>(1日前的收盘价))),成交额,0)),0)
A30赋值:SUM((IF(((成交额/8>18) AND (收盘价<(1日前的收盘价))),成交额,0)),0)
A60赋值:(A20+A30)
AAA30赋值:STRCAT(STRCAT('机构净',CON2STR((100*(A20-A30))/A60,0)),'%')
当满足条件DD1=1时,在横轴0纵轴0.05位置书写文字
输出现价:C,画白色,LINETHICK1
量价赋值:(成交量/收盘价)/3
A2赋值:SUM((IF(((量价>0.20) AND (收盘价>(1日前的收盘价))),量价,0)),0)
A3赋值:SUM((IF(((量价>0.20) AND (收盘价<(1日前的收盘价))),量价,0)),0)
A6赋值:A2+A3
比赋值:A2/A3
AAA3赋值:STRCAT(STRCAT('差= ',CON2STR((100*(A2-A3))/A6,0)),'%')
当满足条件DD1=1时,在横轴0纵轴0.01位置书写文字
当满足条件比>2时,在横轴0纵轴0.40位置书写文字
当满足条件比>2时,在横轴0纵轴0.48位置书写文字
当满足条件比>2时,在横轴0纵轴0.56位置书写文字
中期线赋值:EMA(-100*(34日内最高价最高值-收盘价)/(34日内最高价最高值-34日内最低价最低值),4)+100
IF((比>1.1 AND 中期线<5),C,DRAWNULL),画红色, 线宽为3
IF((比<1.1 AND 中期线>98.0),C,DRAWNULL),画绿色, 线宽为3
均价1赋值:240的C*V日累和/240的V日累和,画黄色
TT赋值:C的有效数据周期数
均赋值:C的TT日简单移动平均
上均线:=均+2*C的3估算标准差
下均线:=均-2*C的3估算标准差
TT1:=0的V*C日累和/0的V日累和
TT2:=TT1>C AND C<1日前的C AND 1日前的C<2日前的C AND 1日前的V>REF(25日内V最高值,2) AND REF(COUNT(V=10日内V最高值,3)>=1,1)
TT3:=TT12日前的C AND 1日前的V>REF(99日内V最高值,2) AND V/1日前的V>=0.5
V1赋值:V的1日简单移动平均
C1赋值:C的1日简单移动平均
H1赋值:C1>1日前的C1 AND V1<1日前的V1 AND C/均价1>(1+0.001)
H2赋值:C1>1日前的C1 AND V1<1日前的V1 AND C/均价1>(1+0.02)
H3赋值:C1>1日前的C1 AND V1<1日前的V1 AND C/均价1>(1+0.034)
L1赋值:C1<1日前的C1 AND V1>1日前的V1 AND C/均价1<(1-0.001)
L2赋值:C1<1日前的C1 AND V1>1日前的V1 AND C/均价1<(1-0.02)
L3赋值:C1<1日前的C1 AND V1>1日前的V1 AND C/均价1>(1+0.034)
IF(H的240过滤,C,DRAWNULL),COLORLIRED, 线宽为3
IF(L的240过滤,C,DRAWNULL),画绿色, 线宽为3
IF(H1的240过滤,C,DRAWNULL),COLORLIRED, 线宽为3
IF(L1的240过滤,C,DRAWNULL),画青色, 线宽为3
如果TT2返回C否则返回DRAWNULL
如果TT3返回C否则返回DRAWNULL
VV赋值:CROSS(SUM(C<=1日前的C,上次H1距今天数)=1,0.5)
VVB:=CROSS(SUM(C>=1日前的C,上次L1距今天数)=1,0.5)
VV1赋值:CROSS(SUM(C<=1日前的C,上次H2距今天数)=1,0.5)
VVB1:=CROSS(SUM(C>=1日前的C,上次L2距今天数)=1,0.5)
VV23:=CROSS(SUM(C<=1日前的C,上次H3距今天数)=1,0.5)
VVB23:=CROSS(SUM(C>=1日前的C,上次L3距今天数)=1,0.5)
VVB2:=CROSS(0.5的VVB日累和,0.5)
VV2:=CROSS(0.5的VV日累和,0.5)
输出VAR2:CONST(SUM(IF(VVB2,1日前的C,DRAWNULL),0)),COLORLIRED,LINETHICK1
输出VAS2:CONST(SUM(IF(VV2,1日前的C,DRAWNULL),0)),画青色,LINETHICK1
VVB21:=CROSS(0.5的VVB1日累和,0.5)
VV21:=CROSS(0.5的VV1日累和,0.5)
VAR21:CONST(SUM(IF(VVB21,1日前的C,DRAWNULL),0)),COLORLIRED,LINETHICK1
VAS21:CONST(SUM(IF(VV21,1日前的C,DRAWNULL),0)),画青色,LINETHICK1
VVB22:=CROSS(0.5的VVB23日累和,0.5)
VV22:=CROSS(0.5的VV23日累和,0.5)
VAR22:CONST(SUM(IF(VVB22,1日前的C,DRAWNULL),0)),COLORLIRED,LINETHICK1
VAS22:CONST(SUM(IF(VV22,1日前的C,DRAWNULL),0)),画青色,LINETHICK1
VVB3:=IF(CROSS(SUM(CROSS(VVB AND C/VAR2<0.95,0.5),0),0.5) AND SUM(VVB,0)>1,1,0)
VV3:=IF(CROSS(SUM(CROSS(VV AND C/VAS2>1.05,0.5),0),0.5) AND SUM(VV,0)>1,1,0)
输出VAR3:CONST(SUM(IF(VVB3,1日前的C,DRAWNULL),0)),COLORLIRED
输出VAS3:CONST(SUM(IF(VV3,1日前的C,DRAWNULL),0)),画青色
VVB31:=IF(CROSS(SUM(CROSS(VVB1 AND C/VAR21<0.95,0.5),0),0.5) AND SUM(VVB1,0)>1,1,0)
VV31:=IF(CROSS(SUM(CROSS(VV1 AND C/VAS21>1.05,0.5),0),0.5) AND SUM(VV1,0)>1,1,0)
VAR31:CONST(SUM(IF(VVB31,1日前的C,DRAWNULL),0)),COLORLIRED
VAS31:CONST(SUM(IF(VV31,1日前的C,DRAWNULL),0)),画青色
VVB32:=IF(CROSS(SUM(CROSS(VVB2 AND C/VAR22<0.95,0.5),0),0.5) AND SUM(VVB23,0)>1,1,0)
VV32:=IF(CROSS(SUM(CROSS(VV2 AND C/VAS22>1.05,0.5),0),0.5) AND SUM(VV23,0)>1,1,0)
VAR32:CONST(SUM(IF(VVB32,1日前的C,DRAWNULL),0)),COLORLIRED
VAS32:CONST(SUM(IF(VV32,1日前的C,DRAWNULL),0)),画青色
DRAWTEXT(VVB31 AND REF(COUNT(V=6日内V最高值,5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED
DRAWTEXT(VVB3 AND REF(COUNT(V=6日内V最高值,5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED
DRAWTEXT(VVB21 AND REF(COUNT(V=6日内V最高值,5)>=1,1),REF(C,1)*0.999,'B'),COLORLIRED
DRAWTEXT(VV31 ,1日前的C*1.003,'S'),画青色
DRAWTEXT(VV3 ,1日前的C*1.003,'S'),画青色
DRAWTEXT(VV21 ,1日前的C*1.003,'S'),画青色
DRAWTEXT(VV22 ,1日前的C*1.003,'S'),画青色
H11:=MAX(DYNAINFO(3),DYNAINFO(5))
L1K:=MIN(DYNAINFO(3),DYNAINFO(6))
P1K赋值:H11-L1
输出阻力:L1K+P1K*7.7/8,NODRAW
输出支撑:L1K+P1K*0.3/8,NODRAW
STICKLINE(支撑上穿现价,支撑,阻力,1,0),NODRAW