同花顺狂威廉公式 看图操作,威廉理论
源码
慢:100*(HHV(HIGH,10)-CLOSE)/(HHV(HIGH,10)-LLV(LOW,10)),colorligray;
快:100*(HHV(HIGH,6)-CLOSE)/(HHV(HIGH,6)-LLV(LOW,6)),coloryellow;
底:80 ,colorred;
顶:20 ,colorgreen;
B:=CROSS(底,慢);
S:=(CROSS(慢,底)) OR (CROSS(慢,顶));
SM:=BARSLAST(s);
BM:=BARSLAST(b);
买B:=IF(BM[1]=-1 AND B,1,IF(BM[1]!=-1 AND SM[1]!=-1 AND BM[1]>SM[1] AND B AND B[1]=0,1,0));
DRAWICON(买B,快,'buy');
买:IF(B>=1,买B,DRAWNULL),coloryellow;
卖a:=CROSS(慢,顶);
卖S:=IF(SM[1]=-1 AND BM[1]!=-1 AND S,1,IF( SM[1]!=-1 AND BM[1]!=-1 AND SM[1]>BM[1]
AND S AND S[1]=0,1,0));
DRAWICON(卖S,慢,'SELL');
卖:IF(S>=1,卖S,DRAWNULL),colorgreen;
A1:=BARSLAST(REF(CROSS(慢,顶),1));
顶背离:=REF(CLOSE,A1+1)<CLOSE AND REF(慢,A1+1)<慢 AND CROSS(慢,顶) AND 顶<慢;
顶背:IF(顶背离,慢,DRAWNULL),colorgreen;
DRAWICON(顶背,顶*0.986,'buy1');
A2:=BARSLAST(REF(CROSS(底,慢),1));
底背离:=REF(CLOSE,A2+1)>CLOSE AND 慢<REF(慢,A2+1) AND CROSS(底,慢) AND 底>慢;
底背:IF(底背离,慢,DRAWNULL),colorred;
DRAWICON(底背,底*0.986,'buy1');