600300 自动趋势线 局点
600300 自动趋势线 局点
M1:=5;M2:=10;
HIGHN:=10;LOWN:=10;
HIGHDISPLAY:=0;
LOWDISPLAY:=0;
ZGDISPLAY:=0;
MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC,H*1.02,2);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1),COLORGREEN,LINETHICK2;
局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4),LINETHICK2;
局部低点预选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<REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=LOWRANGE(L);
大值周期:=TOPRANGE(H);
低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);
低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);
预判:=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)<REF(LLV(L,距前高天+1),1),-1,0);
低保留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<REF(H,距前高天+1),-1,0);
AAAD:=IF(高保留=1 AND 低保留=-1 AND H>REF(H,REF(距前高天,1)+2),1,IF(高保留=1 AND 低保留=-1 AND L<REF(L,REF(距前低天,1)+2),-1,0));
极点保留:=IF(AAAD=0,高保留+低保留,AAAD);
局部极点:=IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW,LINETHICK2;
局部极点A:DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED,LINETHICK2;
局部极点B:DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF;
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW;
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1,L*0.98,1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,LINETHICK3;
MA1:=MA(CLOSE,M1);
MA2:=MA(CLOSE,M2);
MCST:DMA(AMOUNT/(100*VOL),VOL/CAPITAL),COLORYELLOW,LINETHICK5,POINTDOT;
过均必牛:SUM(CLOSE*VOL,FROMOPEN)/SUM(VOL,FROMOPEN),COLORRED,POINTDOT,LINETHICK5;
MA5:MA.MA1#DAY(5,10,20),NODRAW;
DRAWTEXT_FIX(1,0.880,1-0.20,0,STRCAT(STRCAT('MA5: ',CON2STR(MA5,2)),'')),COLORWHITE;
MA10:MA.MA2#DAY(5,10,20),NODRAW;
DRAWTEXT_FIX(1,0.880,1-0.15,0,STRCAT(STRCAT('MA10:',CON2STR(MA10,2)),'')),COLORYELLOW;
MA20:MA.MA3#DAY(5,10,20),NODRAW;
DRAWTEXT_FIX(1,0.880,1-0.10,0,STRCAT(STRCAT('MA20:',CON2STR(MA20,2)),'')),COLORMAGENTA;
MA60:MA.MA4#DAY(5,10,20),NODRAW;
DRAWTEXT_FIX(1,0.880,1-0.05,0,STRCAT(STRCAT('MA60:',CON2STR(MA60,2)),'')),COLORGREEN;
DRAWTEXT(ISLASTBAR,低点支撑,' 低点支撑'), COLORRED;
DRAWTEXT(ISLASTBAR,高点压力,' 高点压力'), COLORGREEN;
DRAWTEXT(ISLASTBAR,市场成本,' MCSD'), COLORYELLOW;
DRAWTEXT(ISLASTBAR,过均必牛,' 过均必牛'), COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0,0.82,0,'关注“局部极点A”“局部极点B”两线变换 以及与“高点压力(红)”“低点支撑(绿)”两线的接触 交汇')COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0,0.92,0,'关注“高点压力(红)”“低点支撑(绿)”两线 MCSD依次排列 同步向上 趋势 位置')COLORCYAN;