{通达信测试通过与飞狐显示的一模一样,请查收}
N:=5;
J:=4;
A1:=REF(H,N)=HHV(H,2N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);{高点}
A2:=REF(L,N)=LLV(L,2N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);{低点}
E1:=(REF(LLV(L,2N),1)+REF(HHV(H,2N),1))/2; E2:=(H+L)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR CURRBARSCOUNT=2 OR CURRBARSCOUNT=1;
L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS
(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
L2:=LD OR CURRBARSCOUNT=2 OR CURRBARSCOUNT=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS
(IF(H2,H,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点}
R1:=BACKSET(CURRBARSCOUNT=2,BARSLAST(HD)+1); S1:=R1>REF(R1,1); {前一高}
T1:=BACKSET(CURRBARSCOUNT=2,BARSLAST(LD)+1); U1:=T1>REF(T1,1); {前一低}
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2); S2:=R2>REF(R2,1); {前二高}
T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2); U2:=T2>REF(T2,1); {前二低}
T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2); U3:=T3>REF(T3,1); {前三低}
T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2); U4:=T4>REF(T4,1); {前四低}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2); S3:=R3>REF(R3,1); {前三高}
R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); S4:=R4>REF(R4,1); {前四高}
短期压力:DRAWLINE(S2,H,S1,H,1),COLORRED;
短期支撑:DRAWLINE(U2,L,U1,L,1),COLORGREEN;
中期压力:DRAWLINE(S3,H,S2,H,1),COLORYELLOW;
中期支撑:DRAWLINE(U3,L,U2,L,0),COLORFF00FF;
长期压力:DRAWLINE(S4,H,S3,H,1),COLORWHITE;
长期支撑:DRAWLINE(U4,L,U3,L,0),COLORBLUE;
DRAWICON(S1,H101,2);
DRAWICON(S2,H101,2);
DRAWICON(S3,H101,2);
DRAWICON(S4,H101,2);
DRAWICON(U1,L099,1);
DRAWICON(U2,L099,1);
DRAWICON(U3,L099,1);
DRAWICON(U4,L099,1);
AS:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24)+MA(CLOSE,48))/5;
AA:=SMA(CLOSE,3,1);
STICKLINE(AS<=AA AND CLOSE>=OPEN,HIGH,LOW,0,1),COLOR0000FF;
STICKLINE(AS<=AA AND CLOSE>=OPEN,CLOSE,OPEN,3,1),COLOR0000FF;
STICKLINE(AS<=AA AND CLOSE<OPEN,HIGH,LOW,0,0),COLOR0000FF;
STICKLINE(AS<=AA AND CLOSE<OPEN,CLOSE,OPEN,3,0),COLOR0000FF;
STICKLINE(AS>AA AND CLOSE>=OPEN,HIGH,LOW,0,1),COLOR00FF00;
STICKLINE(AS>AA AND CLOSE>=OPEN,CLOSE,OPEN,3,1),COLOR00FF00;
STICKLINE(AS>AA AND CLOSE<OPEN,HIGH,LOW,0,0),COLOR00FF00;
STICKLINE(AS>AA AND CLOSE<OPEN,CLOSE,OPEN,3,0),COLOR00FF00;
REF(C,1)/REF(C,2)<=093 AND BETWEEN(C/REF(C,1),103,097) and close/ref(close,8)<=08 and between(ref(c,2)/ref(c,3),104,096) and between(ref(c,3)/ref(c,4),104,096);
将下面几行删除:
STICKLINE(SJ,H,L,05,0),COLORRED;
STICKLINE(SJ,O,C,55,0),LINETHICK3,COLOR000055;
STICKLINE(SJ,O,C,45,0),LINETHICK3,COLOR000077;
STICKLINE(SJ,O,C,35,0),LINETHICK3,COLOR000099;
STICKLINE(SJ,O,C,25,0),LINETHICK3,COLOR0000BB;
STICKLINE(SJ,O,C,15,0),LINETHICK3,COLOR0000DD;
STICKLINE(SJ,O,C,05,0),LINETHICK3,COLOR0000FF;
DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),LOW0978,'短进'),PXUP4,Color00FFFF;
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH102,'短出'),ColorFF5000;
加上下面这行:
CROSS(ZIG(3,8),REF(ZIG(3,8),1));
提醒:这是含未来函数的公式,没有什么价值。
{CHHJ-}
A:=(LOW+HIGH+CLOSE+OPEN)/42;
楚河汉界:HHV((MA(A,6)),15),COLORGREEN,LINETHICK2;
C3:=REF(C,1);
涨停:=IF((C-C3)100/C3>=(10-001100/C3),1,0);
STICKLINE(涨停,OPEN,CLOSE,3,0),COLORRED;
跌停:=IF((C3-C)100/C3>=(10-001100/C3),1,0);
STICKLINE(跌停,OPEN,CLOSE,3,0),COLORBLUE;
公式源自网络,感谢原作者。已通过测试。{个人看法,仅供参考。}
首先建立一个“年线之上”板块,把以下公式复制到飞狐公式编辑器中,保存指标,再建立一个选股指标,条件就是本公式中的:收盘>年线,选出来的股票加入到“年线之上”板块中,调用本公式在主图上显示就可以得到“比值”数据。
飞狐公式:
年线:MA(C,250),COLORMAGENTA,LINETHICK0;
收盘:CLOSE,COLORBLUE,LINETHICK0;
A股总数:=STKCOUNT('A股板块');//A股板块所包含品种数量
年线之上:=STKCONT('年线之上)://年线之上板块包含的品种数量
比值:年线之上/A股总数100,COLORRED,LINETHICK0;
欢迎分享,转载请注明来源:表白网
评论列表(0条)