当前位置:首页 > 通达信 > 正文

【通达信源码分享】私募缺口主图指标公式源码附图

2022-10-20未知 编 辑:掌上指标


{缺口主图}
 
DRAWBAND(MA(CLOSE,60),RGB(190,0,0),MA(CLOSE,250),RGB(0,123,0));
 
{DRAWBAND(MA(CLOSE,5),RGB(155,50,50),MA(CLOSE,20),RGB(83,123,68));}
 
DRAWKLINE(H,O,L,C); 
 
实时:REFDATE(C,DATE),DOTLINE,COLORMAGENTA,LINETHICK1;
 
涨停:=IF(REF(C,1)*1.095-C<0.01 ,1,0);
 
涨停线:=REF(O,BARSLAST(涨停));
 
涨停线1:=REF(H,BARSLAST(涨停));
 
涨停线2:=REF(L,BARSLAST(涨停));
 
STICKLINE(涨停,O,C,2.7,0),COLORRED;{涨停红柱};
 
{过线放量买}
 
T1B:=CONST(LLVBARS(LOW,10));
 
T1HIGH:=CONST(REF(HIGH,T1B));
 
CCC:=CONST(CURRBARSCOUNT);
 
T2B:=CONST(BARSLAST(CURRBARSCOUNT>CCC+T1B AND H>T1HIGH));
 
T2HIGH:=CONST(REF(HIGH,T2B));
 
T3B:=CONST(BARSLAST(CURRBARSCOUNT>CCC+T2B AND HIGH>T2HIGH));
 
T3HIGH:=CONST(REF(HIGH,T3B));
 
抢钱10:DRAWLINE(CURRBARSCOUNT=T3B+1, T3HIGH, ISLASTBAR, T3HIGH, 1),COLORYELLOW,LINETHICK2;{,LINETHICK2,COLOR0000FF;}
 
DRAWTEXT(ISLASTBAR, T3HIGH, '抢钱10')LINETHICK1,COLORYELLOW;
 
{AAAA:抢钱10,COLORYELLOW,LINETHICK1;}
 
DRAWNUMBER(抢钱10!=REF(抢钱10,1),H,抢钱10),COLORYELLOW;
 
{胖哥必杀线}
 
T1:=CONST(LLVBARS(LOW,20));
 
T1HIGH2:=CONST(REF(HIGH,T1));
 
CCA:=CONST(CURRBARSCOUNT);
 
T2:=CONST(BARSLAST(CURRBARSCOUNT>CCA+T1 AND H>T1HIGH2));
 
T2HIGH2:=CONST(REF(HIGH,T2));
 
T3C:=CONST(BARSLAST(CURRBARSCOUNT>CCA+T2 AND HIGH>T2HIGH2));
 
T3HIGH2:=CONST(REF(HIGH,T3C));
 
抢钱20:DRAWLINE(CURRBARSCOUNT=T3C+1, T3HIGH2, ISLASTBAR, T3HIGH2, 1),LINETHICK2,COLOR0099FF;
 
{BBBB:抢钱20,COLORYELLOW,LINETHICK1;}
 
DRAWTEXT(ISLASTBAR, T3HIGH2, '抢钱20')LINETHICK1,COLOR0099FF;
 
DRAWNUMBER(抢钱20!=REF(抢钱20,1),H,抢钱20),COLOR0099FF;
 
停牌:=(DYNAINFO(4)=0);
 
去掉:=NOT(停牌);
 
去除ST:=NAMELIKE('ST')=0 AND NAMELIKE('*ST')=0 AND NAMELIKE('SST')=0 AND NAMELIKE('S ST')=0 AND NAMELIKE('S*ST')=0 AND NAMELIKE('S')=0;
 
盘子:=CAPITAL/100;
 
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));
 
MTIME:=MOD(FROMOPEN,TOTAL);
 
CTIME:=IF(MTIME<0.5,TOTAL,MTIME);
 
虚拟量:=IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,DRAWNULL);
 
放量:=虚拟量>REF(V,1)*1.9 OR V>REF(V,1)*1.9;
 
AAA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));{系数=成交量/((最高价-最低价)*2-绝对值(收盘价-开盘价))}
 
主买:=IF(CLOSE>OPEN,AAA*(HIGH-LOW),IF(CLOSE<OPEN,AAA*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));
 
主卖:=-IF(CLOSE>OPEN,0-AAA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-AAA*(HIGH-LOW),0-V/2));
 
缺口:=BARSLAST(L>REF(H,1))<=1 AND 盘子<=100000 AND 去掉 AND 去除ST AND 放量 AND 主买>主卖;
 
DRAWTEXT(缺口,L,'缺口突破'),COLORYELLOW;
 
{撑压线}
 
N:=5;
 
A1:=REF(H,N)=HHV(H,2*N+1);
 
B1:=FILTER(A1,N);
 
C1:=BACKSET(B1,N+1);
 
D1:=FILTER(C1,N);
 
A2:=REF(L,N)=LLV(L,2*N+1);
 
B2:=FILTER(A2,N);
 
C2:=BACKSET(B2,N+1);
 
D2:=FILTER(C2,N);
 
E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;
 
E2:=(H+L)/2;
 
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1;
 
L1:=(D2 AND NOT(D1 AND E1<E2));
 
H2:=D1 AND NOT(D2 AND E1>=E2);
 
X1:=REF(BARSLAST(H1),1)+1;
 
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
 
G1:=F1>REF(F1,1);
 
I1:=BACKSET(G1,2);
 
LD:=I1>REF(I1,1);
 
L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;
 
X2:=REF(BARSLAST(L2),1)+1;
 
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));
 
G2:=F2>REF(F2,1);
 
I2:=BACKSET(G2,2);
 
HD:=I2>REF(I2,1);
 
R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
 
S1:=R1>REF(R1,1);
 
T1A:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
 
U1:=T1A>REF(T1A,1);
 
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);
 
S2:=R2>REF(R2,1);
 
T2A:=BACKSET(U1,REF(BARSLAST(LD),1)+2);
 
U2:=T2A>REF(T2A,1);
 
NOTEXT1:DRAWLINE(S2,H,S1,H,1),LINETHICK1,COLORRED;
 
NOTEXT2:DRAWLINE(U2,L,U1,L,1),LINETHICK1,COLORGREEN;
 
 
 
{ZDT:=(C-REF(C,1))/REF(C,1)*100;}
 
{STICKLINE(ZDT>9.8,O,C,2,0),COLORYELLOW;
 
STICKLINE(ZDT<-9.8,O,C,2,0),COLOR00FF00;}
 
 
 
不破价:=REF(C,BARSLAST(涨停));
 
LS0:=BARSLAST(涨停);
 
LS11:=IF(1,LS0=1,涨停);
 
LS21:=IF(1,LLV(C,1)>REF(C,1),1);
 
涨停不破:=LS11 AND LS21;
 
STICKLINE(涨停不破,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破,不破价-不破价*0.02,'1'),COLORGREEN;
 
LS12:=IF(2,LS0=2,涨停);
 
LS22:=IF(2,LLV(C,2)>REF(C,2),1);
 
涨停不破2:=LS12 AND LS22;
 
STICKLINE(涨停不破2,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破2,不破价-不破价*0.02,'2'),COLORGREEN;
 
LS13:=IF(3,LS0=3,涨停);
 
LS23:=IF(3,LLV(C,3)>REF(C,3),1);
 
涨停不破3:=LS13 AND LS23;
 
STICKLINE(涨停不破3,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破3,不破价-不破价*0.02,'3'),COLORGREEN;
 
LS14:=IF(4,LS0=4,涨停);
 
LS24:=IF(4,LLV(C,4)>REF(C,4),1);
 
涨停不破4:=LS14 AND LS24;
 
STICKLINE(涨停不破4,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破4,不破价-不破价*0.02,'4'),COLORGREEN;
 
LS15:=IF(5,LS0=5,涨停);
 
LS25:=IF(5,LLV(C,5)>REF(C,5),1);
 
涨停不破5:=LS15 AND LS25;
 
STICKLINE(涨停不破5,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破5,不破价-不破价*0.02,'5'),COLORGREEN;
 
LS16:=IF(6,LS0=6,涨停);
 
LS26:=IF(6,LLV(C,6)>REF(C,6),1);
 
涨停不破6:=LS16 AND LS26;
 
STICKLINE(涨停不破6,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破6,不破价-不破价*0.02,'6'),COLORGREEN;
 
LS17:=IF(7,LS0=7,涨停);
 
LS27:=IF(7,LLV(C,7)>REF(C,7),1);
 
涨停不破7:=LS17 AND LS27;
 
STICKLINE(涨停不破7,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破7,不破价-不破价*0.02,'7'),COLORGREEN;
 
LS18:=IF(8,LS0=8,涨停);
 
LS28:=IF(8,LLV(C,8)>REF(C,8),1);
 
涨停不破8:=LS18 AND LS28;
 
STICKLINE(涨停不破8,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破8,不破价-不破价*0.02,'8'),COLORGREEN;
 
LS19:=IF(9,LS0=9,涨停);
 
LS29:=IF(9,LLV(C,9)>REF(C,9),1);
 
涨停不破9:=LS19 AND LS29;
 
STICKLINE(涨停不破9,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破9,不破价-不破价*0.02,'9'),COLORGREEN;
 
LS110:=IF(10,LS0=10,涨停);
 
LS210:=IF(10,LLV(C,10)>REF(C,10),1);
 
涨停不破10:=LS110 AND LS210;
 
STICKLINE(涨停不破10,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破10,不破价-不破价*0.02,'0'),COLORGREEN;
 
LS111:=IF(11,LS0=11,涨停);
 
LS211:=IF(11,LLV(C,11)>REF(C,11),1);
 
涨停不破11:=LS111 AND LS211;
 
STICKLINE(涨停不破11,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破11,不破价-不破价*0.02,'1'),COLORGREEN;
 
LS112:=IF(12,LS0=12,涨停);
 
LS212:=IF(12,LLV(L,12)>REF(L,12),1);
 
涨停不破12:=LS112 AND LS212;
 
STICKLINE(涨停不破12,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破12,不破价-不破价*0.02,'2'),COLORGREEN;
 
LS113:=IF(13,LS0=13,涨停);
 
LS213:=IF(13,LLV(L,13)>REF(L,13),1);
 
涨停不破13:=LS113 AND LS213;
 
STICKLINE(涨停不破13,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破13,不破价-不破价*0.02,'3'),COLORGREEN;
 
LS114:=IF(14,LS0=14,涨停);
 
LS214:=IF(14,LLV(L,14)>REF(L,14),1);
 
涨停不破14:=LS114 AND LS214;
 
STICKLINE(涨停不破14,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破14,不破价-不破价*0.02,'4'),COLORGREEN;
 
LS115:=IF(15,LS0=15,涨停);
 
LS215:=IF(15,LLV(L,15)>REF(L,15),1);
 
涨停不破15:=LS115 AND LS215;
 
STICKLINE(涨停不破15,不破价-不破价*0.002,不破价,4,0),COLORMAGENTA;
 
DRAWTEXT(涨停不破15,不破价-不破价*0.02,'5'),COLORGREEN;
 
 
 
涨幅:=IF(REF(C,1)*1.055-C<0.01 ,1,0);
 
缺口2:=L>REF(H,1);
 
不破缺:=REF(L,BARSLAST(缺口2));
 
LS01:=BARSLAST(缺口2);
 
LS1111:=IF(1,LS01=1,缺口2);
 
LS2111:=IF(1,LLV(L,1)>REF(L,1),1);
 
缺口2不破:=LS1111 AND LS2111;
 
STICKLINE(缺口2不破,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破,不破缺-不破缺*0.02,'1'),COLORCYAN;
 
LS121:=IF(2,LS01=2,缺口2);
 
LS221:=IF(2,LLV(L,2)>REF(L,2),1);
 
缺口2不破2:=LS121 AND LS221;
 
STICKLINE(缺口2不破2,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破2,不破缺-不破缺*0.02,'2'),COLORCYAN;
 
LS131:=IF(3,LS01=3,缺口2);
 
LS231:=IF(3,LLV(L,3)>REF(L,3),1);
 
缺口2不破3:=LS131 AND LS231;
 
STICKLINE(缺口2不破3,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破3,不破缺-不破缺*0.02,'3'),COLORCYAN;
 
LS141:=IF(4,LS01=4,缺口2);
 
LS241:=IF(4,LLV(L,4)>REF(L,4),1);
 
缺口2不破4:=LS141 AND LS241;
 
STICKLINE(缺口2不破4,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破4,不破缺-不破缺*0.02,'4'),COLORCYAN;
 
LS151:=IF(5,LS01=5,缺口2);
 
LS251:=IF(5,LLV(L,5)>REF(L,5),1);
 
缺口2不破5:=LS151 AND LS251;
 
STICKLINE(缺口2不破5,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破5,不破缺-不破缺*0.02,'5'),COLORCYAN;
 
LS161:=IF(6,LS01=6,缺口2);
 
LS261:=IF(6,LLV(L,6)>REF(L,6),1);
 
缺口2不破6:=LS161 AND LS261;
 
STICKLINE(缺口2不破6,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破6,不破缺-不破缺*0.02,'6'),COLORCYAN;
 
LS171:=IF(7,LS01=7,缺口2);
 
LS271:=IF(7,LLV(L,7)>REF(L,7),1);
 
缺口2不破7:=LS171 AND LS271;
 
STICKLINE(缺口2不破7,不破缺-不破缺*0.002,不破缺,4,0),COLORCYAN;
 
DRAWTEXT(缺口2不破7,不破缺-不破缺*0.02,'7'),COLORCYAN;
 
 
 
 
 
攻击迫线:={OPEN>REF(HIGH,1) AND CLOSE>REF(HIGH,1) AND LOW>REF(HIGH,1) AND HIGH>CLOSE AND }REF(CLOSE,1)/REF(CLOSE,2)>=1.09;
 
BB1:='┄┄┄┄┄';
 
{DRAWTEXT(攻击迫线,L,BB1),COLORYELLOW;}
 
BB2:='┄┄┄┄┄┄┄',COLOR0099FF;
 
DRAWTEXT(攻击迫线,H,BB2),COLOR0099FF;{上影画棕线}
 
DRAWTEXT(攻击迫线,C,BB2),COLORYELLOW;{收盘画黄线}
 
DRAWTEXT(涨停,C,BB2),COLORF00FF0;
 
{条件是 今天涨停 明天高开收上引线 第三天过收盘线关注,带量过上引就可以买进;如今日涨停,次日收下影,第三天不破次日下影线最低价,可以关注};
 
上影:=REF(H,BARSLAST(攻击迫线));
 
阳盘:=O>C;
 
收盘:=REF(C,BARSLAST(攻击迫线));
 
DRAWNUMBER(上影!=REF(上影,1),H,上影),COLOR0099FF;
 
DRAWNUMBER(收盘!=REF(收盘,1),C,收盘),COLORYELLOW;
 
{倍量MACD第一红柱-加主图}
 
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
 
K:=SMA(RSV,3,1);
 
D:=SMA(K,3,1);
 
J:=3*K-2*D;
 
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
 
DEA:=EMA(DIF,9);
 
MACD:=(DIF-DEA)*2;
 
起跳:=VOL>REF(VOL,1)*2.0 OR 虚拟量>REF(VOL,1)*2.0;
 
第一红柱:=起跳 AND REF(MACD,1)<0 AND MACD>0 AND DEA>0 AND C>MA(C,60) AND MA(V,5)>MA(V,10);
 
DRAWTEXT(第一红柱,H*0.979,'第一红'),COLORF00FF0;
 
JC:=CROSS(DIF,DEA)AND MACD>0;
 
DRAWTEXT(CROSS(DIF,DEA),L*0.98,'M金'),COLORMAGENTA;
 
AAAB:=(DIF-DEA)*2*60;
 
起爆:=CROSS(AAAB-REF(AAAB,1),15),COLORRED,LINETHICK2;
 
DRAWTEXT(起爆,(O+H)/2,'↖暴涨'),COLORCYAN,LINETHICK2;
 
{过左峰--加主图后面}
 
CC1:=REF(HIGH,5)=HHV(HIGH,2*5+1); 
 
CC2:=FILTER(CC1,5); 
 
CC3:=BACKSET(CC2,5+1); 
 
HDD:=FILTER(CC3,5); 
 
前高:REF(H,BARSLAST(HDD)),COLORMAGENTA;
 
突破前高:=CROSS(C,前高);
 
倍量2:=VOL>REF(V,1)*1.9 OR 虚拟量>REF(V,1)*1.9;
 
倍量过左峰:=倍量2 AND 突破前高;
 
DRAWTEXT(倍量过左峰,前高,'倍过左');
 
{DRAWTEXT(突破前高,前高*1.01,'过左');}
 
DRAWNUMBER(前高!=REF(前高,1),H,前高),COLORMAGENTA;
 
SXJC:=BARSLAST(CROSS("MACD.DIF","MACD.DEA"))<2;
 
突破左峰:=FILTER(CLOSE>REF(HHV(HIGH,100),1) AND REF(C,1)<REF(HHV(HIGH,100),1),5) AND EXIST(EVERY(C>EMA(C,120),30),100) AND C/EMA(C,100)<1.5 AND SXJC AND DYNAINFO(17)>0; 
 
DRAWTEXT(突破左峰,H*0.98,'突破左峰');
 
L1A:=LLV(L,10);
 
敢死队操作线:=MA(C,24),LINETHICK2,COLORLIMAGENTA;
 
操作线2:=MA(C,26),LINETHICK1,COLORLICYAN;
 
{DRAWKLINE(HIGH,OPEN,LOW,CLOSE);}
 
起爆点:=(DCLOSE-REF(C,1))/REF(C,1)*100;
 
XG:=CROSS(起爆点,20) OR CROSS(起爆点,18);
 
L3:=IF(XG,O,L1A*0.999),COLORYELLOW;
 
STICKLINE(XG,L3,L3,100,0),COLORCYAN;
 
DRAWTEXT(XG,L3,'起爆'),COLORCYAN;
 
SXJC11:=BARSLAST(CROSS(MA(C,5),MA(C,10)))<2 AND C>MA(C,120);
 
SXJC21:=BARSLAST(CROSS(MA(V,5),MA(V,10)))<2;
 
SXJC31:=BARSLAST(CROSS("MACD.DIF","MACD.DEA"))<2;
 
SXJC1:=SXJC11 AND SXJC21 AND SXJC31;
 
DRAWTEXT(SXJC1,L*0.97,'←-三金叉'),COLORGREEN;
 
 
 
{信息1}
 
AA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
 
主动买盘:=IF(CLOSE>OPEN,AA*(HIGH-LOW),IF(CLOSE<OPEN,AA*((HIGH-OPEN)+
 
(CLOSE-LOW)),VOL/2)),POINTDOT,COLORRED;
 
主买万:=主动买盘/10000,COLORRED,NODRAW;
 
主动卖盘:=IF(CLOSE>OPEN,0-AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,
 
0-AA*(HIGH-LOW),0-VOL/2)),LINETHICK0,COLORGREEN;
 
主卖万:=主动卖盘/10000,COLORGREEN,NODRAW;
 
AA1:=CLOSE/REF(C,1)>=1.09;
 
差:=主动买盘/10000+主动卖盘/10000,COLORMAGENTA,NODRAW;
 
DRAWTEXT_FIX(1,0.00,0.10,0,STRCAT('主买万:',CON2STR(主买万,2))),COLORWHITE;
 
DRAWTEXT_FIX(1,0.00,0.18,0,STRCAT('主卖万:',CON2STR(主卖万,2))),COLORYELLOW;
 
DRAWTEXT_FIX(1,0.00,0.26,0,STRCAT('差:',CON2STR(差,2))),COLORWHITE;
 
获利%:=WINNER(CLOSE)*100,NODRAW,COLORWHITE;
 
DRAWTEXT_FIX(1,0.00,0.34,0,STRCAT('获利%:',CON2STR(获利%,2))),COLORWHITE;
 
{信息2}
 
Z1:=STRCAT(HYBLOCK,' ');
 
Z2:=STRCAT(Z1,DYBLOCK);
 
Z3:=STRCAT(Z2,' ');
 
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0;
 
T4:=IF(FINDSTR(EXTERNSTR(0,10),','),STRCAT('主题投资:',EXTERNSTR(0,10)),'');
 
DRAWTEXT_FIX(1,0.00,0.07,0,STRCAT('☆',T4)),COLOR0099FF;
大家都爱看
查看更多热点新闻
点击进入掌上指标资源网-下载各类指标