{压力支撑}
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
{HIGHN日前的最高价=2*HIGHN+1日内最高价的最高值}
QY:=BACKSET(AAB,HIGHN+1);{若AA则将最近HIGHN+1周期置为1}
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
{QY的HIGHN日过滤 AND 最高价=HIGHN+1日内最高价的最高值}
DRAWICON(CC,H*1.005,2);
DDD:=BARSLAST(CC);{上次CC距今天数}
GDTS:=IF(CC,CURRBARSCOUNT,0);{如果CC,返回到最后交易日的周,否则返回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);
MMM:=IF(CURRBARSCOUNT GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,DOTLINE;
压力A:DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,DOTLINE;
压力B:DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,DOTLINE;
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);
公式模块:
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
{HIGHN日前的最高价=2*HIGHN+1日内最高价的最高值}
QY:=BACKSET(AAB,HIGHN+1);{若AA则将最近HIGHN+1周期置为1}
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
{QY的HIGHN日过滤 AND 最高价=HIGHN+1日内最高价的最高值}
DDD:=BARSLAST(CC);{上次CC距今天数}
GDTS:=IF(CC,CURRBARSCOUNT,0);{如果CC,返回到最后交易日的周,否则返回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);
MMM:=IF(CURRBARSCOUNT GDCS2,0,1);
压力A:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1);
XG:CROSS(C,压力A);