|
{黄金精准线} 百分比:=5; 右数峰序:=2; MA5:MA(C,5); MA10:MA(C,10); MA20:MA(C,20); 波谷值:=CONST(TROUGH(2,百分比,1));{前M个ZIG转向波谷值} 波谷距离:= 1+CONST(TROUGHBARS(2,百分比,1)),NODRAW;{前M个ZIG转向波谷到当前距离} {例如:TROUGH(2,5,2)表示%5最低价ZIG转向的前2个波谷到当前的周期数}; 波峰值:=CONST(PEAK(1,百分比,右数峰序)); {例如EAK(1,5,1)表示%5最高价ZIG转向的上一个波峰的数值} 允许误差:=0.024; XG:= ABS(波峰值-波谷值)<=允许误差 {AND BARSCOUNT(V)>60}; 波峰距离:= 1+CONST(PEAKBARS(1,百分比,右数峰序)),NODRAW; {PEAKBARS(K,N,M)表示之字转向ZIG(K,N)的前M个波峰到当前的周期数,M必须大于等于1} 距离:=CURRBARSCOUNT; DRAWLINE(距离=波峰距离 AND XG,波谷值,距离=1,波谷值,1),COLORMAGENTA; DRAWTEXT(距离=波谷距离 AND XG,L*0.98,' 精准峰谷线'),COLORYELLOW; DRAWICON(距离=波峰距离,H*1.01,2);{波峰位置} DRAWICON(距离=波谷距离,L*0.985,1);{波谷位置} 精准点:=(ABS(H-波谷值)<=允许误差 OR ABS(L-波谷值)<=0.024) {AND 距离<=120}; STICKLINE(精准点,波谷值,波谷值,18,1),COLORYELLOW; {量柱} LAST3K:=CURRBARSCOUNT>4; 上涨:=REF(CLOSE,3)>REF(CLOSE,4); 未跌破:=REF(CLOSE,2)>REF(LOW,3) AND REF(CLOSE,1)>REF(LOW,3) AND CLOSE>REF(LOW,3); 缩量:=REF(VOL,3)>0.35*(REF(VOL,1)+REF(VOL,2)+VOL) AND REF(VOL,3)>REF(VOL,2);{1.05/3,5%} 逐级缩量:=REF(VOL,3)>=REF(VOL,2) AND REF(VOL,2)>=REF(VOL,1) AND REF(VOL,1)>=VOL;{平量也看成缩量} 逐级价升:=REF(CLOSE,3)<REF(CLOSE,2) AND REF(CLOSE,2)<=REF(CLOSE,1) AND REF(CLOSE,1)<=CLOSE; {倍量柱} 倍量1:=(REF(VOL,3)>=REF(VOL,4)*1.91),NODRAW;{实际给1.91倍} 倍量:VOL>REF(VOL,1)*1.91,NODRAW,COLORWHITE; {高量柱} 高量1:=REF(VOL,3)>REF(HHV(VOL,3),4) AND REF(VOL,3)>HHV(VOL,3),NODRAW,COLORWHITE; TEMP1:=BACKSET(高量1,4); 高量:FILTER(TEMP1,3),NODRAW,COLORWHITE; {将军柱} 将军1:=上涨 AND 未跌破 AND (倍量1 OR 高量1),NODRAW,COLORYELLOW; {黄金柱} 黄金1:=将军1 AND 缩量,NODRAW,COLORYELLOW; {标准黄金柱} 准黄金1:=黄金1 AND 逐级缩量 AND 逐级价升,NODRAW,COLORRED; 将军2:=将军1 AND 黄金1=0 AND BARSLAST(REF(将军1,1))>1; 黄金2:=黄金1 AND 准黄金1=0 AND BARSLAST(REF(将军1,1))>1; 将军3:=BACKSET(将军2,4); 将军:FILTER(将军3,3),NODRAW,COLORWHITE; 黄金3:=BACKSET(黄金2,4); 黄金:FILTER(黄金3,3),NODRAW,COLORYELLOW; 准黄金2:=BACKSET(准黄金1,4); 准黄金:FILTER(准黄金2,3),NODRAW,COLORRED; {输出,规则是连续都满足条件则取第一个} DRAWICON(LAST3K AND 准黄金,HIGH*1.01,26),COLORRED; DRAWICON(LAST3K AND 黄金,HIGH*1.01,25),COLORRED; DRAWICON(LAST3K AND 将军,HIGH*1.01,24),COLORRED; STICKLINE(C,REF(L,BARSLAST(准黄金)),REF(L,BARSLAST(准黄金)),2,0),COLORYELLOW; STICKLINE(C,REF(L,BARSLAST(黄金)),REF(L,BARSLAST(黄金)),2,0),COLORYELLOW; STICKLINE(C,REF(H,BARSLAST(黄金)),REF(H,BARSLAST(黄金)),2,0),COLORCYAN; STICKLINE(LAST3K AND 黄金,O,C,0.5,0),COLORYELLOW; STICKLINE(LAST3K AND 准黄金,O,C,2,0),COLORYELLOW; STICKLINE(LAST3K AND 将军,O,C,3,0),COLORYELLOW; 正向分形:=((C-REF(MA(C,6),1))/6+MA(C,6))*1.004,COLORWHITE; 正向定位:=CROSS(C,正向分形) AND 正向分形>REF(正向分形,1); STICKLINE(正向定位,H,L,0,1),COLORRED,LINETHICK2; STICKLINE(正向定位,O,C,1.8,0),COLORRED,LINETHICK2 |
|