第一步:新建一个公式,名称为ZF
szc:="1A0001$CLOSE";
dpzf:(szc-ref(szc,1))/ref(szc,1)*100;
ggzf:(c-ref(c,1))/ref(c,1)*100;
第二步:再建一个公式,名称为个股大盘比较
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:sum(A,0);
个股涨幅:sum(B,0);
条件选股公式之一:强势股
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:=sum(A,0);
个股涨幅:=sum(B,0);
强势股:(个股涨幅-大盘涨幅)>180{参数自已设定}
条件选股公式之二:弱势股
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:=sum(A,0);
个股涨幅:=sum(B,0);
弱势股:(大盘涨幅-个股涨幅)>100{参数自已设定}
改进之一:试一下,如果将当天大盘与个股的涨幅进行比较,个股涨幅大于大盘5 点以上,标注强势二字,如何实现?
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:sum(A,0);
个股涨幅:sum(B,0);
drawtext(b-a>=5,a,'强势');
改进之二:进行条件限制,加画柱线.
改进之三:进一步的条件限制
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:sum(A,0);
个股涨幅:sum(B,0);
drawtext(b-a>=5 and b>0,个股涨幅,'强势'),colorred;
STICKLINE(b-a>=5 and b>o ,个股涨幅,大盘涨幅,8,1),colorred;
A:=stkindi('1A0001','zf.dpzf',0,6);
B:=stkindi('','zf.ggzf',0,6);
大盘涨幅:sum(A,0);
个股涨幅:sum(B,0);
条件:=b-a>=5 and b>0 and ma(c,3)>ma(c,13) and (c-llv(low,0))/llv(low,0)*100<15;
drawtext(条件,个股涨幅,'强势'),colorred;
STICKLINE(条件,个股涨幅,大盘涨幅,8,1),colorred;
副图:
相对强度:100*CLOSE/INDEXC;
另外一个是大盘K线的副图指标公式:
a1:="H000001$close";
大盘指数:a1,pointdot,linethick0;
a2:="H000001$open";
a3:="H000001$high";
a4:="H000001$low";
高:a3,pointdot;
低:a4,pointdot;
开:a2,pointdot;
aa:stickline(a1>a2,a1,a2,5,1),colorred;
ab:stickline(a1>a2,a3,max(a1,a2),0,1),colorred;
ac:stickline(a1>a2,min(a1,a2),a4,0,1),colorred;
ag:stickline(a1