N:=7;M:=6;
VarA:=C>O;
VarB:=C>REF(C,1);
VarC:=O>REF(C,1);
Var1:=ema(SMA(IF(VarA,(C-O)*V,0),M,1),N);
Var2:=ema(SMA(IF(VarB,(C-REF(C,1))*V,0),M,1),N);
Var3:=ema(SMA(IF(VarC,(O-REF(C,1))*V,0),M,1),N);
Var4:=ema(SMA(IF(VarA,0,(O-C)*VOL),4*M,1),N);
Var5:=ema(SMA(IF(VarB,0,(REF(C,1)-C)*V),4*M,1),N);
Var6:=ema(SMA(IF(VarC,0,(REF(C,1)-O)*V),4*M,1),N);
lng:=(Var1+Var2+Var3)/300;
sht:(Var4+Var5+Var6)/300,COLORyellow,linethick2 ;
partline(lng,sht<lng),colorred,linethick2 ;
partline(lng,lng<sht),color10b210,linethick2 ;
含砂:eMA(forcast(lng-sht,6*M),M),COLORWHITE;
含金:eMA((COUNT(VarA,4*M)+COUNT(VarB,4*M)+COUNT(VarC,4*M))*ema(lng,N+2),2)/6/M,COLORMAGENTA,POINTDOT,linethick2;
K:=HHV(lng,4*M);
先觉:=if(lng>sht and lng>含金 and slope(含砂,2)>-0.5 and sht<0.8*K,(lng-sht-ref(lng-sht,1))/ref(lng-sht,1),0)*K;
先知:if(abs(先觉)>50,K+6,abs(先觉)),COLORCYAN,linethick2;
0;
stickline(sht<=lng and lng>含金 ,sht,lng,2,0),coloryellow;