股票算法-临界 发表于 2021-08-23 | 分类于 股票算法 包含的算法代码 涨停倒影,倍量涨停显示下延线,涨停显示-0.5、-1线(同花顺) 涨停显示-1线(通达信) 临界,显示临界上下沿,显示1、2、3买点 显示概念、行业、地域 按均线显示背景颜色(同花顺) 抄底和逃顶战法 同花顺主图代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677IF(ISLASTBAR){ DRAWTEXT_FIX(CURRBARSCOUNT=1,0.05,0.03,0,'概念('+BLOCK(3,0)+')'); DRAWTEXT_FIX(CURRBARSCOUNT=1,0.05,0.06,0,'行业('+BLOCK(0,0)+'》'+ BLOCK(1,0)+') 地域('+BLOCK(2,0)+')'); DRAWTEXT_FIX(CURRBARSCOUNT=1,0.05,0.09,0,ZQMC + '('+ CODE+')');}MA5:MA(CLOSE,5),colorwhite,LINETHICK1;MA11:MA(CLOSE,11),colormagenta,LINETHICK1;MA36:MA(CLOSE,36),colorligreen,LINETHICK1;F1:ZIG(3,15),DOTLINE,colorligray;DRAWTEXT(CROSS(REF(F1,1),F1),1.01*H[1],C[1]),colorred;DRAWTEXT(CROSS(F1,REF(F1,1)),0.99*L[1],C[1]),colorcyan;IF(CROSS(REF(F1,1),F1)){ STICKLINE(V>V[1] AND V>V[2],L,L,60,0),colorgreen; STICKLINE(V[1]>V AND V[1]>V[2],L[1],L[1],60,0),colorgreen; STICKLINE(V[2]>V AND V[2]>V[1],L[2],L[2],60,0),colorgreen;} ELSE IF(CROSS(F1,REF(F1,1))){ STICKLINE(V<V[1] AND V<V[2],H,H,60,0),colorred; STICKLINE(V[1]<V AND V[1]<V[2],H[1],H[1],60,0),colorred; STICKLINE(V[2]<V AND V[2]<V[1],H[2],H[2],60,0),colorred;}涨停:=C>=1.096*C[1];STICKLINE(涨停,MAX(O,L),MIN(H,C),5,0),coloryellow;STICKLINE(V>1.9*V[1] AND 涨停,L,L,10,0),colorgreen,LINETHICK1;STICKLINE(涨停,C[1]*(1-((C-C[1])/2)/C[1]),C[1]*(1-((C-C[1])/2)/C[1]),10,0),colorwhite,LINETHICK1;STICKLINE(涨停,C[1]*(1-(C-C[1])/C[1]),C[1]*(1-(C-C[1])/C[1]),10,0),colormagenta,LINETHICK1;涨停n=BARSLAST(涨停,0);IF(涨停n>0 AND 涨停n<=20){ 涨停倒影=C[涨停n+1]*(1-(C[涨停n]-C[涨停n+1])/C[涨停n+1]); 涨停判断=C>C[1] AND C>涨停倒影 AND C[1]<1.05*涨停倒影 AND C[1]>0.97*涨停倒影; 涨停判断2=C>=O AND C>涨停倒影 AND L<1.05*涨停倒影 AND L>0.97*涨停倒影; 涨停判断总=HHV(V,20)=V[涨停n] AND HHV(H,20)<1.07*H[涨停n] AND (涨停判断 OR 涨停判断2); STICKLINE(涨停判断总,涨停倒影,涨停倒影,20*涨停n,0),coloryellow,LINETHICK2; DRAWICON(涨停判断总,MIN(0.99*涨停倒影,0.97*L),7);}临界:=(CROSS(C,MA36) AND MA11<MA36 AND C>(REF(L,1)+REF(H,1))/2) OR (L<MA36 AND C>MA36 AND CROSS(MA11,MA36) AND C>(REF(L,1)+REF(H,1))/2);DRAWGBK(C>=MA11 AND C>=MA36 AND C>=MA5),color007700;DRAWGBK(C>=MA11 AND C>=MA36 AND C<MA5),color005500;DRAWGBK(C>=MA11 AND C<MA36 AND MA11<MA36),color666666;DRAWGBK(C<MA11 AND C>=MA36 AND MA11>=MA36),color550000;DRAWGBK(临界),colormagenta;DRAWTEXT(临界,0.99*L,'临界'),colorwhite;IF(ISLASTBAR){ 临界n=BARSLAST(临界,0); IF(临界n==0){ 临界n=BARSLAST(临界,1); } STICKLINE(临界n>0,H[临界n],H[临界n],20*临界n,0),colorred,LINETHICK2; STICKLINE(临界n>0,L[临界n],L[临界n],20*临界n,0),colorgreen,LINETHICK2;}均线死叉:=CROSS(MA36,MA11);均线死叉n:=BARSLAST(均线死叉,0);临界n=BARSLAST(临界,0);买点:=C>=MA11 AND C<MA36 AND MA11<MA36 AND CROSS(C,MA11);IF(买点){ X1:=BARSLAST(买点,1); 试错买点=均线死叉n>X1 OR 临界n<均线死叉n; DRAWTEXT(试错买点,0.99*L,'①'),colorwhite;}二买点=临界n>1 AND CROSS(C,H[临界n]) AND C>MA11;二买点2=临界n=1 AND L<H[临界n] AND C>H[临界n] AND C>MA11;DRAWTEXT(二买点 OR 二买点2,100,'②'),colorwhite;三买点=临界n>1 AND CROSS(C,MA11) AND C>H[临界n] AND C[1]>H[临界n] AND MA11>MA36;DRAWTEXT(三买点,0.99*L,'③'),colorwhite; 通达信主图代码123456789101112131415161718192021222324252627282930313233343536373839404142434445MA5:MA(CLOSE,5),COLORWHITE,LINETHICK1;MA11:MA(CLOSE,11),COLORMAGENTA,LINETHICK2;MA36:MA(CLOSE,36),COLORLIGREEN,LINETHICK3;涨停:=C>=1.096*REF(C,1);STICKLINE(涨停,MAX(O,L),MIN(H,C),5,0),COLORYELLOW;临界:=(CROSS(C,MA36) AND MA11<MA36 AND C>(REF(L,1)+REF(H,1))/2) OR (L<MA36 AND C>MA36 AND CROSS(MA11,MA36) AND C>(REF(L,1)+REF(H,1))/2);XXX:=BACKSET(ISLASTBAR,BARSLAST(临界)+1);DDD:=XXX>REF(XXX,1);STICKLINE(C,REF(H,BARSLAST(DDD))*1.00002,REF(H,BARSLAST(DDD))*0.999998,5,-1),COLORWHITE;STICKLINE(C,REF(L,BARSLAST(DDD))*1.00002,REF(L,BARSLAST(DDD))*0.999998,5,-1),COLORWHITE;DRAWTEXT(临界,LOW*0.99,'临界'),COLORYELLOW;DRAWTEXT_FIX(ISLASTBAR,0,0,0,HYBLOCK);DRAWTEXT_FIX(ISLASTBAR,0,0.05,0,GNBLOCK);ZT:=C>=1.096*REF(C,1),NODRAW;STICKLINE(ZT,O,REF(C,1)*1.1,1,0),COLORYELLOW;STICKLINE(ZT,REF(C,1)/1.09999,REF(C,1)/1.1,3,1),COLORYELLOW;{涨停倒影划线};F1:ZIG(3,15),DOTLINE,COLORLIGRAY;DRAWTEXT(CROSS(REF(F1,1),F1),1.01*REF(H,1),REF(C,1)),COLORRED;DRAWTEXT(CROSS(F1,REF(F1,1)),0.99*REF(L,1),REF(C,1)),COLORCYAN;STICKLINE(CROSS(REF(F1,1),F1) AND V>REF(V,1) AND V>REF(V,2),L,L,60,0),COLORGREEN;STICKLINE(CROSS(REF(F1,1),F1) AND REF(V,1)>V AND REF(V,1)>REF(V,2),REF(L,1),REF(L,1),60,0),COLORGREEN;STICKLINE(CROSS(REF(F1,1),F1) AND REF(V,2)>V AND REF(V,2)>REF(V,1),REF(L,2),REF(L,2),60,0),COLORGREEN;STICKLINE(CROSS(F1,REF(F1,1)) AND V<REF(V,1) AND V<REF(V,2),H,H,60,0),COLORRED;STICKLINE(CROSS(F1,REF(F1,1)) AND REF(V,1)<V AND REF(V,1)<REF(V,2),REF(H,1),REF(H,1),60,0),COLORRED;STICKLINE(CROSS(F1,REF(F1,1)) AND REF(V,2)<V AND REF(V,2)<REF(V,1),REF(H,2),REF(H,2),60,0),COLORRED;临界N:=BARSLAST(临界);均线死叉:=CROSS(MA36,MA11);均线死叉N:=BARSLAST(均线死叉);一买点:=C>=MA11 AND C<MA36 AND MA11<MA36 AND CROSS(C,MA11);DRAWTEXT(一买点,0.995*L,'①'),COLORWHITE;{第二个①开始为实际的一买试错位置}二买点:=临界N>1 AND CROSS(C,REF(H,临界N)) AND C>MA11 AND NOT(临界N>0 AND 均线死叉N<临界N);DRAWTEXT(二买点,0.995*L,'②'),COLORWHITE;三买点:=临界N>1 AND CROSS(C,MA11) AND C>REF(H,临界N) AND REF(C,1)>REF(H,临界N) AND MA11>MA36;DRAWTEXT(三买点,0.995*L,'③'),COLORWHITE; ------本文结束感谢阅读------