|
AQ111:=REF(HIGH,3)=HHV(HIGH,2*3+1); BQ111:=FILTER(AQ111,3);
CQ111:=BACKSET(BQ111,3+1); DQ111:=FILTER(CQ111,3);{高点}
AQ222:=REF(LOW,3)=LLV(LOW,2*3+1);
BQ222:=FILTER(AQ222,3); CQ222:=BACKSET(BQ222,3+1);
DQ222:=FILTER(CQ222,3);{低点}
E111:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E222:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H111:=(DQ111 AND NOT(DQ222 AND E111>=E222)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;H222:=DQ111 AND NOT(DQ222 AND E111>=E222);
L111:=DQ222 AND NOT(DQ111 AND E111=E222);
X111:=REF(BARSLAST(H111),1)+1;
F111:=BACKSET(H111 AND COUNT(L111,X111)>0,LLVBARS(IF(L111,LOW,10000),X111));
G111:=F111>REF(F1,1); I111:=BACKSET(G111,2);
LD111:=I111>REF(I111,1);{过滤后低点}
L222:=LD111 OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X222:=REF(BARSLAST(L222),1)+1;
F222:=BACKSET(L222 AND COUNT(H222,X222)>0,HHVBARS(IF(H222,HIGH,0),X222));
G222:=F222>REF(F222,1); I222:=BACKSET(G222,2);
HD222:=I222>REF(I222,1);{过滤后高点}
J111:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD222),BARSLAST(LD111))+1);
J222:=J111>REF(J111,1);
A333:=H; B333:=REF(H,REF(BARSLAST(HD222),1)+1)>REF(H,REF(BARSLAST(HD222),1)+2+REF(BARSLAST(HD222),REF(BARSLAST(HD222),1)+2));
D333:=A333 AND B333 AND HD222;
E333:=BACKSET(D333,REF(BARSLAST(HD222),1)+2);
HH:=E333>REF(E333,1);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD111),1)+1);
B4:=REF(L,REF(BARSLAST(LD111),1)+1); D4:=A4 AND B4 AND LD111; E4:=BACKSET(D4,REF(BARSLAST(LD111),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H*1.01,8);
DRAWICON(LL,L*0.999,7);
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一K线}
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3>REF(I3,1); {长期低点,也可供引用}
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4>REF(I4,1);{长期高点,也可供引用}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1>REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD111)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD111),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD222)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD222),1)+2);
XX2:=WW2>REF(WW2,1);
前一低:REF(L,BARSLAST(VV)),COLOR99FF66,POINTDOT,LINETHICK1;
STICKLINE(C,前一低,前一低,2,0),COLOR80FF00;
前二低:REF(L,BARSLAST(XX)),COLOR99FF66,POINTDOT,LINETHICK1;
STICKLINE(C,前二低,前二低,2,0),COLOR80FF00;
前一高:REF(H,BARSLAST(VV2)),COLORCYAN,POINTDOT,LINETHICK1;
STICKLINE(C,前一高,前一高,2,0),COLOR80FF00;
前二高:REF(H,BARSLAST(XX2)),COLORCYAN,POINTDOT,LINETHICK1;
STICKLINE(C,前二高,前二高,2,0),COLOR80FF00;
6:=MA(C,6);
MA18:= {2次机会源码}
MAMA(C,18);
FA:=BARSLAST(CROSS(MA18,MA6)) AND CROSS(MA6,MA18);
STICKLINE(FA,MA6,MA6-0.09,4,0),COLORYELLOW;
DRAWTEXT(FA,MA6-0.13,'2次'),COLORYELLOW;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDD:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
压力2:=IF(CROSS(D24,DDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDD)))),COLORGREEN;
压力位:=IF(ISLASTBAR,压力2,DRAWNULL);{压力绿色横线}
STICKLINE(ISLASTBAR ,压力位,压力位,120,0),LINETHICK4,COLORGREEN;
底部:=LLV(HIGH,30),COLOR00FF00;
底部位:=IF(ISLASTBAR,底部,DRAWNULL);{支撑紫色横线}
STICKLINE(ISLASTBAR ,底部位,底部位,100,0),LINETHICK4,COLORMAGENTA;
本文来自: 股海明灯论坛 详细文章参考:http://www.178448.com/forum.php?mod=viewthread&tid=440972 |
|