通达信射线主图源码

[复制链接]
查看100 | 回复0 | 2021-8-20 04:58:49 | 显示全部楼层 |阅读模式

以下是通达信射线主图源码(无源码的请下载附件导入)

狐有这样的主图,俺也转载了一个通达信的,

 

 强:EMA(SLOPE(C,120)*20+C,35),LINETHICK1,COLORRED;

DRAWNUMBER(ISLASTBAR  ,C,C),COLORMAGENTA;

N8:=STRCAT(CON2STR(YEAR,0),' 年 ');

Y8:=STRCAT(CON2STR(MONTH,0),' 月 ');

R8:=STRCAT(CON2STR(DAY,0),' 日 ');

SJ8:=STRCAT(STRCAT(N8,Y8), R8);

DRAWBMP((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2))

AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),LOW*0.99,'BUY1');

DRAWBMP((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2))

AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),HIGH*1.03,'SELL1');

买进价:=((C-REF(MA(C,6),1))/6+MA(C,6))*1.004;

买进条件:=CROSS(C,买进价) AND 买进价>REF(买进价,1);

加码价:=((C-REF(MA(C,18),1))/18+MA(C,18))*1.004;

加码条件:=CROSS(C,加码价) AND 加码价>REF(加码价,1);

STICKLINE(加码条件,H,L,0,1),COLORYELLOW,LINETHICK2;

STICKLINE(加码条件,O,C,2.5,0),COLORYELLOW,LINETHICK2;

{=====================  股海www.guhai.com.cn  =====================}

范围高A:=REFDATE(HHV(H,120),DATE)*1.05;

范围低A:=REFDATE(LLV(L,120),DATE)*0.95;

MA5:=MA(C,5),COLORCYAN,LINETHICK2;

MA24:=MA(C,24),COLORGREEN,LINETHICK2;

MA72:=MA(C,72),COLORRED,LINETHICK2;

MA200:=IF((MA(C,200)<=范围高A AND MA(C,200)>=范围低A) OR C>=MA(C,200),MA(C,200),DRAWNULL),COLORBLUE,LINETHICK2;

Z1:=STRCAT(DYBLOCK,' ');

Z2:=STRCAT(Z1,HYBLOCK);

Z3:=STRCAT(Z2,' ');

Z4:=STRCAT(Z3,GNBLOCK);

Z5:=STRCAT(Z4,' ');

Z6:=STRCAT(Z5,FGBLOCK);

DRAWTEXT_FIX(ISLASTBAR,0.01,0.012,0,STRCAT(Z6,ZHBLOCK)),COLORCYAN;

DRAWTEXT_FIX(1,0.88,5,0,'股海网www.guhai.com.cn'),COLORRED;

HDAY:=20;

LDAY:=20;

上角度:=70;

下角度:=70;

调点:=3;

CURR:=CURRBARSCOUNT;

TCH:=CONST(FINDHIGH(H,0,HDAY*10,1));

GTT:=CONST(BARSLAST(TCH=H))+1;

SX跌H:=CONST(IF(GTT=1,H,REF(H,GTT-1)));

BCL:=CONST(FINDLOW(L,0,LDAY*10,1));

DTT:=CONST(BARSLAST(BCL=L))+1;

SX涨L:=CONST(IF(DTT=1,L,REF(L,DTT-1)));

涨点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(L=SX涨L)+1));

跌点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(H=SX跌H)+1));

最低:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,涨点,跌点)));

L斜率:=下角度/IF(C<300,1000,10);

最高:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,跌点,涨点)));

H斜率:=上角度/IF(C<300,1000,10);

IM68:=((SX跌H-SX涨L)/8-(SX跌H-SX涨L)/8);

GH跌X:=SX跌H+(SX跌H-SX涨L)/8; DL涨X:=SX涨L-(SX跌H-SX涨L)/8;

GTHT:=IF(DTT>GTT,DTT,GTT); R:=ABS(GTT-DTT);

DRAWBAND(IF(CURR<=GTHT,SX跌H,DRAWNULL),RGB(0,120,120),SX跌H,RGB(8,168,168));

DRAWBAND(IF(CURR<=GTHT,SX涨L,DRAWNULL),RGB(0,120,120),SX涨L,RGB(0,160,160));

STICKLINE(CURRBARSCOUNT=GTT,SX跌H,SX涨L,0,0),COLOR556600;

STICKLINE(CURRBARSCOUNT=DTT,SX跌H,SX涨L,0,0),COLOR666666;

STICKLINE(CURRBARSCOUNT=1,SX跌H,SX涨L,0,0),COLOR556600;

DRAWKLINE(H,O,L,C);

天线:=SX跌H; 地线:=SX涨L;

K:=(天线-地线)/(IF(跌点>=涨点,跌点,涨点)-IF(跌点>=涨点,涨点,跌点));

上斜线:=IF(地线+CONST(L斜率*4.00)*最低>=地线,地线+CONST(L斜率*4.00)*最低,DRAWNULL);

上斜线0:=IF(地线+CONST(L斜率*2.00)*最低>=地线,地线+CONST(L斜率*2.00)*最低,DRAWNULL);

上斜线1:=IF(地线+CONST(L斜率*1.5)*最低>=地线,地线+CONST(L斜率*1.5)*最低,DRAWNULL);

上斜线2:=IF(地线+CONST(L斜率*1.00)*最低>=地线,地线+CONST(L斜率*1.000)*最低,DRAWNULL);

上斜线3:=IF(地线+CONST(L斜率*0.70)*最低>=地线,地线+CONST(L斜率*0.70)*最低,DRAWNULL);

上斜线4:=IF(地线+CONST(L斜率*0.50)*最低>=地线,地线+CONST(L斜率*0.50)*最低,DRAWNULL);

上斜线5:=IF(地线+CONST(L斜率*0.365)*最低>=地线,地线+CONST(L斜率*0.365)*最低,DRAWNULL);

上斜线6:=IF(地线+CONST(L斜率*0.250)*最低>=地线,地线+CONST(L斜率*0.250)*最低,DRAWNULL);

上斜线7:=IF(地线+CONST(L斜率*0.165)*最低>=地线,地线+CONST(L斜率*0.165)*最低,DRAWNULL);

上斜线8:=IF(地线+CONST(L斜率*0.123)*最低>=地线,地线+CONST(L斜率*0.123)*最低,DRAWNULL);

上斜线9:=IF(地线+CONST(L斜率*0.06)*最低>=地线,地线+CONST(L斜率*0.06)*最低,DRAWNULL);

上9:IF(上斜线9<=天线*1.05,上斜线9,DRAWNULL),COLORAA00AA,DOTLINE;

上8:IF(上斜线8<=天线*1.05,上斜线8,DRAWNULL),COLORAA00AA,DOTLINE;

上7:IF(上斜线7<=天线*1.05,上斜线7,DRAWNULL),COLORAA00AA,DOTLINE;

上6:IF(上斜线6<=天线*1.05,上斜线6,DRAWNULL),COLORAA00AA,DOTLINE;

上5:IF(上斜线5<=天线*1.05,上斜线5,DRAWNULL),COLORAA00AA,DOTLINE;

上4:IF(上斜线4<=天线*1.05,上斜线4,DRAWNULL),COLOR00DDDD,DOTLINE;

上3:IF(上斜线3<=天线*1.05,上斜线3,DRAWNULL),COLORAA00AA,DOTLINE;

上2:IF(上斜线2<=天线*1.05,上斜线2,DRAWNULL),COLORAA00AA,DOTLINE;

上1:IF(上斜线1<=天线*1.05,上斜线1,DRAWNULL),COLORAA00AA,DOTLINE;

上0:IF(上斜线0<=天线*1.05,上斜线0,DRAWNULL),COLORAA00AA,DOTLINE;

上:IF(上斜线<=天线*1.05,上斜线,DRAWNULL),COLORAA00AA,DOTLINE;

下斜线:=IF(天线-CONST(H斜率*4.00)*最高<=天线,天线-CONST(H斜率*4.00)*最高,DRAWNULL);

下斜线0:=IF(天线-CONST(H斜率*2.00)*最高<=天线,天线-CONST(H斜率*2.00)*最高,DRAWNULL);

下斜线1:=IF(天线-CONST(H斜率*1.500)*最高<=天线,天线-CONST(H斜率*1.500)*最高,DRAWNULL);

下斜线2:=IF(天线-CONST(H斜率*1.000)*最高<=天线,天线-CONST(H斜率*1.000)*最高,DRAWNULL);

下斜线3:=IF(天线-CONST(H斜率*0.70)*最高<=天线,天线-CONST(H斜率*0.70)*最高,DRAWNULL);

下斜线4:=IF(天线-CONST(H斜率*0.50)*最高<=天线,天线-CONST(H斜率*0.50)*最高,DRAWNULL);

下斜线5:=IF(天线-CONST(H斜率*0.365)*最高<=天线,天线-CONST(H斜率*0.365)*最高,DRAWNULL);

下斜线6:=IF(天线-CONST(H斜率*0.250)*最高<=天线,天线-CONST(H斜率*0.250)*最高,DRAWNULL);

下斜线7:=IF(天线-CONST(H斜率*0.165)*最高<=天线,天线-CONST(H斜率*0.165)*最高,DRAWNULL);

下斜线8:=IF(天线-CONST(H斜率*0.123)*最高<=天线,天线-CONST(H斜率*0.123)*最高,DRAWNULL);

下斜线9:=IF(天线-CONST(H斜率*0.06)*最高<=天线,天线-CONST(H斜率*0.06)*最高,DRAWNULL);

下9:IF(下斜线9>=地线*0.95,下斜线9,DRAWNULL),COLORAAAAAA,DOTLINE;

下8:IF(下斜线8>=地线*0.95,下斜线8,DRAWNULL),COLORAAAAAA,DOTLINE;

下7:IF(下斜线7>=地线*0.95,下斜线7,DRAWNULL),COLORAAAAAA,DOTLINE;

下6:IF(下斜线6>=地线*0.95,下斜线6,DRAWNULL),COLORAAAAAA,DOTLINE;

下5:IF(下斜线5>=地线*0.95,下斜线5,DRAWNULL),COLORAAAAAA,DOTLINE;

下4:IF(下斜线4>=地线*0.95,下斜线4,DRAWNULL),COLOR00DDDD,DOTLINE;

下3:IF(下斜线3>=地线*0.95,下斜线3,DRAWNULL),COLORAAAAAA,DOTLINE;

下2:IF(下斜线2>=地线*0.95,下斜线2,DRAWNULL),COLORAAAAAA,DOTLINE;

下1:IF(下斜线1>=地线*0.95,下斜线1,DRAWNULL),COLORAAAAAA,DOTLINE;

下0:IF(下斜线0>=地线*0.95,下斜线0,DRAWNULL),COLORAAAAAA,DOTLINE;

下:IF(下斜线>=地线*0.95,下斜线,DRAWNULL),COLORAAAAAA,DOTLINE;

NNN:=STRCAT(CON2STR(YEAR,0),' 年 ');

YYY:=STRCAT(CON2STR(MONTH,0),' 月 ');

RRR:=STRCAT(CON2STR(DAY,0),' 日 ');

WWW:=STRCAT('星期',CON2STR(WEEKDAY,0));

 SSS:=STRCAT(STRCAT(STRCAT(NNN,YYY), RRR),WWW);

DRAWTEXT_FIX(C>0,0.77,0,0,SSS);

中中中:=((XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4+(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4)/2,LINETHICK0,COLORGREEN;

EMA中中中:=EMA(中中中,10),LINETHICK0,COLORWHITE;

中中顶:=(XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4*2-(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4,LINETHICK2,COLORGREEN;

中中底:=(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4*2-(XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4,LINETHICK2,COLORGREEN;

短中顶:=(XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5+((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;

短中底:=(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14))/4-((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;

中顶:=(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4*2.03-(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4,LINETHICK2,COLORRED;

中底:=(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4*1.97-(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4,LINETHICK2,COLORRED;

长顶:=(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3*2.08-(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3,LINETHICK2,COLORYELLOW;

长底:=(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3*1.92-(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3,LINETHICK2,COLORYELLOW;

AF长:=EMA((CLOSE+HIGH+LOW)/3,18);

BF长:=REF(AF长,1);

AF中:=EMA((CLOSE+HIGH+LOW)/3,10);

BF中:=REF(AF中,1);

AF5:=EMA((CLOSE+HIGH+LOW)/3,6);

BF5:=REF(AF5,1);

AF3:=EMA((CLOSE+HIGH+LOW)/3,3);

BF3:=REF(AF3,1);

买入定位:=AF长>BF长 OR AF中>BF中 OR AF5>BF5 OR AF3>BF3;

卖出定位:=AF长<BF长 OR AF中<BF中 OR AF5<BF5;

顶底定位:=AF长<BF长 OR AF中<BF中 OR AF5<BF5 OR AF3<BF3;

加仓定位1:=卖出定位=1 AND 中中顶>中顶;

加仓定位2:=顶底定位=1 AND H>中中顶 AND H>中顶;

DRAWTEXT(加仓定位1=0 AND 加仓定位2=0 AND CROSS(AF中,BF中) AND 中中中>=EMA中中中,L*0.995,''),COLORYELLOW;

DRAWTEXT(CROSS(ZIG(3,10),REF(ZIG(3,10),1)),LOW*0.99,'←进场') , COLORRED;

DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.008,'←出局') ,COLORWHITE;  

MA5角度: ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416,NODRAW;

T01:=CONST(LLVBARS(LOW,10));

T1HIGH:=CONST(REF(HIGH,T01));

MM:=CONST(CURRBARSCOUNT);

T02:=CONST(BARSLAST(CURRBARSCOUNT>MM+T01 AND H>T1HIGH));

T2HIGH:=CONST(REF(HIGH,T02));

T03:=CONST(BARSLAST(CURRBARSCOUNT>MM+T02 AND HIGH>T2HIGH));

T3HIGH:=CONST(REF(HIGH,T03));

狙击线:DRAWLINE(CURRBARSCOUNT=T03+1, T3HIGH, ISLASTBAR, T3HIGH,1),COLORYELLOW,DOTLINE;

716466951.png

716466951.png

回复

使用道具 举报

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

本版积分规则