M1:=12;
M2:=50;
M3:=20;
M4:=60;
N:=107;
{背景}
DRAWGBK(O>0,RGB(33,47,58),RGB(0,0,0),0,'02',0);
高:REFDATE(HHV(H,N),DATE);
低:REFDATE(LLV(L,N),DATE);
DRAWTEXT_FIX(1,0.3,0.1,0,STRCAT('K线取数周期:',VAR2STR(N,0))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=N-1,REF(L,1)*0.99,'起点K'),COLORRED;
DRAWICON(CURRBARSCOUNT=N,L*0.99,1);
H1:=高-(高-低)*1.000;
H2:=高-(高-低)*0.875;
H3:=高-(高-低)*0.750;
H4:=高-(高-低)*0.666;
H5:=高-(高-低)*0.625;
H6:=高-(高-低)*0.500;
H7:=高-(高-低)*0.375;
H8:=高-(高-低)*0.333;
H9:=高-(高-低)*0.250;
H10:=高-(高-低)*0.125;
H11:=高-(高-低)*0.000;
STICKLINE(CURRBARSCOUNT=19,高,高,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=19,H1,H1,100,1),COLORCYAN;
STICKLINE(CURRBARSCOUNT=19,H2,H2,100,1),COLORRED;
DRAWTEXT(CURRBARSCOUNT=5,H1,'0.000'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=5,H2,'0.125 ┄ 1/8'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=5,H3,' 0.25 ┄ 1/4'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=5,H4,' 0.333┄ 1/3'),COLOR808080;
DRAWTEXT(CURRBARSCOUNT=5,H5,' 0.375┄ 3/8'),COLOR808080;
DRAWTEXT(CURRBARSCOUNT=5,H6,' 0.50┄ 1/2'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=5,H7,' 0.625┄ 5/8'),COLOR808080;
DRAWTEXT(CURRBARSCOUNT=5,H8,' 0.666┄2/3'),COLOR808080;
DRAWTEXT(CURRBARSCOUNT=5,H9,' 0.75┄ 3/4'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=5,H10,' 0.875┄ 7/8'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=5,H11,' 1.000'),COLORGREEN;
{比例坐标}
STICKLINE(CURRBARSCOUNT=19,H3,H3,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=19,H4,H4,100,1),COLOR808080;
STICKLINE(CURRBARSCOUNT=19,H6,H6,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=19,H5,H5,100,1),COLOR808080;
STICKLINE(CURRBARSCOUNT=19,低,低,100,1),COLORRED;
STICKLINE(CURRBARSCOUNT=19,H7,H7,100,1),COLOR808080;
STICKLINE(CURRBARSCOUNT=19,H8,H8,100,1),COLOR808080;
STICKLINE(CURRBARSCOUNT=19,H9,H9,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=19,H10,H10,100,1),COLORRED;
{价格坐标}
DRAWTEXT(CURRBARSCOUNT=35,高*0.997,CON2STR(高,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=35,H10,CON2STR(H10,2)),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=35,H9,CON2STR(H9,2)),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=35,H8,CON2STR(H8,2)),COLORRED;
DRAWTEXT(CURRBARSCOUNT=35,H1,CON2STR(H1,2)),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=35,H2,CON2STR(H2,2)),COLORRED;
DRAWTEXT(CURRBARSCOUNT=35,H3,CON2STR(H3,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=35,H6,CON2STR(H6,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=35,H4,CON2STR(H4,2)),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=35,H5,CON2STR(H5,2)),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=35,H7,CON2STR(H7,2)),COLORRED;
DRAWTEXT(CURRBARSCOUNT=35,低*1.00,CON2STR(低,2)),COLORGREEN;
{变色K线}
STICKLINE(C>REF(C,1),H,L,0,0),COLOR0099FF;
STICKLINE(C>REF(C,1),C,O,3.2,0),COLOR0000AA;
STICKLINE(C>REF(C,1),C,O,2.7,0),COLOR0000DD;
STICKLINE(C>REF(C,1),C,O,2.1,0),COLOR0022FF;
STICKLINE(C>REF(C,1),C,O,1.5,0),COLOR0066FF;
STICKLINE(C>REF(C,1),C,O,0.9,0),COLOR0099FF;
STICKLINE(C>REF(C,1),C,O,0.3,0),COLOR00DDFF;
STICKLINE(C<REF(C,1),H,L,0,1),COLORFF8800;
STICKLINE(C<REF(C,1),C,O,3.2,0),COLOR990000;
STICKLINE(C<REF(C,1),C,O,2.7,0),COLORCC0000;
STICKLINE(C<REF(C,1),C,O,2.1,0),COLORFF4400;
STICKLINE(C<REF(C,1),C,O,1.5,0),COLORFF8800;
STICKLINE(C<REF(C,1),C,O,0.9,0),COLORFFCC00;
STICKLINE(C<REF(C,1),C,O,0.3,0),COLORFFDD00;
STICKLINE(C=REF(C,1),H,L,0,1),COLORFFFFFF;
STICKLINE(C=REF(C,1),C,O,3.2,0),COLOR555555;
STICKLINE(C=REF(C,1),C,O,2.7,0),COLOR777777;
STICKLINE(C=REF(C,1),C,O,2.1,0),COLOR999999;
STICKLINE(C=REF(C,1),C,O,1.5,0),COLORBBBBBB;
STICKLINE(C=REF(C,1),C,O,0.9,0),COLORDDDDDD;
STICKLINE(C=REF(C,1),C,O,0.3,0),COLORFFFFFF;
EXP1:EMA(CLOSE,M1);
EXP2:EMA(CLOSE,M2);
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
卖:=HHV(DX,2)=HHV(DX,7) AND COUNT(DX>50,2) AND CROSS(MA(DX,2),DX);
DRAWTEXT(FILTER(卖=1,1),HIGH*1.02,'冲高卖'),COLORGREEN;
买1:=LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2));
DRAWTEXT(FILTER(买1=1,5),LOW-0.03,'买'),COLORRED;
势线上轨:=10;
势线下轨:=10;
AA:=REF(H,势线上轨)=HHV(H,2*势线上轨+1);
AA10:=REF(L,势线下轨)=LLV(L,2*势线下轨+1);
QY:=BACKSET(AA,势线上轨+1);
QY1:=BACKSET(AA10,势线下轨+1);
CC:=FILTER(QY,势线上轨) AND H=HHV(H,势线上轨+1);
CC1:=FILTER(QY1,势线下轨) AND L=LLV(L,势线下轨+1);
DDD:=BARSLAST(CC);
DD10:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DDTS1:=IF(DD10,REF(DDTS,DD10),DDTS);
GDCS1:=CONST(DINGBUTS);
DDCS1:=CONST(DDTS1);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
H21:=CONST(REF(HIGH,DINGBUTS1-1)),COLOR888888;
H22:=CONST(REF(HIGH,GDCS1-1)),COLOR888888;
GDCS23:=H21;
GDCS13:=H22;
DDTS2:=REF(DDTS1,DD10+1);
L1:=CONST(REF(L,DDTS2-1));
L2:=CONST(REF(L,DDCS1-1));
压力:BACKSET(ISLASTBAR,GDCS1),COLORFF7766,NODRAW;
支撑:BACKSET(ISLASTBAR,DDCS1),COLOR6699FF,NODRAW;
STICKLINE(压力,GDCS13,GDCS13,3.0,1),COLORFF7766;
STICKLINE(支撑,L2,L2,3.0,1),COLOR6699FF;
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT('[行业]-',HYBLOCK),STRCAT(' [地域]-',DYBLOCK)),STRCAT(' [概念]-',GNBLOCK)));
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');
流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿');
全流通:=STRCAT(' 全流通: ',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');
股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值));
{业绩}
净资收益率:=STRCAT(' 净资收益率: ',CON2STR(FINANCE(29)/FINANCE(19)*100,2));
毛利率:=STRCAT(' 毛利率: ',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
主营利润率:=STRCAT(' 主营利润率 ',CON2STR(FINANCE(23)/FINANCE(20)*100,2));
当前业绩:=STRCAT('当前业绩: ',STRCAT(STRCAT(净资收益率,毛利率),主营利润率));
{主图显示}
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,所属板块),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.12,0,股本市值),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.18,0,当前业绩),COLORGREEN;