N:=7;
M:=3;
STICKLINE(C>0,90,95,10,0),COLOR408000;
STICKLINE(C>0,10,5,10,0),COLOR408000;
HDY:=EMA (100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);
DRAWBAND(HDY,RGB(255,000,139),10,RGB(255,000,139));
STICKLINE(C>0,90,10,10,2),COLOR000000;
STICKLINE((HDY >10),10,HDY*0.98,2,0),COLOR603000;
STICKLINE((HDY >10),10,HDY*0.6,2,0),COLOR754F00;
STICKLINE((HDY >10),10,HDY*0.4,2,0),COLORC66300;
STICKLINE((HDY >10),10,HDY*0.2,2,0),COLORFF962D;
A1:=(((2 * CLOSE) + HIGH) + LOW) / 4;
A2:=LLV(LOW,34);
A3:=HHV(HIGH,34);
A4:=EMA((((A1 - A2) / (A3 - A2)) * 100),10);
A5:=EMA(((0.668 * (REF(A4,1))) + (0.334 * A4)),2);
A6:=(HHV(HIGH,9)) - (LLV(LOW,9));
A7:=(HHV(HIGH,9)) - CLOSE;
A8:=CLOSE - (LLV(LOW,9));
A9:=((A7 / A6) * 100) - 70;
A10:=((CLOSE - (LLV(LOW,60))) / ((HHV(HIGH,60)) - (LLV(LOW,60)))) * 100;
A11:=SMA((
(A8 / A6) * 100),3,1);
A12:=(SMA(A11,3,1)) - (SMA(A9,9,1));
A13:=IF((A12 > 100),(A12 - 100),0);
积差线:EMA((((A1 - A2) / (A3 - A2)) * 100),5),COLORC0C0C0;
趋势线:EMA(积差线,10),COLORGREEN;
红柱:IF((积差线 - 趋势线) > 0,(积差线 - 趋势线),0),LINETHICK0,COLORRED;
绿柱:IF((积差线 - 趋势线) < 0,(Abs(积差线 - 趋势线)),0),LINETHICK0,COLORRED;
STICKLINE(((积差线 - 趋势线) > 0),积差线,趋势线,0.05,-1),COLORRED;
STICKLINE(((积差线 - 趋势线) < 0),积差线,趋势线,0.05,-1),COLORGREEN;
风险值:HDY,COLORFFFF00,LINETHICK1,DOTLINE;
警戒线:45,COLOR0080FF,LINETHICK1,DOTLINE;
火力线:75,COLOR0080FF,LINETHICK1,DOTLINE,COLORYELLOW;
TR1 := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),N);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),N);
pdi: DMP*100/TR1,COLORWHITE;
mdi: DMM*100/TR1,COLORYELLOW;
ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,M),COLORMAGENTA;
ADXR:(ADX+REF(ADX,M))/2,COLORGREEN,DOTLINE;
{底部反抽}
DRAWICON((crOSS(PDI,MDI) AND (LLV(ADX,7)<10 OR LLV(PDI,7)<10)),PDI*0.5,1);
{底部出击}
DRAWICON((CROSS(PDI,MDI) AND (CROSS(PDI,ADX) OR CROSS(ADX,MDI) OR CROSS(ADX,ADXR))
AND (LLV(ADX,7)<10 OR LLV(PDI,7)<10)),0,34);
{汇聚出击}
DRAWICON((CROSS(PDI,MDI) AND (CROSS(PDI,ADX) OR CROSS(ADX,MDI) OR CROSS(ADX,ADXR))
AND C>REF(C,1)*1.015
AND (15<PDI<25 AND 15<PDI<25 AND 15<PDI<25)),70,29);
{盘整飞地}
DRAWICON((CROSS(PDI,MDI) AND CROSS(PDI,ADX) AND LLV(ADX,7)<10),95,30);
DRAWICON(CROSS(MDI,PDI),PDI*1.5,2);
DRAWICON((CROSS(MDI,PDI) AND (CROSS(MDI,ADX) OR CROSS(ADXR,ADX))),5,35);
DRAWICON((CROSS(MDI,PDI) AND CROSS(ADX,PDI)),95,31);