{飞龙顶底【主图指标】知博陋室自用主图}
背景色:=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);
有话要说...