N:=5;
开:SMA(MAX(O-REF(O,1),0),6,1)/SMA(Abs(O-REF(O,1)),6,1)*100 LINETHICK0;
高:SMA(MAX(H-REF(H,1),0),6,1)/SMA(ABS(H-REF(H,1)),6,1)*100 LINETHICK0;
低:SMA(MAX(L-REF(L,1),0),6,1)/SMA(ABS(L-REF(L,1)),6,1)*100 LINETHICK0;
收:SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100 LINETHICK0;
PARTLINE(C,10)pointdot;PARTLINE(C,90)pointdot;
STICKLINE(收>开,高,低,0,0),colorred;
STICKLINE(收>开,收,开,7,1),colorred;
STICKLINE(收< 开,高,低,0,0),COLORgreen;
STICKLINE(收< 开,收,开,7,0),COLORgreen;
50,pointdot;
DRAWTEXT(abs(max(高,低)-开)<14 and (开-收)>17 and REF(收,1)>60 ,80,'★光头开阴'),colorgray;
DRAWTEXT(filter(Min(高,低)<20 and Min(REF(高,1),REF(低,1))<20 and Min(REF(高,2),REF(低,2))<20 and 收>REF(收,1) and c>ma(c,120),5),50,'★买'),colorred;
DRAWTEXT(filter(Min(高,低)<20 and 收>REF(收,1) and c>ma(c,120),5),低,'★买'),colormagenta;
DRAWTEXT((收-低)>25,低-5,'★火箭发射'),colorred;
DRAWTEXT(MAX(高,低)>89 and 收<90 and REF(收,1)>90 and REF(收,2)>90,10,'★逃顶'),colorgreen;
DRAWTEXT(MAX(高,低)>79 and 收<80 and REF(收,1)>80 and REF(收,2)>80 ,10,'★透顶'),colorcyan;
DRAWTEXT(收<90 and 开>90 and REF(收,1)>90 and REF(收,2)>90 ,30,'★天顶'),colorgreen;
DRAWTEXT(收<90 and 开>90 and REF(收,1)>REF(收,3),高+5,'★瀑布'),colorcyan;
{DRAWTEXT(高>50 and 高<80 and (高-MAX(收,开))/(高-低)>0.667 and (ref(高,1)-MAX(ref(收,1),ref(开,1)))/(ref(高,1)-ref(低,1))>0.567 and 高>ref(高,1),高+15,'★调整'),;
DRAWLINE(收< 开 ,低,ISLASTbar,低,1),COLORYELLOW,POINTDOT;}
DRAWTEXT((Min(高,低)-abs(收-开))/abs(高-低)>0.667 and 收<80 and REF(收,1)>80 ,100,'★逃'),colorcyan;
if(收>80 or 开>80,80,100)colorgreen;
PARTLINE(C,100)colorwhite;
if(收<20 or 开<20,20,0)colorred;
PARTLINE(C,0)colorwhite;
Vars1:=REF(CLOSE,1);
Vars2:=SUM(IF(CLOSE> REF(CLOSE,1),vol,IF(CLOSE< REF(CLOSE,1),0-VOL,0)),0);
Vars3:= REF(Vars2,1);
Vars4:=SMA(MAX(CLOSE-Vars1,0),7,1)/SMA(ABS(CLOSE-Vars1),7,1)*100;
Vars5:=SMA(MAX(CLOSE-Vars1,0),13,1)/SMA(ABS(CLOSE-Vars1),13,1)*100;
Vars6:=SMA(MAX(Vars2-Vars3,0),26,1)/SMA(ABS(Vars2-Vars3),26,1)*100;
Vars7:=DATE<1081231;
底部:= IF(Vars4<15 AND Vars5<20 AND Vars6<50 AND BARSCOUNT(CLOSE)>25 AND Vars7,-100,0),stick,;
顶部:= IF(Vars4>85 AND Vars5>80 AND Vars6>50 AND BARSCOUNT(CLOSE)>25 AND Vars7,100,0),stick,linethick2;
DRAWTEXT(filter(底部=-100,5),20,'底'),linethick2,POINTDOT,colorwhite;
DRAWTEXT(filter(顶部=100,5),80,'顶'),linethick2,POINTDOT,colorwhite;
Varm1:=(REF(HIGH,1)+REF(LOW,1))/2;
Varm2:=MA(CLOSE,20)+2*STD(CLOSE,20);
Varm3:=REF(CLOSE,1);
Varm4:=SMA(MAX(CLOSE-Varm3,0),7,1)/SMA(ABS(CLOSE-Varm3),7,1)*100;
Varm5:=crOSS(79,Varm4);
Varm6:=FILTER(Varm5,4);
卖出1:=if(CROSS(Varm1,Varm2),1,0);
STICKLINE(卖出1=1,90,100,10,1),COLORblue,LINETHICK3;
{DRAWTEXT(卖出1=1,90,'→卖1'),COLORWHITE,LINETHICK3;}
卖出2:=if(Varm6,1,0);
STICKLINE(卖出2=1,90,100,10,1),COLORWHITE,LINETHICK3;
{DRAWTEXT(卖出2=1,90,'→卖2'),COLORCYAN,LINETHICK3;}
AA:=REF(收,N)=HHV(收,2*N+1);
AAA:=FILTER(AA,N);
BB:=BacKSET(AAA,N+1);
CC1:=FILTER(BB,N);
CC:=CC1 OR ISLASTbar;
AA2:=REF(L,N)=LLV(L,2*N+1);
AAA2:=FILTER(AA2,N);
BB2:=BACKSET(AAA2,N+1);
CC22:=FILTER(BB2,N);
CC2:=CC22 AND NOT(CC1);
EA:=BACKSET(CC,REF(BArslAST(CC2),1)+1);
EB:=EA>REF(EA,1); EE:=BACKSET(EB,2);
FF1:=EE>REF(EE,1);
EE2:=BACKSET(FF1 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF2:=EE2>REF(EE2,1);
EE3:=BACKSET(FF2 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF3:=EE3>REF(EE3,1);
JS:=IF(CC,COUNT(CC2,REF(BARSLAST(CC),1)+1),0);
G1:=IF(JS=1 AND CC,BARSLAST(FF1),0);
GA:=IF(CC AND REF(L,BARSLAST(FF1))>=REF(L,BARSLAST(FF2)),BARSLAST(FF2),BARSLAST(FF1));
G2:=IF(JS=2 AND CC,GA,0);
G3:=IF(JS>=3 AND CC,IF(CC AND REF(L,GA)>=REF(L,BARSLAST(FF3)),BARSLAST(FF3),GA),0);
GG:=G1+G2+G3;
JA:=BACKSET(CC,GG); JB:=JA>REF(JA,1); JJ:=BACKSET(JB,2);
LD:=JJ>REF(JJ,1);
LD1:=LD OR ISLASTbar;
hEA:=BACKSET(LD1,REF(BARSLAST(CC),1)+1);
hEB:=hEA>REF(hEA,1); hEE:=BACKSET(hEB,2);
hFF1:=hEE>REF(hEE,1);
hEE2:=BACKSET(hFF1 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
hFF2:=hEE2>REF(hEE2,1);
hEE3:=BACKSET(hFF2 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
hFF3:=hEE3>REF(hEE3,1);
hJS:=IF(LD1,COUNT(CC1,REF(BARSLAST(LD1),1)+1),0);
hG1:=IF(hJS=1 AND LD1,BARSLAST(hFF1),0);
hGA:=IF(LD1 AND REF(H,BARSLAST(hFF1))<=REF(H,BARSLAST(hFF2)),BARSLAST(hFF2),BARSLAST(hFF1));
hG2:=IF(hJS=2 AND LD1,hGA,0);
hG3:=IF(hJS>=3 AND LD1,IF(LD1 AND REF(H,hGA)<=REF(H,BARSLAST(hFF3)),BARSLAST(hFF3),hGA),0);
hGG:=hG1+hG2+hG3;
hJA:=BACKSET(LD1,hGG); hJB:=hJA>REF(hJA,1); hJJ:=BACKSET(hJB,2);
HD:=hJJ>REF(hJJ,1);
{ _飞狐股票指标公式}
UU:=BACKSET(ISLASTbar,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTbar,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX,收,VV,收,1),COLORwhite,POINTDOT;
DRAWLINE(XX2,收,VV2,收,2),COLORred,POINTDOT;
xl1:=BACKSET(xx,REF(BARSLAST(LD),1)+2);
xpl1:=xl1>REF(xl1,1);
xd1:=BACKSET(xx2,REF(BARSLAST(HD),1)+2);
xpd1:=xd1>REF(xd1,1);
xd2:=BACKSET(xpd1,REF(BARSLAST(HD),1)+2);
xpd2:=xd2>REF(xd2,1);
DRAWICON(xpd1,收,10),ALIGN0;
DRAWICON(xpd2,收,10),ALIGN0;
DRAWICON(xx2,收,10),ALIGN0;
DRAWICON(xx,收,11),ALIGN0;
DRAWICON(vv2,收,10),ALIGN0;
DRAWICON(vv,收,11),ALIGN0;
DRAWICON(xpl1,收,11),ALIGN0;
DRAWLINE(xpd1,收,xx2,收,1),COLORred;
DRAWLINE(xpl1,收,xx,收,1),COLORwhite;
Var1:=VOL/CAPITAL;
Var2:=VOL/700000000;
Var3:=IF(Var1=0,Var2,Var1);
Var4:=1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1);
Var5:=2.5*MAX(Var3,Var4);
Var6:=DMA(CLOSE,Var5);
Var7:=SMA(20*(Var6/REF(Var6,1)-1),2,1);
Var8:=EMA(Var7,2);
白观望:STICKLINE(Var8>=0.003 and ma(c,34)>ref(ma(c,34),1) and ma(c,8)<ref(ma(c,8),1),0.0,10,10,0),linethick4 ,colorwhite ;
红进:STICKLINE(Var8>=0.003 and ma(c,34)>ref(ma(c,34),1) and ma(c,8)>ref(ma(c,8),1),0.0,10,4,1),linethick5 ,colorred ;
红进进:STICKLINE(Var8>=0.003 and ma(c,34)<ref(ma(c,34),1) and ma(c,8)>ref(ma(c,8),1),0.0,5,10,0),linethick4,colormagenta;
STICKLINE(BETWEEN(Var8,0.003,-0.003),0.0,5,6,0),linethick4,colorwhite ;
绿退:STICKLINE(Var8<=-0.003,0.0,0,10,0),linethick3 ,colorgreen;