通达信【黑马启动线】主副图 站上启动线就出击 源码
{黑马启动线主图源码如下}
C2:=REF(C,1);
ZT:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
X_2:=IF(NAMELIKE(8),1,0)=0;
X_3:=IF(NAMELIKE(9),1,0)=0;
X_4:=IF(NAMELIKE(10),1,0)=0;
X_5:=IF(CODELIKE(11),1,0)=0;
X_6:=IF(CODELIKE(12),1,0)=0;
X_7:=IF(CODELIKE(13),1,0)=0;
FW:=X_2 AND X_3 AND X_4 AND X_5 AND X_6 AND X_7 ;
JZF:=(O/REF(C,1)-1)*100;
ZF:=(C/REF(C,1)-1)*100;
SYX:=100*(H-MAX(C,O))/REF(C,1);
ST:=100*ABS(C-O)/REF(C,1);
XYX:=100*(MIN(C,O)-L)/REF(C,1);
T1A:=V>2*REF(V,1) AND V=HHV(V,7) AND COUNT(ZT,10)=0 AND BARSCOUNT(C)>100;
T1:=T1A AND ST>2.8 AND C>O AND COUNT(C>O AND V>2*REF(V,1),5)=1;
T2A:=SYX< 5 AND XYX< 3 AND JZF< 3 AND V< REF(V,1) AND JZF>-3;
T2:=REF(T1,1) AND IF(ST>1,ST< 0.4*REF(ST,1) AND ST< 3,ST< 1) AND T2A;
N1:=BARSLAST(T2);
X1:=(LLV(C,N1)/REF(L,N1+1)-1)*100;
P1:=NOT(REF(H,N1-1)>REF(HHV(H,2),N1) AND C>O);
P2:=COUNT(EVERY(H>REF(HHV(H,2),N1) AND C>O,3),N1)=0;
P3A:=REF(N1,1)>3 AND REF(N1,1)< 15;
P3:=NOT(REF(EVERY(C< O,4) AND DOWNNDAY(L,3),REF(N1,1)-3) AND P3A);
P4A:=C>O AND C<=REF(O,1) AND O>=REF(C,1) AND REF(C< O AND ABS(JZF)< 0.1,1);
P4B:=REF(BETWEEN(C,REF(C,2),REF(O,2)),N1-2);
P4:=NOT(REF(P4A AND ABS(100*(C/REF(C,2)-1))< 0.4,N1-1) AND P4B);
P5A:=C>O AND ST>1 AND C>REF(O,1) AND O< REF(C,1);
P5B:=REF(C< O AND ST>1 AND H< REF(H,1),1);
P5:=NOT(REF(P5A AND P5B AND C>REF(C,2) AND V< REF(V,1),N1-1));
P6:=NOT(REF(SYX< 0.01 AND XYX>3,N1+1));
P7A:=REF(EVERY(C>REF(C,N1+1),3) AND C< REF(C,1) AND C>O,1);
P7:=NOT(P7A AND REF(P5A AND P5B AND V< REF(V,1),N1-1));
P8A:=REF(MAX(V,REF(V,1))/MIN(V,REF(V,1))< 1.1 AND EVERY(C< O,2),N1-1);
P8:=NOT((O/REF(H,1)-1)*100>1.5 AND P8A);
P9A:=REF(SYX>3 AND ST>2 AND O>REF(C,1),1);
P9:=NOT(REF(P9A AND C>O AND C< REF(O,1) AND O>REF(C,1),N1-1));
P10A:=ST>3 AND C< O AND REF(C>O,1) AND O=REF(C,1) AND C=REF(O,1);
P10:=NOT(COUNT(P10A,N1)>0 AND N1< 10);
P:=P1 AND P2 AND P3 AND P4 AND P5 AND P6;
PP:=P7 AND P8 AND P9 AND P10;
T3A:=MAX(C,O)< 1.001*REF(HHV(H,2),N1) AND AMO< 1.004*REF(AMO,N1+1);
T3:=P AND EVERY(T3A,N1) AND X1>-7 AND LLV(AMO,N1)< 0.5*REF(AMO,N1+1);
T4:=FW AND T3=0 AND REF(T3,1) AND CROSS(C,REF(HHV(H,2),REF(N1,1)+1));
XG:=T4 AND COUNT(T4,10)=1 AND JZF< 8 AND PP;
M:=BARSNEXT(XG);
TJA:=T1 AND REFX(T2 AND M=REFX(N1,M),1) AND M>0;
STICKLINE(TJA,REFX(HHV(H,2),1),REFX(LLV(L,2),1),5,-1),COLORYELLOW;
STICKLINE(REF(TJA,1),HHV(H,2),LLV(L,2),5,-1),COLORYELLOW;
DRAWKLINE(H,O,L,C);
STICKLINE(TJA,C,O,3,0),COLORRED;
STICKLINE(TJA,H,L,0,0),COLORRED;
DRAWTEXT(TJA,H*1.05,'黑马启动线'),COLORRED;
DRAWSL(XG,REF(REF(HHV(H,2),N1),1),0,REF(N1,1)+3,1),COLORGREEN;
STICKLINE(XG,C,O,3,0),COLORRED;
DRAWICON(XG,L,1);
{黑马启动线副图源码如下}
C2:=REF(C,1);
ZT:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
X_2:=IF(NAMELIKE(8),1,0)=0;
X_3:=IF(NAMELIKE(9),1,0)=0;
X_4:=IF(NAMELIKE(10),1,0)=0;
X_5:=IF(CODELIKE(11),1,0)=0;
X_6:=IF(CODELIKE(12),1,0)=0;
X_7:=IF(CODELIKE(13),1,0)=0;
FW:=X_2 AND X_3 AND X_4 AND X_5 AND X_6 AND X_7 ;
JZF:=(O/REF(C,1)-1)*100;
ZF:=(C/REF(C,1)-1)*100;
SYX:=100*(H-MAX(C,O))/REF(C,1);
ST:=100*ABS(C-O)/REF(C,1);
XYX:=100*(MIN(C,O)-L)/REF(C,1);
T1A:=V>2*REF(V,1) AND V=HHV(V,7) AND COUNT(ZT,10)=0 AND BARSCOUNT(C)>100;
T1:=T1A AND ST>2.8 AND C>O AND COUNT(C>O AND V>2*REF(V,1),5)=1;
T2A:=SYX< 5 AND XYX< 3 AND JZF< 3 AND V< REF(V,1) AND JZF>-3;
T2:=REF(T1,1) AND IF(ST>1,ST< 0.4*REF(ST,1) AND ST< 3,ST< 1) AND T2A;
N1:=BARSLAST(T2);
X1:=(LLV(C,N1)/REF(L,N1+1)-1)*100;
P1:=NOT(REF(H,N1-1)>REF(HHV(H,2),N1) AND C>O);
P2:=COUNT(EVERY(H>REF(HHV(H,2),N1) AND C>O,3),N1)=0;
P3A:=REF(N1,1)>3 AND REF(N1,1)< 15;
P3:=NOT(REF(EVERY(C< O,4) AND DOWNNDAY(L,3),REF(N1,1)-3) AND P3A);
P4A:=C>O AND C<=REF(O,1) AND O>=REF(C,1) AND REF(C< O AND ABS(JZF)< 0.1,1);
P4B:=REF(BETWEEN(C,REF(C,2),REF(O,2)),N1-2);
P4:=NOT(REF(P4A AND ABS(100*(C/REF(C,2)-1))< 0.4,N1-1) AND P4B);
P5A:=C>O AND ST>1 AND C>REF(O,1) AND O< REF(C,1);
P5B:=REF(C< O AND ST>1 AND H< REF(H,1),1);
P5:=NOT(REF(P5A AND P5B AND C>REF(C,2) AND V< REF(V,1),N1-1));
P6:=NOT(REF(SYX< 0.01 AND XYX>3,N1+1));
P7A:=REF(EVERY(C>REF(C,N1+1),3) AND C< REF(C,1) AND C>O,1);
P7:=NOT(P7A AND REF(P5A AND P5B AND V< REF(V,1),N1-1));
P8A:=REF(MAX(V,REF(V,1))/MIN(V,REF(V,1))< 1.1 AND EVERY(C< O,2),N1-1);
P8:=NOT((O/REF(H,1)-1)*100>1.5 AND P8A);
P9A:=REF(SYX>3 AND ST>2 AND O>REF(C,1),1);
P9:=NOT(REF(P9A AND C>O AND C< REF(O,1) AND O>REF(C,1),N1-1));
P10A:=ST>3 AND C< O AND REF(C>O,1) AND O=REF(C,1) AND C=REF(O,1);
P10:=NOT(COUNT(P10A,N1)>0 AND N1< 10);
P:=P1 AND P2 AND P3 AND P4 AND P5 AND P6;
PP:=P7 AND P8 AND P9 AND P10;
T3A:=MAX(C,O)< 1.001*REF(HHV(H,2),N1) AND AMO< 1.004*REF(AMO,N1+1);
T3:=P AND EVERY(T3A,N1) AND X1>-7 AND LLV(AMO,N1)< 0.5*REF(AMO,N1+1);
T4:=FW AND T3=0 AND REF(T3,1) AND CROSS(C,REF(HHV(H,2),REF(N1,1)+1));
XG:T4 AND COUNT(T4,10)=1 AND JZF< 8 AND PP COLORRED,LINETHICK3;
未来函数检测结果如下:
该公式包含未来函数:BARSNEXT
该公式包含未来函数:REFX
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{黑马启动线主图源码如下}C2赋值:1日前的C
ZT赋值:IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0)
X_2赋值:IF(NAMELIKE(8),1,0)=0
X_3赋值:IF(NAMELIKE(9),1,0)=0
X_4赋值:IF(NAMELIKE(10),1,0)=0
X_5赋值:IF(CODELIKE(11),1,0)=0
X_6赋值:IF(CODELIKE(12),1,0)=0
X_7赋值:IF(CODELIKE(13),1,0)=0
FW赋值:X_2 AND X_3 AND X_4 AND X_5 AND X_6 AND X_7
JZF赋值:(O/1日前的C-1)*100
ZF赋值:(C/1日前的C-1)*100
SYX赋值:100*(H-C和O较大值)/1日前的C
ST赋值:100*C-O的绝对值/1日前的C
XYX赋值:100*(C和O的较小值-L)/1日前的C
T1A赋值:V>2*1日前的V AND V=7日内V最高值 AND 统计10日满足ZT的天数=0 AND C的有效数据周期数>100
T1赋值:T1A AND ST>2.8 AND C>O AND COUNT(C>O AND V>2*1日前的V,5)=1
T2A赋值:SYX< 5 AND XYX< 3 AND JZF< 3 AND V< 1日前的V AND JZF>-3
T2赋值:1日前的T1 AND IF(ST>1,ST< 0.4*1日前的ST AND ST< 3,ST< 1) AND T2A
N1赋值:上次T2距今天数
X1赋值:(N1日内C最低值/N1+1日前的L-1)*100
P1赋值:NOT(N1-1日前的H>REF(2日内H最高值,N1) AND C>O)
P2赋值:COUNT(EVERY(H>REF(2日内H最高值,N1) AND C>O,3),N1)=0
P3A赋值:1日前的N1>3 AND 1日前的N1< 15
P3赋值:NOT(REF(C< O最近4日一直存在 AND DOWNNDAY(L,3),REF(N1,1)-3) AND P3A)
P4A赋值:C>O AND C<=1日前的O AND O>=1日前的C AND REF(C< O AND JZF的绝对值< 0.1,1)
P4B赋值:REF(BETWEEN(C,REF(C,2),REF(O,2)),N1-2)
P4赋值:NOT(REF(P4A AND 100*(C/REF(C,2的绝对值-1))< 0.4,N1-1) AND P4B)
P5A赋值:C>O AND ST>1 AND C>1日前的O AND O< 1日前的C
P5B赋值:1日前的C< O AND ST>1 AND H< H,1)
P5赋值:NOT(2日前的P5A AND P5B AND C>C AND V< 1日前的V,N1-1))
P6赋值:NOT(N1+1日前的SYX< 0.01 AND XYX>3)
P7A赋值:REF(EVERY(C>REF(C,N1+1),3) AND C< REF(C,1) AND C>O,1)
P7赋值:NOT(P7A AND 1日前的P5A AND P5B AND V< V,N1-1))
P8A赋值:REF(MAX(V,REF(V,1))/MIN(V,REF(V,1))< 1.1 AND C< O最近2日一直存在,N1-1)
P8赋值:NOT((O/1日前的H-1)*100>1.5 AND P8A)
P9A赋值:1日前的SYX>3 AND ST>2 AND O>C,1)
P9赋值:NOT(1日前的P9A AND C>O AND C< O AND O>1日前的C,N1-1))
P10A:=ST>3 AND C< O AND 1日前的C>O AND O=1日前的C AND C=1日前的O
P10:=NOT(统计N1日满足P10A的天数>0 AND N1< 10)
P赋值:P1 AND P2 AND P3 AND P4 AND P5 AND P6
PP赋值:P7 AND P8 AND P9 AND P10
T3A赋值:C和O较大值< 1.001*REF(2日内H最高值,N1) AND AMO< 1.004*REF(AMO,N1+1)
T3赋值:P AND T3A最近N1日一直存在 AND X1>-7 AND N1日内AMO最低值< 0.5*N1+1日前的AMO
T4赋值:FW AND T3=0 AND 1日前的T3 AND CROSS(C,REF(2日内H最高值,REF(N1,1)+1))
XG赋值:T4 AND 统计10日满足T4的天数=1 AND JZF< 8 AND PP
M赋值:BARSNEXT(XG)
TJA赋值:T1 AND REFX(T2 AND M=REFX(N1,M),1) AND M>0
STICKLINE(TJA,REFX(2日内H最高值,1),REFX(2日内L最低值,1),5,-1),画黄色
STICKLINE(1日前的TJA,2日内H最高值,2日内L最低值,5,-1),画黄色
DRAWKLINE(H,O,L,C)
当满足条件TJA时,在C和O之间画柱状线
当满足条件TJA时,在H和L之间画柱状线
当满足条件TJA时,在H*1.05和'黑马启动线'位置书写文字
DRAWSL(XG,REF(REF(2日内H最高值,N1),1),0,REF(N1,1)+3,1),画绿色
当满足条件XG时,在C和O之间画柱状线
当满足条件XG时,在L和1之间画图标
{黑马启动线副图源码如下}C2赋值:1日前的C
ZT赋值:IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0)
X_2赋值:IF(NAMELIKE(8),1,0)=0
X_3赋值:IF(NAMELIKE(9),1,0)=0
X_4赋值:IF(NAMELIKE(10),1,0)=0
X_5赋值:IF(CODELIKE(11),1,0)=0
X_6赋值:IF(CODELIKE(12),1,0)=0
X_7赋值:IF(CODELIKE(13),1,0)=0
FW赋值:X_2 AND X_3 AND X_4 AND X_5 AND X_6 AND X_7
JZF赋值:(O/1日前的C-1)*100
ZF赋值:(C/1日前的C-1)*100
SYX赋值:100*(H-C和O较大值)/1日前的C
ST赋值:100*C-O的绝对值/1日前的C
XYX赋值:100*(C和O的较小值-L)/1日前的C
T1A赋值:V>2*1日前的V AND V=7日内V最高值 AND 统计10日满足ZT的天数=0 AND C的有效数据周期数>100
T1赋值:T1A AND ST>2.8 AND C>O AND COUNT(C>O AND V>2*1日前的V,5)=1
T2A赋值:SYX< 5 AND XYX< 3 AND JZF< 3 AND V< 1日前的V AND JZF>-3
T2赋值:1日前的T1 AND IF(ST>1,ST< 0.4*1日前的ST AND ST< 3,ST< 1) AND T2A
N1赋值:上次T2距今天数
X1赋值:(N1日内C最低值/N1+1日前的L-1)*100
P1赋值:NOT(N1-1日前的H>REF(2日内H最高值,N1) AND C>O)
P2赋值:COUNT(EVERY(H>REF(2日内H最高值,N1) AND C>O,3),N1)=0
P3A赋值:1日前的N1>3 AND 1日前的N1< 15
P3赋值:NOT(REF(C< O最近4日一直存在 AND DOWNNDAY(L,3),REF(N1,1)-3) AND P3A)
P4A赋值:C>O AND C<=1日前的O AND O>=1日前的C AND REF(C< O AND JZF的绝对值< 0.1,1)
P4B赋值:REF(BETWEEN(C,REF(C,2),REF(O,2)),N1-2)
P4赋值:NOT(REF(P4A AND 100*(C/REF(C,2的绝对值-1))< 0.4,N1-1) AND P4B)
P5A赋值:C>O AND ST>1 AND C>1日前的O AND O< 1日前的C
P5B赋值:1日前的C< O AND ST>1 AND H< H,1)
P5赋值:NOT(2日前的P5A AND P5B AND C>C AND V< 1日前的V,N1-1))
P6赋值:NOT(N1+1日前的SYX< 0.01 AND XYX>3)
P7A赋值:REF(EVERY(C>REF(C,N1+1),3) AND C< REF(C,1) AND C>O,1)
P7赋值:NOT(P7A AND 1日前的P5A AND P5B AND V< V,N1-1))
P8A赋值:REF(MAX(V,REF(V,1))/MIN(V,REF(V,1))< 1.1 AND C< O最近2日一直存在,N1-1)
P8赋值:NOT((O/1日前的H-1)*100>1.5 AND P8A)
P9A赋值:1日前的SYX>3 AND ST>2 AND O>C,1)
P9赋值:NOT(1日前的P9A AND C>O AND C< O AND O>1日前的C,N1-1))
P10A:=ST>3 AND C< O AND 1日前的C>O AND O=1日前的C AND C=1日前的O
P10:=NOT(统计N1日满足P10A的天数>0 AND N1< 10)
P赋值:P1 AND P2 AND P3 AND P4 AND P5 AND P6
PP赋值:P7 AND P8 AND P9 AND P10
T3A赋值:C和O较大值< 1.001*REF(2日内H最高值,N1) AND AMO< 1.004*REF(AMO,N1+1)
T3赋值:P AND T3A最近N1日一直存在 AND X1>-7 AND N1日内AMO最低值< 0.5*N1+1日前的AMO
T4赋值:FW AND T3=0 AND 1日前的T3 AND CROSS(C,REF(2日内H最高值,REF(N1,1)+1))
输出XG:T4 AND 统计10日满足T4的天数=1 AND JZF< 8 AND PP 画红色, 线宽为3