通达信中线抉择主图 源码

[复制链接]
查看155 | 回复0 | 2022-7-24 08:24:24 | 显示全部楼层 |阅读模式

通达信中线抉择主图 源码

参数(S 0 2 2  N 1 100 5)
 A:=BARSCOUNT(C);
 AH:=HHV(HIGH,120);
 AL:=LLV(LOW,120);
 B0:=(AH-AL)/40;
 B1:=HIGH+B0;
 B2:=LOW-B0;
 AMV0:=((VOL * (((OPEN + CLOSE) + HIGH) + LOW)) / 4);
 势:=(EMA(AMV0,21) / EMA(VOL,21));
 N1:=BARSCOUNT(5) ;
 N:=((N1 - CURRBARSCOUNT ) + 1);
 HH:=HHV(HIGH,N);
 LL:=LLV(LOW,N);
 最高:=HHV(N1,1),POINTDOT;
 最低:=LLV(N1,1),COLOR00FFFF;
 DIFF:=(EMA(CLOSE,5) - EMA(CLOSE,26));
 DEA:=EMA(DIFF,3);
 MACD:=(2 * (DIFF - DEA));
 MA5:=MA(CLOSE,5);
 MA20:=MA(CLOSE,20);
 MA120:=MA(CLOSE,120);
 AA10:=MA(CLOSE,10);
 Y:=((LLV(LOW,1) = LLV(LOW,60)) AND ((CLOSE / REF(CLOSE,1)) > 1.04));
 WX:=MA(CLOSE,0);
 MB5:=(MA(CLOSE,15) * IF((20 < 5),WX,1));
 MB7:=(MA(CLOSE,20) * IF((20 < 7),WX,1));
 M5:=(MA(CLOSE,15) * IF((20 < 5),WX,1));
 DDD:=(EMA(CLOSE,10) - EMA(CLOSE,100));
 AMA:=EMA(DDD,4);
 BMA:=(EMA(CLOSE,3) - EMA(CLOSE,30));
 BMB:=EMA(BMA,4);
 BMA1:=(EMA(CLOSE,13) - EMA(CLOSE,30));
 SS:=(MA(CLOSE,8) * 0.998),COLORFFFFFF;
 买:=(DDD >= AMA AND BMA >= BMB);
 HH1:=FILTER(((DDD >= AMA) AND (BMA >= BMB)),33);
 {DRAWICON(HH1,SS,6);}
 VARR1:=((SMA(MAX((CLOSE - REF(CLOSE,1)),0),12,1) / SMA(ABS((CLOSE - REF(CLOSE,1))),12,1)) * 100);
 {DRAWICON(CROSS(82,VARR1),(HIGH * 1.07),5);}
 VAR1:=REF(CLOSE,1);
 VAR2:=((SMA(MAX((CLOSE - VAR1),0),12,1) / SMA(ABS((CLOSE - VAR1)),12,1)) * 100);
 顶部雷达:=(CROSS(80,VAR2) * 1);
 趋势线:=((3 * SMA((((CLOSE - LLV(LOW,28)) / (HHV(HIGH,28) - LLV(LOW,28))) * 100),5,1)) - (2 * SMA(SMA((((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27))) * 100),5,1),3,1)));
 短期乖离率:=(((CLOSE - MA(CLOSE,13)) / MA(CLOSE,13)) * 100);
 {DRAWTEXT(FILTER((IF(((CROSS(趋势线,10) AND ((CLOSE / LOW) > 1.04)) AND (短期乖离率 < 0.35)),1,0) AND (CLOSE > OPEN)),5),(LOW - 0.07),'底'),COLOR00FFFF;}
 VARA:=EMA(((AMOUNT / VOL) / 100),3);
 D:=LLV(CLOSE,20);
 XXY:=EMA(VARA,88);
 XXD:=(XXY * 0.74);
 DRAWTEXT(FILTER(((((((短期乖离率 < 6) AND (OPEN <= D)) AND (LOW <= XXD)) AND ((CLOSE / OPEN) > 1.03)) AND (CLOSE > REF(CLOSE,1))) AND ((CLOSE / LOW) > 1.03)),5),(LOW - (LOW * 0.09)),'★'),COLORFF00FF;
 均价:=((((HIGH + LOW) + OPEN) + CLOSE) / 4);
 B:=((2 * EMA(LLV(均价,88),5)) - 均价);
 黄买:=((3 * B) - (2 * SMA(B,5,1))),COLORFF0033,LINETHICK1;
 Y2:=DRAWTEXT(CROSS(CLOSE,黄买),L*0.97,'● '),COLORFF00FF;
 {DRAWTEXT(CROSS(CLOSE,黄买),L*0.97,'¤ '),COLORMAGENTA;}
 黄点出买:=IF(Y2,L*0.97-0.01,DRAWNULL),CIRCLEDOT,COLOR00FFFF,LINETHICK2;
 买进价:=((C-REF(MA(C,55),1))/6+MA(C,55))*1.004;
 买进条件:=CROSS(C,买进价) AND 买进价>REF(买进价,1);
 买进:STICKLINE(买进条件,H,L,0,0),COLORMAGENTA,LINETHICK2;
 STICKLINE(买进条件,O,C,3,0),COLORMAGENTA,LINETHICK2;
 {DRAWICON(买进条件,L*0.97,1),COLORRED;}
 KS:=(C-MA(C,33))/MA(C,33)*(-200);
 RKS:=REF(KS,1);
 FT:=RKS/KS>=1.23 AND RKS>=8 AND C/REF(C,1)>=1.03;
 反弹:STICKLINE(FT,H,L,0,1),COLORMAGENTA,LINETHICK2;
 STICKLINE(FT,O,C,3,0),COLORYELLOW,LINETHICK2;
 K1:=BACKSET(SS>=REF(SS,1),2),COLORFFFFCC,LINETHICK1;
 红线出买:=IF(K1,SS, DRAWNULL),COLORWHITE,LINETHICK2;
 K2:=BACKSET(SS<=REF(SS,1),2);
 弱:=IF(K2,SS, DRAWNULL),COLORGREEN,LINETHICK2;
 红点出买:IF(买,红线出买*0.988,DRAWNULL),POINTDOT,COLORRED,LINETHICK5;
 VAR10:=MA(C,80)-MA(C,10)/3;
 VAR11:=REF(C,1);
 VAR12:=SMA(MAX(C-VAR11,0),18,1)/SMA(ABS(C-VAR11),18,1)*100;
 高1:=REF(HHV(H,10),20);
 低1:=REF(LLV(L,10),20);
 H1:=高1-(高1-低1)*0.191;
 H2:=高1-(高1-低1)*0.382;
 H3:=高1-(高1-低1)*0.5;
 H4:=高1-(高1-低1)*0.618;
 H5:=高1-(高1-低1)*0.809;
 顶:=REFDATE(高1,DATE),COLORWHITE;
 中线:REFDATE(H1,DATE),COLORGRAY,LINETHICK3;
 DRAWTEXT(ISLASTBAR,中线,'----中线'),COLORYELLOW,LINETHICK4;
 
二:=REFDATE(H2,DATE),COLOR33FF33{MAGENTA},POINTDOT;
 三:=REFDATE(H3,DATE),COLORLIGRAY;
 四:=REFDATE(H4,DATE),COLORRED;
 水平线:REFDATE(H5,DATE),COLORGRAY,LINETHICK2;
 DRAWTEXT(ISLASTBAR,水平线,'水平线'),COLORYELLOW,LINETHICK4;
 低:=REFDATE(低1,DATE),COLORYELLOW,POINTDOT;
 DRAWTEXT( C=C AND CURRBARSCOUNT=50,中线+0.02,'中线'),COLORYELLOW;
 DRAWTEXT( C=C AND CURRBARSCOUNT=20,水平线-0.02,' 水平线'),COLORFFFFCC;
 KSS:=(C-MA(C,33))/MA(C,33)*(-200);
 RKSS:=REF(KSS,1);
 VAR101:=MA(C,80)-MA(C,10)/3;
 VAR111:=REF(C,1);
 VAR122:=SMA(MAX(C-VAR111,0),18,1)/SMA(ABS(C-VAR111),18,1)*100;
 {DRAWICON(CROSS(79,VAR12),H*1.035,2);}
 DRAWTEXT(CROSS(79,VAR122),H*1.04,' 抛↓'),COLOR33FF33;
 {垂直1:=IF(CURRBARSCOUNT=0,REFDATE(HHV(H,240),DATE),DRAWNULL),STICK;
 STICKLINE(低吸,HHV(H,240),LLV(L,240-239),0,0),STICK,COLORCYAN;};
 Y1:=(H+L)/2;
 AO:=MA(Y1 ,5 )-MA(Y ,34 );
 DU0:=CROSS(AO,0);
 UD0:=CROSS(0,AO);
 TDU0:=BARSLAST(DU0);
 TUD0:=BARSLAST(UD0);
 DU3:=REF(DU0,1);
 UD3:=REF(UD0,1);
 TDU3:=BARSLAST(DU3);
 TUD3:=BARSLAST(UD3);
 决策线:IF(TDU3<TUD3,REF(HHV(H,2),TDU3),REF(LLV(L,2),TUD3)),COLORYELLOW;
 DRAWTEXT(ISLASTBAR,决策线,'决策线'),COLORYELLOW;
 
阻力:REFDATE(REF(HHV(H,22),1),DATE),COLORGRAY,LINETHICK4;
 DRAWTEXT(ISLASTBAR,阻力,'----------阻力'),COLORRED,LINETHICK4;
 
底:REFDATE(REF(LLV(L,22),1),DATE),COLORGRAY,LINETHICK4;
 DRAWTEXT(ISLASTBAR,底,'底'),COLORRED,LINETHICK4;
 
AA17:=EMA(C,14)COLORWHITE,LINETHICK1;
 A17X:=(AA17-REF(AA17,1))/REF(AA17,1)*100,NODRAW;
参考线试买:IF(A17X>=0,REF(EMA(C,14),BARSLAST(CROSS(A17X,0))+1),DRAWNULL)COLORRED,LINETHICK1;
   DRAWTEXT(ISLASTBAR,参考线试买,'参考线试买'),COLORRED,LINETHICK1;
 DMLJ:=HHV(H,120);
 E:=(H+L+O+2*C)/5;
CRTP:=E+(H-L);
 CRZL:=2*E-L;
 CRZC:=2*E-H;
 CRFZ:=E-(H-L);
 CRXL:=(E+CRTP+CRZL+CRZC+CRFZ)/5;
 高:=CONST(CRTP),COLORRED;
 阻:=CONST(CRZL),COLORC7C9FF;
 支:=CONST(CRZC),COLOR7C9CFF;
 反:=CONST(CRFZ),COLORDD00DD;
 心理:=CONST(CRXL);
 高压:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,高,ISLASTBAR,高,1),COLOR0000FF;
 阻力1:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,阻,ISLASTBAR,阻,1),COLOR0099FF;
 支撑:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,支,ISLASTBAR,支,1),COLORGREEN;
 反转价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,反,ISLASTBAR,反,1),COLORDD00DD;
 次日心理价:DRAWLINE(S>1&&CURRBARSCOUNT=5+1,心理,ISLASTBAR,心理,1),COLORFFFFFF;
 DRAWTEXT(ISLASTBAR,反,' 反 转买'),LINETHICK1,COLORDD00DD;
 DRAWTEXT(ISLASTBAR,支,' 支 撑'),LINETHICK1,COLOR00FF00;
 DRAWTEXT(ISLASTBAR,阻,' 阻 力1'),LINETHICK1,COLOR0099FF;
 DRAWTEXT(ISLASTBAR,高,' 高 压'),LINETHICK1,COLOR0000FF;
 T1:=CONST(LLVBARS(LOW,10));
 T1HIGH:=CONST(REF(HIGH,T1));
 CC:=CONST(CURRBARSCOUNT);
 T2:=CONST(BARSLAST(CURRBARSCOUNT>CC+T1 AND H>T1HIGH));
 T2HIGH:=CONST(REF(HIGH,T2));
 T3:=CONST(BARSLAST(CURRBARSCOUNT>CC+T2 AND HIGH>T2HIGH));
 T3HIGH:=CONST(REF(HIGH,T3));
 猎击线:DRAWLINE(CURRBARSCOUNT=T3+1, T3HIGH, ISLASTBAR, T3HIGH, 1),COLORGRAY,LINETHICK1;
 DRAWTEXT(ISLASTBAR, T3HIGH, '------------网买入')LINETHICK1,COLORYELLOW;
 IF(S=1, CRTP,DRAWNULL),COLORRED;
 IF(S=1, CRZL,DRAWNULL),COLORC7C9FF;
 IF(S=1, CRZC,DRAWNULL),COLOR7C9CFF;
 IF(S=1, CRFZ,DRAWNULL),COLORDD00DD;
 IF(S=1, CRXL,DRAWNULL),COLORFFDDFF;
 
网12:=EXPMA(CLOSE,12),COLORGRAY,LINETHICK2;
 
网33:EXPMA(CLOSE,33),COLORFF00FF,LINETHICK4;
IF(网33<REF(网33,1),网33,DRAWNULL),COLOR00FF00,LINETHICK3;

 

038499145.PNG

038499145.PNG

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则