源码为飞狐,参数P和P1因个股及周期不同视情调整;下面贴图为当前上证30分钟图。
p:=7;p1:=13;
均价:=(2*C+(H-L)/2+L)/3;
价差:=SUM(均价-REF(均价,1),2)/2;
高低:=(均价+价差);
实价:=(高低+均价)/2;
工作线:MA(实价,8),COLORAAAA00,LINETHICK2;
箱顶:=REF(HHV(工作线,3),1),linethick1;
箱底:=REF(LLV(工作线,8),1),COLORGREEN,linethick1;
PARTLINE(工作线>REF(工作线,1),工作线),COLORYELLOW,LINETHICK2;
PARTLINE(工作线>箱顶,工作线),COLORRED,LINETHICK2;
PARTLINE(工作线<箱底,工作线),COLORFF0080,LINETHICK2;
GL:(工作线-箱顶)/箱顶*100,LINETHICK;
A1:=REF(实价,P)=HHV(实价,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);{高点}
A2:=REF(实价,P1)=LLV(实价,2*P1+1);
B2:=FILTER(A2,P1);
C2:=BACKSET(B2,P1+1);
D2:=FILTER(C2,P1);{低点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
DRAWLINE(D1,实价,S11,实价,1),COLORMAGENTA;
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,实价,U11,实价,1),COLORGRAY;
标:(DT-操盘线)/操盘线*100,COLORAAAA00;
DRAWICON(CROSS(主力获利,标),标,1),ALIGN0;
DRAWTEXT(CROSS(MCD,标),标,'★'),COLORRED,ALIGN0;
0,COLORWHITE;20,COLORRED;-20,COLORCYAN;