通达信信号K线主图 源码
自己用着还行,给大家分享一下
源码如下:
M5:MA(CLOSE,5);
M10:MA(CLOSE,10);
M20:MA(CLOSE,20);
M30:MA(CLOSE,30);
M60:MA(CLOSE,60);
M120:MA(CLOSE,120);
M250:MA(CLOSE,250);
中线【买入】:=COUNT(CLOSE<M20,5)=4 AND CLOSE/M20>1.004 AND CROSS(CLOSE,M20) AND M20>=REF(M20,1),LINETHICK,COLORRED;
DRAWTEXT(中线【买入】,LOW*0.95,' 中线【买入】'),COLORRED;
VL:=REF(LOW,1);
VAR112:=(SMA(ABS(LOW-VL),13,1))/(SMA(MAX(LOW-VL,0),13,1))*100;
VAR114:=MA(VAR112,13);
VAR115:=LLV(LOW,34);
VAR118:=EMA(IF(LOW<=VAR115,VAR114,0),3);
VAR110:=SMA(SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1),5,1);
VAR111:=SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1)*16.18-VAR110*10.9;
T:=FILTER(IF(VAR111<=VAR110 AND VAR118>REF(VAR118,1),VAR118*8,0),20);
DRAWTEXT(T,LOW-0.5,'←洗盘结束'),COLORFF00FF;
DRAWTEXT(T,LOW-0.3,'|'),COLORFF00FF;
VAR21:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW,36))*100;
VAR22:=SMA(VAR21,3,1);
VAR23:=SMA(VAR22,3,1);
VAR24:=SMA(VAR23,3,1);
VAR25:=CROSS(VAR23,VAR24) AND VAR23<20;
DRAWTEXT(FILTER(VAR25,10)=1,LOW-0.5,'←抄底'),COLORRED;
DRAWTEXT(FILTER(VAR25,10)=1,LOW-0.3,'|'),COLORRED;
VAR29:=CROSS(VAR24,VAR23) AND VAR23>80;
DRAWTEXT(FILTER(VAR29,5)=1,HIGH+0.5,'←逃'),COLORGREEN;
JG:=CROSS(M5,M10);
VOLUME:=VOL,VOLSTICK;
MAVOL1:=MA(VOLUME,5);
MAVOL2:=MA(VOLUME,10);
NL:=CROSS(MAVOL1,MAVOL2);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2,COLORSTICK;
NA:=CROSS(DIF,DEA);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,9,1);
D:=SMA(K,9,1);
J:=3*K-2*D;
KD:=CROSS(K,D) AND CROSS(J,D);
一招定乾坤:DRAWTEXT((JG AND NL AND NA) OR (JG AND NL AND KD) OR
(JG AND NA AND KD) OR (NL AND NA AND KD),L*0.95,'←一招定乾坤'),COLORYELLOW;
X:=LLV(J,2)=LLV(J,8);
Y:=IF(CROSS(J,REF(J+0.01,1)) AND X AND J<20,30,0);
DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND X AND J<20,LOW*0.98,'←短进'),COLORLIMAGENTA;
空:=EMA(C,5);
均衡:=EMA(空,5);
中轨:=HHV(MA(H,13),13);
VAR5:=FILTER(均衡>REF(均衡,1)AND 中轨<REF(中轨,1)AND C>REF(C,1),11);
DRAWTEXT(VAR5,L*0.98,'←追涨'),COLORRED;
PT:=EMA(H,20);
PAN:=EMA(CLOSE,7);
RUO:=MEMA(CLOSE,3);
DRAWICON(LONGCROSS(PAN,RUO,0.25) AND PT>H ,L*0.98,1);
VARC:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100;
DRAWTEXT(CROSS(84,VARC),H*1.01,'逃'),COLORYELLOW ;
AAA:=CONST(HHV(H,90));
R1:=MA(CLOSE,1);
R2:=MA(CLOSE,3);
R3:=(MA(R2,1)*1);
R4:=(MA(R2,3)*1);
DRAWTEXT(CROSS(R3,R4),(LOW-0.1),'进场'),COLORYELLOW;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'出局'),COLORGREEN;
VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
VAR12:=(HIGH+LOW+CLOSE)/3;
VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));
VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));
VAR15:=IF(VAR13>=150 AND VAR13<200 AND VAR14>=150 AND VAR14<200,10,0);
VAR16:=IF(VAR13<=-150 AND VAR13>-200 AND VAR14<=-150 AND VAR14>-200,-10,VAR15);
VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VAR18:=100-ABS(VAR17);
VAR19:=IF(VAR18<90,VAR18,100);
VAR1A:=IF(VARE>0,VARE,0);
VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;
DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,HIGH*1.02,'大笔出货'),LINETHICK1,COLORFFCC66;
AA1:=AMOUNT/V;
BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD1:=L<MA(C,5)*0.921;
EE1:=V<MA(V,5)*1.5;
老鼠仓:=BB1 AND CC1 AND DD1 AND EE1,LINETHICK0;
DRAWTEXT(老鼠仓,(LOW* 0.99),'老鼠仓'),COLOR40CCFF;
A75:=(CLOSE > M5);
A76:=(M5 > M10);
A77:=(CLOSE > M10);
A78:=(M5 > M20);
A79:=(CLOSE > M20);
A710:=REF(M20,1);
A711:=(M20 > A710);
AVX:=(((((IF(A75,10,(0 - 10)) + IF(A76,10,(0 - 10))) + IF(A77,10,(0 - 10)))
+ IF(A78,10,(0 - 10))) + IF(A79,10,(0 - 10))) + IF(A711,10,(0 - 10)));
DSLX:=(CLOSE / INDEXC);
DSLX1:=MA(DSLX,5);
DSLX2:=MA(DSLX,10);
V1:=MA(VOL,5);
V2:=MA(VOL,10);
T1:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T2:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T3:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 > V2)) AND (DSLX < DSLX1)),1,0));
T4:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 <= V2)) AND (DSLX < DSLX1)),1,0));
T5:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T6:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T7:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T8:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T9:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T10:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T11:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T12:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T13:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T14:=CONST(IF( C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T15:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T16:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T17:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 >= V2)),1,0));
T18:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 >= V2)),1,0));
T19:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 < V2)),1,0));
T20:=CONST(IF(C>200 AND (CROSS(1,AVX) AND (V1 >= V2)),1,0));
T21:=CONST(IF(C>200 AND (CROSS(1,AVX) AND (V1 < V2)),1,0));
T22:=CONST(IF(C>200 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)),1,0));
T23:=CONST(IF(C>200 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)),1,0));
T24:=CONST(IF(C>200 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)),1,0));
T25:=CONST(IF(C>200 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)),1,0));
DRAWTEXT(T1=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'量能理想,明显走强,中线参与,仓位在2/3左右。'),COLORFF00FF ;
DRAWTEXT(T2=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'走势趋强,还显不足,短线进场,仓位在1/2左右。'),COLORFF00FF ;
DRAWTEXT(T3=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'量价良好,没有明显走强,短线进场,仓位1/2左右。'),COLORFF00FF ;
DRAWTEXT(T4=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'形态尚可,量能不足,未完全走强,短线参与,仓位1/3左右。'),COLORFF00FF ;
DRAWTEXT(T5=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'形态变坏,重仓者减持大半,清仓者观望。'),COLORFF00FF ;
DRAWTEXT(T6=1 AND CURRBARSCOUNT=70,AAA*0.98
,'随大盘一起下跌,明显缩量走势,考虑到风险,减持或清仓。'),COLORFF00FF ;
DRAWTEXT(T7=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股放量下跌,走势明显偏弱,离场观望。'),COLORFF00FF ;
DRAWTEXT(T8=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股缩量下跌,走势偏弱,离场观望。'),COLORFF00FF ;
DRAWTEXT(T9=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股形态良好,强势明显,量能充足,可以继续持有。'),COLORFF00FF ;
DRAWTEXT(T10=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'上行趋势不变,强势依然,量能开始转弱,注意风险。'),COLORFF00FF ;
DRAWTEXT(T11=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股仍然具备上涨潜力,但股性偏弱,可考虑减仓。'),COLORFF00FF ;
DRAWTEXT(T12=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股走势趋弱,量能不足,减持大部分筹码。'),COLORFF00FF ;
DRAWTEXT(T13=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股形态不佳,注意成交量的变化,目前不适合参与。'),COLORFF00FF ;
DRAWTEXT(T14=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'趋势不明,股价偏弱,注意量能变化,目前不宜参与。'),COLORFF00FF ;
DRAWTEXT(T15=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'有走强迹象,但量能不足,趋势不明,不适合操作。'),COLORFF00FF ;
DRAWTEXT(T16=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'该股走势太弱,没有参与价值。'),COLORFF00FF ;
DRAWTEXT(T17=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘理想,有明显走强迹象,中线参与,仓位在2/3左右。'),COLORFF00FF ;
DRAWTEXT(T18=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'如前期经过一轮下跌,最佳买点,前期有过一段涨幅需谨慎。'),COLORFF00FF ;
DRAWTEXT(T19=1 AND CURRBARSCOUNT=120,AAA-(AAA*0.03)
,'考虑短线进场,仓位在1/2左右,一旦量能放大,加仓买入。'),COLORFF00FF ;
DRAWTEXT(T20=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘形态走坏,重仓者可以减去大部分仓位。'),COLORFF0000 ;
DRAWTEXT(T21=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘缩量调整,注意风险,短线清仓观望。'),COLORFF0000 ;
DRAWTEXT(T22=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘走势良好,量能理想,可以继续持有强势股。'),COLORFF0000 ;
DRAWTEXT(T23=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘形态良好,但量能稍显不足,随时准备减仓。'),COLORFF0000 ;
DRAWTEXT(T24=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘趋势不明,注意成交量变化,目前不适宜进场。'),COLORFF0000 ;
DRAWTEXT(T25=1 AND CURRBARSCOUNT=70,AAA-(AAA*0.03)
,'大盘趋势向下,量能萎缩,不适合进场。'),COLORFF0000 ;
BBB:=CONST(LLV(L,100));
DRAWKLINE(H,O,L,C);
大盘:=EMA(INDEXC,500)/EMA(C,500);
大盘线:=INDEXC/大盘,LINETHICK1,COLOR0066FF;
大盘线1:=MA((INDEXC/大盘),5),COLORGREEN;
TT1{早晨之星}:=CONST(IF((大盘线>=REF(大盘线,1) AND CROSS (大盘线,大盘线1)),1,0));
TT3{长十字}:=CONST(IF((大盘线<=REF(大盘线,1) AND CROSS (大盘线1,大盘线)),1,0));
TSR1:=IF(TT1=1,0+0.03,0);
TSR3:=IF(TT3=1,TSR1+0.03,TSR1);
DRAWTEXT(TT1=1 AND CURRBARSCOUNT=38,AAA-(AAA*TSR1),'大盘多头攻击,机会出现,买股'),COLORFF00FF;
DRAWTEXT(TT3=1 AND CURRBARSCOUNT=38,AAA-(AAA*TSR3),'大盘空头攻击,无机会,出局'),COLOR00FFFF;