{趋势彩带 N=10}
N:=10;
TS:=130;
NNN:=99;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/10);
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE),LINETHICK0;
L2:=REFDATE(HHV(LH2,DA),DATE),LINETHICK0;
L3:=REFDATE(HHV(LH3,DA),DATE),LINETHICK0;
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*NNN/100,(HI/GZ),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*NNN/100,HI/POW(GZ,2),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*NNN/100,HI/POW(GZ,3),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*NNN/100,HI/POW(GZ,4),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*NNN/100,HI/POW(GZ,5),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*NNN/100,HI/POW(GZ,6),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*NNN/100,HI/POW(GZ,7),1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*NNN/100,1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*NNN/100,1,1),COLOR454545,LINETHICK1;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*NNN/100,1,1),COLOR454545,LINETHICK1;
NN:=125;
最高:=CONST(HHV(H,NN));
最低:=CONST(LLV(L,NN));
RCC:=最高*0.9-(最高-最低);
RHL:=RCC;
HLMAX:=最高;
HLMIN:=最低;
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=HLMAX-HLMIN;
HLMN3:=(100-0)/2*1.3;
HLMN4:=(100-0)/1*1.3;
位1:=(40-HLMN3)*HLMN2/HLMN4+HLMN1;
位2:=(60-HLMN3)*HLMN2/HLMN4+HLMN1;
位A:=CONST(IF(REF(C,30)>HLMN1,位1,位2)),NODRAW;
JRH:=HHV(C,2);
JRL:=LLV(C,2);
MA3:=MA(CLOSE,3);
YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6;
R1:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2));
R2:=(REF(R1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R3:=(REF(R2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R4:=(REF(R3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R5:=(REF(R4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R6:=(REF(R5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R7:=(REF(R6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R8:=(REF(R7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R9:=(REF(R8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RA:=(REF(R9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
RB:=(REF(RA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RC:=(REF(RB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
RD:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2));
RE:=(REF(RD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
RF:=(REF(RE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R10:=(REF(RF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R11:=(REF(R10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R12:=(REF(R11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R13:=(REF(R12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R14:=(REF(R13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R15:=(REF(R14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R16:=(REF(R15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R17:=(REF(R16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
R18:=(REF(R17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
R19:=REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1) AND R1;
R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);
红持股:=R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,NODRAW,COLOR0000FF;
阴观望:=RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,NODRAW,COLOR999999;
离场:=IF(红持股,JRL,DRAWNULL);
今离场价:=REF(离场,1),COLOR0000FF,NODRAW;
进:=IF(阴观望,JRH,DRAWNULL);
明进场价:=进,COLOR33AACC,NODRAW;
今进场价:=REF(明进场价,1),COLOR00FF00,NODRAW;
MA5:=MA(CLOSE,5),LINETHICK2;
MA13:=MA(CLOSE,13),LINETHICK2;
DRAWBAND(MA5,RGB(80,80,80),MA13,RGB(0,80,0));
GJ:=(C+H+L+O)/4;
日阻力:=L+(GJ-L)+(C-L),LINETHICK0;
日支撑:=L+(C-GJ),LINETHICK0;
日压:=REF(日阻力 , 1),NODRAW,COLOR00FF00;
日支:=REF(日支撑 , 1),NODRAW,COLORYELLOW;
STICKLINE(ISLASTBAR,日压,日压,30,1),LINETHICK2,COLOR00FF00;
STICKLINE(ISLASTBAR,日支,日支,30,1),LINETHICK2,COLORYELLOW;
中压:=XMA(GJ,20)*(1+80/1000),COLORGREEN,LINETHICK2;
中支:=XMA(GJ,32)*(1-100/1000),COLORMAGENTA,LINETHICK2;
幅度:=100*(中压-中支)/中支;
分水线:=(MA(CLOSE,3)+MA(CLOSE,7)+MA(CLOSE,13)+MA(CLOSE,18))/4;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDD1:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
压力:=IF(CROSS(D24,DDD1),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDD1)))),COLORFFFFFF;
决策:=IF(ISLASTBAR,压力,DRAWNULL),COLORMAGENTA;
STICKLINE(ISLASTBAR ,决策,决策,60,1),LINETHICK3,COLORMAGENTA;
底部:=LLV(HIGH,30),COLOR00FF00;
超跌:=IF(ISLASTBAR,底部,DRAWNULL),COLORRED;
STICKLINE(ISLASTBAR ,超跌,超跌,60,1),LINETHICK3,COLORRED;
ZF:=(EMA(SUM(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),49) * 10)+EMA(C,20);
飞扬古:=(EMA(MA(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),13) * 10000),LINETHICK0,COLORFFFFFF;
【康熙帝】:=EMA(ZF,34),LINETHICK2,COLOR00FFFF;
ZFF:=(EMA(SUM(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),49) * 10000);
康熙帝:=EMA(ZFF,34),LINETHICK0,COLOR00FFFF;
{大1:=MA(ZFF,3);
旗1:=MA(大1,3);
展1:=MA(旗1,3);}
大:MA(ZF,3),COLOR66DDFF;
旗:MA(大,3),COLOR66CCFF;
展:MA(旗,3),COLOR66AAFF;
热:MA(展,3),COLOR9900FF;
血:MA(热,3),COLOR7700FF;
染:MA(血,3),COLOR0000FF;
IF(大<REF(大,1),大,DRAWNULL),COLORFFFCCC;
IF(旗<REF(旗,1),旗,DRAWNULL),COLORFFFBBB;
IF(展<REF(展,1),展,DRAWNULL),COLORFFF999;
IF(热<REF(热,1),热,DRAWNULL),COLORFFF888;
IF(血<REF(血,1),血,DRAWNULL),COLORFFF777;
IF(染<REF(染,1),染,DRAWNULL),COLORFFF555;
NOTEXT8:MA(EMA(CLOSE,60),1),LINETHICK1,COLORMAGENTA;
NOTEXT10:MA(EMA(CLOSE,60),5),LINETHICK1.8,COLORMAGENTA;
NOTEXT12:MA(EMA(CLOSE,60),9),LINETHICK1.4,COLORMAGENTA;
NOTEXT14:MA(EMA(CLOSE,60),13),LINETHICK2,COLORMAGENTA;
VAR3:=CLOSE=LLV(C,4) AND (REF(C,1)<REF(C,2) OR REF(C,1)<REF(C,3)) OR
C<REF(C,1) AND C<REF(C,2);
VAR4:=REF(C,1)=LLV(C,4) AND C>=REF(C,2) OR REF(C,2)=LLV(C,4) AND
{涨停}
STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,4,-1),COLORRED;
{跌停}
STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,4,-1),COLORGREEN;
DRAWKLINE(H,O,L,C);
{蓝}
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3.3,0),COLORFF7700;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.4,0),COLORFF9900;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1.3,0),COLORFFBB00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,0.8,0),COLORCYAN;
{红}
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.3,0),COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.4,0),COLOR0000CC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.3,0),COLOR0000FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.8,0),COLORCC66FF;
{绿}
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR009900;
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,2.4,0),COLOR00BB00;
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,1.3,0),COLOR00DD00;
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,0.8,0),COLOR00FF00;
{灰}
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR999999;
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,2.2,0),COLORBBBBBB;
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,1.3,0),COLORDDDDDD;
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,0.8,0),COLORFFFFFF;
AA:=REF(H,N)=HHV(H,2*N+1); AA1:=REF(L,N)=LLV(L,2*N+1);
QY:=BACKSET(AA,N+1); QY1:=BACKSET(AA1,N+1);
CC:=FILTER(QY,N) AND H=HHV(H,N+1); CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);
DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);
GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));
DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);
M:=INTPART(3*N/5);
AAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC),NODRAW;
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M)=LLV(L,2*M+1);
QY11:=BACKSET(AA11,M+1);
CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
ZGD:=HHV(H,60)*1.01.00;
ZGD2:=CONST(ZGD);
高点:=CONST(HHV(H,100)),NODRAW;
低点:=CONST(LLV(L,100)),NODRAW;
高点压力M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;
低点支撑M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;
高点压力1:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;
低点支撑1:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;
IF(BETWEEN(高点压力M,高点,低点),高点压力M,DRAWNULL),COLORWHITE,LINETHICK1;
IF(BETWEEN(低点支撑M,高点,低点),低点支撑M,DRAWNULL),COLORWHITE,LINETHICK1;
{T1:=CONST(IF(ISLASTBAR AND (红持股 OR REF(红持股,1)=1),1,0));
T2:=CONST(IF(ISLASTBAR AND (阴观望 OR REF(阴观望,1)=1),1,0));};