本帖最后由 王新银 于 2010-8-21 14:49 编辑
把黄金柱和K线结合一下
N1(1,100,3);
N2(1,100,6);
N3(1,100,12);
N4(1,100,24);
多空指数:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4;
X:=IF(VOL==REF(VOL,1) OR (VOL>REF(VOL,1) AND (VOL-REF(VOL,1))<=(VOL*0.05)) OR (VOL<REF(VOL,1) AND (REF(VOL,1)-VOL)<=(REF(VOL,1)*0.05)),1,0);
X1:=IF(X==0 AND VOL>REF(VOL,1) AND (VOL==REF(VOL,2) OR (VOL>REF(VOL,2) AND (VOL-REF(VOL,2))<=(VOL*0.05)) OR (VOL<REF(VOL,2) AND (REF(VOL,2)-VOL)<=(REF(VOL,2)*0.05))),2,0);
X2:=IF(X==0 AND X1==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND (VOL==REF(VOL,3) OR (VOL>REF(VOL,3) AND (VOL-REF(VOL,3))<=(VOL*0.05)) OR (VOL<REF(VOL,3) AND (REF(VOL,3)-VOL)<=(REF(VOL,3)*0.05))),3,0);
X3:=IF(X==0 AND X1==0 AND X2==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND (VOL==REF(VOL,4) OR (VOL>REF(VOL,4) AND (VOL-REF(VOL,4))<=(VOL*0.05)) OR
(VOL<REF(VOL,4) AND (REF(VOL,4)-VOL)<=(REF(VOL,4)*0.05))),4,0);
X4:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND
(VOL==REF(VOL,5) OR (VOL>REF(VOL,5) AND (VOL-REF(VOL,5))<=(VOL*0.05)) OR (VOL<REF(VOL,5) AND (REF(VOL,5)-VOL)<=(REF(VOL,5)*0.05))),5,0);
X5:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
(VOL==REF(VOL,6) OR (VOL>REF(VOL,6) AND (VOL-REF(VOL,6))<=(VOL*0.05)) OR (VOL<REF(VOL,6) AND (REF(VOL,6)-VOL)<=(REF(VOL,6)*0.05))),6,0);
X6:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
VOL>REF(VOL,6) AND (VOL==REF(VOL,7) OR (VOL>REF(VOL,7) AND (VOL-REF(VOL,7))<=(VOL*0.05)) OR (VOL<REF(VOL,7) AND (REF(VOL,7)-VOL)<=(REF(VOL,7)*0.05))),7,0);
X7:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND (VOL==REF(VOL,8) OR (VOL>REF(VOL,8) AND (VOL-REF(VOL,8))<=(VOL*0.05)) OR (VOL<REF(VOL,8) AND (REF(VOL,8)-VOL)<=(REF(VOL,8)*0.05))),8,0);
X8:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND X7==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND VOL>REF(VOL,8) AND (VOL==REF(VOL,9) OR (VOL>REF(VOL,9) AND (VOL-REF(VOL,9))<=(VOL*0.05)) OR (VOL<REF(VOL,9) AND (REF(VOL,9)-VOL)<=(REF(VOL,9)*0.05))),9,0);
X9:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND X7==0 AND X8==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND VOL>REF(VOL,8) AND VOL>REF(VOL,9) AND
(VOL==REF(VOL,10) OR (VOL>REF(VOL,10) AND (VOL-REF(VOL,10))<=(VOL*0.05)) OR (VOL<REF(VOL,10) AND (REF(VOL,10)-VOL)<=(REF(VOL,10)*0.05))),10,0);
X10:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND X7==0 AND X8==0 AND X9==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND
VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND VOL>REF(VOL,8) AND VOL>REF(VOL,9) AND VOL>REF(VOL,10) AND
(VOL==REF(VOL,11) OR (VOL>REF(VOL,11) AND (VOL-REF(VOL,11))<=(VOL*0.05)) OR (VOL<REF(VOL,11) AND (REF(VOL,11)-VOL)<=(REF(VOL,11)*0.05))),11,0);
X11:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND X7==0 AND X8==0 AND X9==0 AND X10==0 AND VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF (VOL,5) AND VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND VOL>REF(VOL,8) AND VOL>REF(VOL,9) AND VOL>REF(VOL,10) AND VOL>REF(VOL,11) AND
(VOL==REF(VOL,12) OR (VOL>REF(VOL,12) AND (VOL-REF(VOL,12))<=(VOL*0.05)) OR (VOL<REF(VOL,12) AND (REF(VOL,12)-VOL)<=(REF(VOL,12)*0.05))),12,0);
X12:=IF(X==0 AND X1==0 AND X2==0 AND X3==0 AND X4==0 AND X5==0 AND X6==0 AND X7==0 AND X8==0 AND X9==0 AND X10==0 AND X11==0 AND
VOL>REF(VOL,1) AND VOL>REF(VOL,2) AND VOL>REF(VOL,3) AND VOL>REF(VOL,4) AND VOL>REF(VOL,5) AND VOL>REF(VOL,6) AND VOL>REF(VOL,7) AND VOL>REF(VOL,8) AND VOL>REF(VOL,9) AND VOL>REF(VOL,10) AND
VOL>REF(VOL,11) AND VOL>REF(VOL,12) AND
(VOL==REF(VOL,13) OR (VOL>REF(VOL,13) AND (VOL-REF(VOL,13))<=(VOL*0.05)) OR (VOL<REF(VOL,13) AND (REF(VOL,13)-VOL)<=(REF(VOL,13)*0.05))),13,0);
黄:=((((REF(VOL,3)-REF(VOL,4))>=REF(VOL,4)) OR
(REF(VOL,3)-REF(VOL,4))>=(REF(VOL,3)*0.4)) OR
(REF(VOL,4)<REF(VOL,3) AND REF(VOL,5)<REF(VOL,4) AND REF(VOL,6)<REF(VOL,5)) OR REF((X+X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11+X12),3)>0)
AND
((VOL<REF(VOL,1) AND REF(VOL,1)<REF(VOL,2) AND REF(VOL,2)<REF(VOL,3)) OR
(VOL<REF(VOL,3) AND REF(VOL,1)<REF(VOL,3) AND REF(VOL,2)<REF(VOL,3))) AND
REF(C,1)>=REF(L,3) AND C>=REF(L,3) AND REF(C,2)>=REF(L,3),linethick0;
KL:=IF(黄>0 and (VOL<REF(VOL,1) AND REF(VOL,1)<REF(VOL,2) AND REF(VOL,2)<REF(VOL,3)),1,0);
ss:=SUMBARS(黄>0 AND KL>0,1);
STICKLINE(ss,REF(C,ss-1)*1.002,REF(C,ss-1),5,0),COLORRED;
STICKLINE(ss,REF(L,ss-1)*1.002,REF(L,ss-1),5,0),COLORRED;
KS:=IF(黄>0 AND KL==0 AND (VOL<REF(VOL,3) AND REF(VOL,1)<REF(VOL,3) AND REF(VOL,2)<REF(VOL,3)),1,0);
FF:=SUMBARS(黄>0 AND KS>0,1);
STICKLINE(FF,REF(C,FF-1)*1.002,REF(C,FF-1),5,0),colorblue;
STICKLINE(FF,REF(L,FF-1)*1.002,REF(L,FF-1),5,0),colorblue; |