通达信射箭封神副图指标
源码
{射箭封神 参数 P:1,100,6 参数 N:1,100,3 参数 RN:1,100,10 参数 RM:1,30,3}
VVAR1:=(MA(CLOSE,80)-MA(CLOSE,13)/3);
VVAR2:=( MA((CLOSE-VVAR1)/VVAR1,1));
VVAR3:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,28)-LLV(LOW,28))*100;
VVAR4:=SMA(VVAR3,4,1);
MMA:=EMA(VVAR2,12)*0.7;
MMB:=EMA(VVAR2,3);
快到底:=IF(LLV(MMB-MMA,12) 0,0,-20),LINETHICK2,COLORGREEN;
底初选股:=IF( CROSS(0, LLV(MMB-MMA,12)),10,0),LINETHICK0;
K:=CEILING(C/10);
DIFF:=( EMA(CLOSE,12) - EMA(CLOSE,26))/K*100+50;
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA)+50;
LC:=REF(CLOSE,1);
RA1:=REF(RSI,N)=HHV(RSI,N*2+1); RA2:=REF(RSI,N)=LLV(RSI,N*2+1);
RB1:=FILTER(RA1,N); RB2:=FILTER(RA2,N);
RC1:=BACKSET(RB1,N+1); RC2:=BACKSET(RB2,N+1);
RD1:=FILTER(RC1,N); RD2:=FILTER(RC2,N);
GD1:=BARSLAST(RD1); DD1:=BARSLAST(RD2);
GDTS:=IF(RD1,CURRBARSCOUNT,0);
DDTS:=IF(RD2,CURRBARSCOUNT,0);
GDT1:=IF(GD1,REF(GDTS,GD1),GDTS);
DDT1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(GDT1); DDCS1:=CONST(DDT1);
GINGBUTS1:=REF(GDT1,GD1+1); DINGBUTS1:=REF(DDT1,DD1+1);
GDCS2:=CONST(GINGBUTS1); DDCS2:=CONST(DINGBUTS1);
GDCS13:=CONST(REF(RSI,GDCS1-1)); DDCS13:=CONST(REF(RSI,DDCS1-1));
GDCS23:=CONST(REF(RSI,GINGBUTS1-1)); DDCS23:=CONST(REF(RSI,DINGBUTS1-1));
XG1:=BACKSET(ISLASTBAR,GDCS1); XD1:=BACKSET(ISLASTBAR,DDCS1);
XG2:=BACKSET(ISLASTBAR,GDCS2); XD2:=BACKSET(ISLASTBAR,DDCS2);
M:=2*N;
RA11:=REF(RSI,M)=HHV(RSI,M*2+1); RA22:=REF(RSI,M)=LLV(RSI,M*2+1);
RB11:=FILTER(RA11,M); RB22:=FILTER(RA22,M);
RC11:=BACKSET(RB11,M+1); RC22:=BACKSET(RB22,M+1);
RD11:=FILTER(RC11,M); RD22:=FILTER(RC22,M),NODRAW;
GD11:=BARSLAST(RD11); DD11:=BARSLAST(RD22);
GDTSS:=IF(RD11,CURRBARSCOUNT,0);
DDTSS:=IF(RD22,CURRBARSCOUNT,0);
GDT11:=IF(GD11,REF(GDTSS,GD11),GDTSS);
DDT11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
GDCS11:=CONST(GDT11); DDCS11:=CONST(DDT11);
GINGBUTS11:=REF(GDT11,GD11+1); DINGBUTS11:=REF(DDT11,DD11+1);
GDCS22:=CONST(GINGBUTS11); DDCS22:=CONST(DINGBUTS11);
{ 方案一,射箭封神的显示部份 }
STICKLINE(MACD =50,50,MACD,3,0),COLOR000055;
STICKLINE(MACD 50,50,MACD,3,0),COLOR555555;
DRAWBAND(DIFF,RGB(255,255,0),DEA,RGB(0,0,220));
RSI:((SMA(MAX((CLOSE - LC),0),P,1) / SMA(ABS((CLOSE - LC)),P,1))
* 100),COLOR0000FF,LINETHICK2;
{80,COLORFF0000,LINETHICK1,POINTDOT;
抄底:IF(快到底 0 AND CROSS(MACD,50) AND VVAR4 18,80,20),COLOR0000FF,POINTDOT;}
高点压力1:DRAWLINE(CURRBARSCOUNT=GDCS2,RSI
,CURRBARSCOUNT=GDCS1,RSI,1) ,COLORFF00FF,LINETHICK2;
低点支撑1:DRAWLINE(CURRBARSCOUNT=DDCS2,RSI
,CURRBARSCOUNT=DDCS1,RSI,1),COLORFF00FF,LINETHICK2;
高点压力2:DRAWLINE(CURRBARSCOUNT=GDCS22,RSI
,CURRBARSCOUNT=GDCS11,RSI,1) ,COLORFF00FF,LINETHICK2;
低点支撑2:DRAWLINE(CURRBARSCOUNT=DDCS22,RSI
,CURRBARSCOUNT=DDCS11,RSI,1),COLORFF00FF,LINETHICK2;
高点压力3:DRAWLINE(CURRBARSCOUNT=GDCS22,RSI
,CURRBARSCOUNT=GDCS2,RSI,1) ,COLORGREEN,LINETHICK1;
低点支撑3:DRAWLINE(CURRBARSCOUNT=DDCS22,RSI
,CURRBARSCOUNT=DDCS2,RSI,1),COLORGREEN,LINETHICK1;
{ ================================================================================================ }
VAR1:=( 399139$C
VAR2:=( 399190$C
VAR3:=( 399132$C
VAR4:=( 399150$C
VAR5:=( 399138$C
VAR6:=( 399200$C
VAR7:=( 399110$C
VAR8:=( 399136$C
VAR9:=( 399135$C
VAR10:=( 399130$C
VAR11:=( 399160$C
VAR12:=( 999999$C
VAR13:=( 399137$C
医药:=SUM((VAR1/REF(VAR1,1)-1)*100,0)*8;
金融:=SUM((VAR2/REF(VAR2,1)-1)*100,0)*8;
纺织:=SUM((VAR3/REF(VAR3,1)-1)*100,0)*8;
建筑:=SUM((VAR4/REF(VAR4,1)-1)*100,0)*8;
机械:=SUM((VAR5/REF(VAR5,1)-1)*100,0)*8;
地产:=SUM((VAR6/REF(VAR6,1)-1)*100,0)*8;
农林:=SUM((VAR7/REF(VAR7,1)-1)*100,0)*8;
电子:=SUM((VAR8/REF(VAR8,1)-1)*100,0)*8;
石化:=SUM((VAR9/REF(VAR9,1)-1)*100,0)*8;
制造:=SUM((VAR10/REF(VAR10,1)-1)*100,0)*8;
运输:=SUM((VAR11/REF(VAR11,1)-1)*100,0)*8;
上证:=SUM((VAR12/REF(VAR12,1)-1)*100,0)*8;
金属:=SUM((VAR13/REF(VAR13,1)-1)*100,0)*8;
{ 方案二,众仙过海的显示部份 }
{医药A:SUM((VAR1/REF(VAR1,1)-1)*100,0)*2+100;
金融A:SUM((VAR2/REF(VAR2,1)-1)*100,0)*2+100,LINETHICK2;
纺织A:SUM((VAR3/REF(VAR3,1)-1)*100,0)*2+100;
建筑A:SUM((VAR4/REF(VAR4,1)-1)*100,0)*2+100;
机械A:SUM((VAR5/REF(VAR5,1)-1)*100,0)*2+100;
地产A:SUM((VAR6/REF(VAR6,1)-1)*100,0)*2+100,LINETHICK2;
农林A:SUM((VAR7/REF(VAR7,1)-1)*100,0)*2+100;
电子A:SUM((VAR8/REF(VAR8,1)-1)*100,0)*2+100;
石化A:SUM((VAR9/REF(VAR9,1)-1)*100,0)*2+100;
制造A:SUM((VAR10/REF(VAR10,1)-1)*100,0)*2+100;
运输A:SUM((VAR11/REF(VAR11,1)-1)*100,0)*2+100,LINETHICK2;
上证A:=SUM((VAR12/REF(VAR12,1)-1)*100,0)*2+100;
金属A:SUM((VAR13/REF(VAR13,1)-1)*100,0)*2+100;}
{ ================================================ }
VAR17:=CONST(MA(医药,RN));
VAR18:=CONST(MA(金融,RN));
VAR19:=CONST(MA(纺织,RN));
VAR20:=CONST(MA(建筑,RN));
VAR21:=CONST(MA(机械,RN));
VAR22:=CONST(MA(地产,RN));
VAR23:=CONST(MA(农林,RN));
VAR24:=CONST(MA(电子,RN));
VAR25:=CONST(MA(石化,RN));
VAR26:=CONST(MA(制造,RN));
VAR27:=CONST(MA(运输,RN));
VAR28:=CONST(MA(上证,RN));
VAR29:=CONST(MA(金属,RN));
P1:=IF(BARSLAST(CURRBARSCOUNT=4+1)*2,1,0);
P2:=IF(BARSLAST(CURRBARSCOUNT=6+2)*2,1,0);
P3:=IF(BARSLAST(CURRBARSCOUNT=8+3)*2,1,0);
P4:=IF(BARSLAST(CURRBARSCOUNT=10+4)*2,1,0);
P5:=IF(BARSLAST(CURRBARSCOUNT=12+5)*2,1,0);
P6:=IF(BARSLAST(CURRBARSCOUNT=14+6)*2,1,0);
P7:=IF(BARSLAST(CURRBARSCOUNT=16+7)*2,1,0);
P8:=IF(BARSLAST(CURRBARSCOUNT=18+8)*2,1,0);
P9:=IF(BARSLAST(CURRBARSCOUNT=20+9)*2,1,0);
P10:=IF(BARSLAST(CURRBARSCOUNT=22+10)*2,1,0);
P11:=IF(BARSLAST(CURRBARSCOUNT=24+11)*2,1,0);
P12:=IF(BARSLAST(CURRBARSCOUNT=26+12)*2,1,0);
P13:=IF(BARSLAST(CURRBARSCOUNT=28+13)*2,1,0);
P14:=IF(BARSLAST(CURRBARSCOUNT=2)*2,1,0);
STICKLINE(医药,0,IF(P2-P1,CONST(医药)-(VAR17),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(金融,0,IF(P3-P2,CONST(金融)-(VAR18),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(纺织,0,IF(P4-P3,CONST(纺织)-(VAR19),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(建筑,0,IF(P5-P4,CONST(建筑)-(VAR20),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(机械,0,IF(P6-P5,CONST(机械)-(VAR21),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(地产,0,IF(P7-P6,CONST(地产)-(VAR22),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(农林,0,IF(P8-P7,CONST(农林)-(VAR23),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(电子,0,IF(P9-P8,CONST(电子)-(VAR24),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(石化,0,IF(P10-P9,CONST(石化)-(VAR25),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(制造,0,IF(P11-P10,CONST(制造)-(VAR26),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(运输,0,IF(P12-P11,CONST(运输)-(VAR27),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(上证,0,IF(P1-P14,CONST(上证)-(VAR28),DRAWNULL),5,-1),COLORFF00FF;
STICKLINE(金属,0,IF(P13-P12,CONST(金属)-(VAR29),DRAWNULL),5,-2),COLORFF00FF;
STICKLINE(医药,0,IF(P2-P1,CONST(MA(医药,RM))-(VAR17),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(金融,0,IF(P3-P2,CONST(MA(金融,RM))-(VAR18),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(纺织,0,IF(P4-P3,CONST(MA(纺织,RM))-(VAR19),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(建筑,0,IF(P5-P4,CONST(MA(建筑,RM))-(VAR20),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(机械,0,IF(P6-P5,CONST(MA(机械,RM))-(VAR21),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(地产,0,IF(P7-P6,CONST(MA(地产,RM))-(VAR22),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(农林,0,IF(P8-P7,CONST(MA(农林,RM))-(VAR23),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(电子,0,IF(P9-P8,CONST(MA(电子,RM))-(VAR24),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(石化,0,IF(P10-P9,CONST(MA(石化,RM))-(VAR25),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(制造,0,IF(P11-P10,CONST(MA(制造,RM))-(VAR26),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(运输,0,IF(P12-P11,CONST(MA(运输,RM))-(VAR27),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(上证,0,IF(P1-P14,CONST(MA(上证,RM))-(VAR28),DRAWNULL),0.8,0),COLORAAAAFF;
STICKLINE(金属,0,IF(P13-P12,CONST(MA(金属,RM))-(VAR29),DRAWNULL),0.8,0),COLORAAAAFF;
DRAWTEXT(P2-P1,-2,' 医'),COLORYELLOW;
DRAWTEXT(P3-P2,-2,' 银'),COLORYELLOW;
DRAWTEXT(P4-P3,-2,' 纺'),COLORYELLOW;
DRAWTEXT(P5-P4,-2,' 建'),COLORYELLOW;
DRAWTEXT(P6-P5,-2,' 机'),COLORYELLOW;
DRAWTEXT(P7-P6,-2,' 地'),COLORYELLOW;
DRAWTEXT(P8-P7,-2,' 农'),COLORYELLOW;
DRAWTEXT(P9-P8,-2,' 电'),COLORYELLOW;
DRAWTEXT(P10-P9,-2,' 化'),COLORYELLOW;
DRAWTEXT(P11-P10,-2,' 制'),COLORYELLOW;
DRAWTEXT(P12-P11,-2,' 运'),COLORYELLOW;
DRAWTEXT(P1-P14,-2,' 上证'),COLORYELLOW;
DRAWTEXT(P13-P12,-2,' 金'),COLORYELLOW;