{分形}
KU1:=IF(HIGH=HHV(HIGH,3),1,0);
KD1:=IF( LOW=LLV( LOW,3),1,0);
UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0)));
DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2), REF(LOW,2+BARSLAST(REF(KD1,2)=1
上分形:IF(HIGH>=MA(CLOSE,3),UL,REF(UL,BARSLAST(HIGH>MA(CLOSE,3)))),LINETHICK0;{分形数字}
下分形:IF( LOW<=MA(CLOSE,3),DL,REF(DL,BARSLAST(LOW<=MA(CLOSE,3)))),LINETHICK0;
STICKLINE(BARSLAST(ABS(上分形-REF(上分形,1)))<BARSLAST(CLOSE>上分形 AND REF(CLOSE,1)<REF(上分形,1)),上分形,上分形,5,1),LINETHICK1;{分形横线}
STICKLINE(BARSLAST(ABS(下分形-REF(下分形,1)))<BARSLAST(CLOSE<下分形 AND REF(CLOSE,1)>REF(下分形,1)),下分形,下分形,5,1),LINETHICK1;
{分形2}
Var1:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3);
Var2:=CROSS(Var1,0.9);
Var3:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
Var4:=CROSS(Var3,0.9);
STICKLINE(CLOSE,REF(HIGH,BARSLAST(Var2)),REF(HIGH,BARSLAST(Var2)),5,0);
STICKLINE(CLOSE,REF(LOW,BARSLAST(Var4)),REF(LOW,BARSLAST(Var4)),5,0);
上分形:REF(HIGH,BARSLAST(Var2)),LINETHICK0;
下分形:REF(LOW,BARSLAST(Var4)),LINETHICK0;
DRAWICON(Var2,HIGH*1.015,8);
DRAWICON(Var4,LOW*0.99,9);