{飛龍頂底【主圖指标】知博陋室自用主圖}
背景色:=DRAWGBK(C>0, RGB(0,0,0),RGB(0,0,3'該數值可以調整'),0,0,0);{淺色背景};
LY:=9;
BL:=36;
CJQS:=XMA(CLOSE,LY);{CJQS:=XMA(CLOSE,LY)}
JBQS:=XMA(CLOSE,BL);{JBQS:=XMA(CLOSE,BL)}
N3:=REF(JBQS,BL/2+1-CURRBARSCOUNT)/REF(JBQS,BL/2+2-CURRBARSCOUNT);
M3:=REF(CJQS,LY/2+1-CURRBARSCOUNT)/REF(CJQS,LY/2+2-CURRBARSCOUNT);
外上軌多頭:IF(CURRBARSCOUNT>BL/2,JBQS*1.1,REF(JBQS,BL/2+1-CURRBARSCOUNT)*POW(N3,BL/2+1-CURRBARSCOUNT)*1.1)COLORYELLOW,DOTLINE;
外下軌多頭:IF(CURRBARSCOUNT>BL/2,JBQS*0.9,REF(JBQS,BL/2+1-CURRBARSCOUNT)*POW(N3,BL/2+1-CURRBARSCOUNT)*0.9)COLOR0099FF,DOTLINE;
内上軌多頭:IF(CURRBARSCOUNT>LY/2,CJQS*1.05,REF(CJQS,LY/2+1-CURRBARSCOUNT)*POW(M3,LY/2+1-CURRBARSCOUNT)*1.05)COLOR555555,DOTLINE;
内下軌多頭:IF(CURRBARSCOUNT>LY/2,CJQS*0.95,REF(CJQS,LY/2+1-CURRBARSCOUNT)*POW(M3,LY/2+1-CURRBARSCOUNT)*0.95)COLOR555555,DOTLINE;
MA5日攻擊線:MA(C,5)DOTLINE,COLORWHITE;
外上下軌間差額:外上軌多頭-外下軌多頭,NODRAW,COLORRED;
外上下軌間差額%:(外上軌多頭-外下軌多頭)/外上軌多頭*100,NODRAW,COLORCYAN;
預期上漲額_元:外上軌多頭-CLOSE,NODRAW,COLORGREEN;
預留上漲空間%:REF(預期上漲額_元,0)/REF(外上軌多頭,0)*100,NODRAW,COLORCYAN;
預期上漲百分比:=DRAWTEXT_FIX(C!=0,0.75,0.96,0,STRCAT(' 預期上漲百分比 ',STRCAT(CON2STR(預留上漲空間%,2),' % '))),COLOR00FFFF;
平均成本線:COST(50), COLOR0099FF,DOTLINE,NODRAW;
短:100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5)),COLORWHITE,NODRAW;
中:100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10)),COLORYELLOW,NODRAW;
長:100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20)),COLORRED,NODRAW;
超長:100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30)),COLORMAGENTA,NODRAW;
高浪日:=REF(短,1)<2 AND REF(中,1)<2 AND REF(長,1)<2 AND REF(超長,1)<2;
高浪日抄底:=IF(高浪日,1,0),COLORLICYAN,LINETHICK1;
抄底柱體:=STICKLINE(高浪日抄底,20,30,1,0),COLORRED,LINETHICK1;
抄底文字:=DRAWTEXT(高浪日抄底,35,'買入 '),COLORYELLOW,LINETHICK1;
四線歸一:=DRAWICON(短=(0)AND 中=(0)AND 長=(0)AND 超長=(0),3,9);
外上通道空頭:IF(外上軌多頭
外下通道空頭:IF(外下軌多頭
内上通道空頭:IF(内上軌多頭
内下通道空頭:IF(内下軌多頭
頂:=DRAWTEXT(FILTER(EXIST(LONGCROSS(内上軌多頭,外上軌多頭,25),10)AND CROSS(REF(内上軌多頭,1),REF(内上軌多頭,0)),5),H+0.1,'頂')COLORYELLOW; 底:=DRAWTEXT(FILTER(EXIST(LONGCROSS(外下軌多頭,内下軌多頭,25),10)AND CROSS(REF(内下軌多頭,0),REF(内下軌多頭,1)),5),L-0.8,'底')COLORMAGENTA; 外上軌多頭線:DRAWTEXT(ISLASTBAR,外上軌多頭,STRCAT(' ',CON2STR(外上軌多頭,2))),COLOR00FFFF; 外下軌多頭線:DRAWTEXT(ISLASTBAR,外下軌多頭,STRCAT(' ',CON2STR(外下軌多頭,2))),COLOR0099FF; 操盤線13:=MA(C,13)DOTLINE,COLORGREEN; 生命線26:=MA(C,26)COLORGREEN,LINETHICK1; 決策線60:=MA(C,60)COLORMAGENTA,DOTLINE; 年線250:=MA(C,250)COLORLICYAN,POINTDOT; 操盤線:=EMA(EMA(EMA(EMA(MA(C,5),2),1),2),1),COLORLICYAN,LINETHICK1; 多頭操盤:IF(操盤線>REF(操盤線,1),操盤線,DRAWNULL),COLORRED,LINETHICK2; 空頭操盤:IF(操盤線
{現價止盈、止損價位} 現價:=DYNAINFO(7)COLORWHITE,NODRAW; 現價賺6%止盈位:REF(現價*1.06,1)COLORRED,NODRAW; 現價虧3%止損位:REF(現價*0.97,1)COLORGREEN,NODRAW; {藍色K線系列} 标識0002:STICKLINE(CLOSE=OPEN,HIGH,LOW,0,0),COLORCYAN; 标識03:STICKLINE(CLOSE=OPEN,CLOSE,OPEN,3,0),COLORCYAN; 标識04:STICKLINE(CLOSE>OPEN,HIGH,CLOSE,0,0),COLORCYAN; 标識05:STICKLINE(CLOSE>OPEN,LOW,OPEN,0,0),COLORCYAN; 标識06:STICKLINE(CLOSE>OPEN,OPEN,CLOSE,3,1),COLORCYAN; 标識07:STICKLINE(OPEN>CLOSE,HIGH,LOW,0,0),COLORCYAN; 标識08:STICKLINE(OPEN>CLOSE,OPEN,CLOSE,3,0),COLORCYAN; 标識09:STICKLINE(CLOSE<操盤線 AND OPEN>=CLOSE,HIGH,LOW,0,0),COLORCYAN; 标識10:STICKLINE(CLOSE<操盤線 AND OPEN>=CLOSE,OPEN,CLOSE,3,0),COLORCYAN; 标識11:STICKLINE(CLOSE<操盤線 AND OPEN 标識12:STICKLINE(CLOSE<操盤線 AND OPEN 标識13:STICKLINE(CLOSE<操盤線 AND OPEN {紅K線系列} 标識14:STICKLINE(CLOSE>操盤線 AND CLOSE>OPEN,HIGH,CLOSE,0,0),COLORRED; 标識15:STICKLINE(CLOSE>操盤線 AND CLOSE>OPEN,LOW,OPEN,0,0),COLORRED; 标識16:STICKLINE(CLOSE>操盤線 AND CLOSE>OPEN,OPEN,CLOSE,3,1),COLORRED; 标識17:STICKLINE(CLOSE>操盤線 AND CLOSE<=OPEN,HIGH,LOW,0,0),COLORRED; 标識18:STICKLINE(CLOSE>操盤線 AND CLOSE<=OPEN,OPEN,CLOSE,3,0),COLORRED; 标識19:STICKLINE(CLOSE>操盤線 AND 操盤線>REF(操盤線,1) AND CLOSE>OPEN,HIGH,CLOSE,0,0),COLORRED; 标識20:STICKLINE(CLOSE>操盤線 AND 操盤線>REF(操盤線,1) AND CLOSE>OPEN,OPEN,LOW,0,0),COLORRED; 标識22:STICKLINE(CLOSE>操盤線 AND 操盤線>REF(操盤線,1) AND CLOSE>OPEN,OPEN,CLOSE,3,1),COLORRED; 标識23:STICKLINE(CLOSE>操盤線 AND 操盤線>REF(操盤線,1) AND CLOSE<=OPEN,HIGH,LOW,0,0),COLORRED; 标識24:STICKLINE(CLOSE>操盤線 AND 操盤線>REF(操盤線,1) AND CLOSE<=OPEN,OPEN,CLOSE,3,0),COLORRED; {局部頂底} N1:=(1,100,10); N2:=(1,100,10); DISP:=(1,3,2); KK:=IF(PERIOD=5,1,{日}IF(PERIOD=6,1,{周}IF(PERIOD=7,1,{月}IF(PERIOD=8,1,{多分鐘}IF(PERIOD=9,1,{多日}IF(PERIOD=10,1,{季} IF(PERIOD=11,2,{年}IF(PERIOD=4,1,{60F}IF(PERIOD=3,1,{30F}IF(PERIOD=2,1,{15F}IF(PERIOD=1,1{5F},1{1F})))))))))))/10; PP1:=PEAK(1,KK*N1,1); PP2:=PEAK(1,KK*N1,2); WP1:=PEAKBARS(1,KK*N1,1); WP2:=PEAKBARS(1,KK*N1,2); T1:=TROUGH(2,KK*N2,1); T2:=TROUGH(2,KK*N2,2); WT1:=TROUGHBARS(2,KK*N2,1); WT2:=TROUGHBARS(2,KK*N2,2); TJ1:=PP1>T1 AND PP2>T2 ; ZD:=MAX(T1,T2); ZG:=MIN(PP1,PP2); LL:=MIN(T1,T2); HH:=MAX(PP1,PP2); TJ2:=FILTER(ZG>ZD,2); TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2)); TJ4:=TJ1&&TJ2&&NOT(TJ3); TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1))); TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1))); TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD
TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7); ZSD:=IF(TJ8,ZD,DRAWNULL); ZSG:=IF(TJ8,ZG,DRAWNULL); ZSH:=IF(TJ8,HH,DRAWNULL); ZSL:=IF(TJ8,LL,DRAWNULL); 标識002:=STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA; 标識003:=STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA; 标識004:=DRAWTEXT(DISP=2,ZSH,'中樞'),COLORWHITE; 中樞高:=PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,COLORLIRED; 中樞低:=PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,COLORLIGREEN; 中樞最高:=PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED; 中樞最低:=PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN; 趨勢高:=PLOYLINE(DISP=3,ZIG(1,KK*N1)),COLORLIBLUE; 趨勢低:=PLOYLINE(DISP=3,ZIG(2,KK*N2)),COLORLIBLUE; 局部低點預選A:=BACKSET(LLV(L,5)
局部低點預選B:=BACKSET(局部低點預選A=0 AND REF(局部低點預選A,1)=1,2); 局部低點預選C:=IF(局部低點預選B=1 AND REF(局部低點預選B,1)=0,-1,0); 局部高點預選A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4); 局部高點預選B:=BACKSET(局部高點預選A=0 AND REF(局部高點預選A,1)=1,2); 局部高點預選C:=IF(局部高點預選B=1 AND REF(局部高點預選B,1)=0,1,0); 缺口判斷:=IF(L>REF(H,1),1,IF(H
距前高天:=BARSLAST(局部高點預選C=1); 距前低天:=BARSLAST(局部低點預選C=-1); 小值周期:=LOWRANGE(L); 大值周期:=TOPRANGE(H); 低保留AA:=IF(局部低點預選C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)
低保留AB:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判斷,距前高天)=-1 OR LLV(L,距前低天+2)
低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L
預判:=IF((距前低天<4 AND HHV(缺口判斷,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0); 判斷:=IF(局部高點預選C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 預判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期 >REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0); 高保留A:=IF(局部高點預選C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0); 高保留B:=IF(局部高點預選C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判斷,距前低天)=1),1,0); 高保留:=IF((高保留A=1 OR 高保留B=1 OR 判斷=1) AND H>REF(L,距前低天+1),1,0); 預判A:=IF((距前高天<4 AND HHV(缺口判斷,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0); 判斷A:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 預判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0); 低保留A:=IF(局部低點預選C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)
低保留B:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判斷,距前高天)=-1 OR 判斷A=-1),-1,0); 低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L
距前高天A:=BARSLAST(高保留=1); 距前低天A:=BARSLAST(低保留=-1); 預判X:=IF((距前低天A<4 AND HHV(缺口判斷,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0); 判斷X:=IF(局部高點預選C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 預判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0); 高保留XA:=IF(局部高點預選C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0); 高保留XB:=IF(局部高點預選C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判斷,距前低天A)=1),1,0); 高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判斷X=1) AND H>REF(L,距前低天A+1),1,0); 預判XA:=IF((距前高天A<4 AND HHV(缺口判斷,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0); 判斷XA:=IF(局部低點預選C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 預判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0); 低保留XA:=IF(局部低點預選C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)
低保留XB:=IF(局部低點預選C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判斷,距前高天A)=-1 OR 判斷XA=-1),-1,0); 低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L
距前高天YA:=BARSLAST(高保留X=1); 距前低天YA:=BARSLAST(低保留X=-1); 預判YX:=IF((距前低天YA<4 AND HHV(缺口判斷,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0); 判斷YX:=IF(局部高點預選C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 預判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0); 高保留YXA:=IF(局部高點預選C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0); 高保留YXB:=IF(局部高點預選C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判斷,距前低天YA)=1),1,0); 高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判斷YX=1) AND H>REF(L,距前低天YA+1),1,0); 預判YXA:=IF((距前高天YA<4 AND HHV(缺口判斷,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0); 判斷YXA:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 預判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0); 低保留YXA:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)
低保留YXB:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判斷,距前高天YA)=-1 OR 判斷YXA=-1),-1,0);
有話要說...