{短线持股持币区,红线区持股,绿线区持币}
N1:=IF(BARSCOUNT(C)>=8,8,BARSCOUNT(C));
AMOV1:=vol*(C+L+H)/3;
短线:SUM(AMOV1,N1)/SUM(VOL,N1),COLORRED;
{DRAWTEXT(CURRBARSCOUNT=1,短线*0.998,' 短线'),COLORRED;}
NOTEXT1:IF(C>=短线,短线,DRAWNULL),LINETHICK2,COLORRED;
NOTEXT2:IF(C<短线,短线,DRAWNULL),LINETHICK2,COLORGREEN;
{中线持股持币区,黄线区持股,灰线区持币}
N2:=IF(BARSCOUNT(C)>=48,48,BARSCOUNT(C));
AMOV2:=VOL*(C+L+H)/3;
中线:SUM(AMOV2,N2)/SUM(VOL,N2),COLORYELLOW;
{DRAWTEXT(CURRBARSCOUNT=1,中线*0.998,' 中线'),COLORRED;}
NOTEXT3:IF(C>=中线,中线,DRAWNULL),LINETHICK2,COLORYELLOW;
NOTEXT4:IF(C<中线,中线,DRAWNULL),LINETHICK2,COLORGRAY;
{短线金叉中线}
JC:=crOSS(短线,中线);
DRAWICON(JC,L,9);
{筹码平均成本线}
筹均线:IF(CURRBARSCOUNT<13,CONst(COST(50)),DRAWNULL),COLORWHITE,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=1,筹均线*0.998,' 筹均线'),COLORWHITE;
{2020.8.23之后涨跌停显示}
前5天:=BARSCOUNT(C)>5;{上市大于五天,前五天不限制幅度}
ZC:=REF(C,1);
ZF:=(H-ZC+0.01)/ZC*100;
DF:=(ZC-L+0.01)/ZC*100;
涨5:=ZF>=5 AND 前5天 AND C=H;
跌5:=DF>=5 AND 前5天 AND C=L;
涨10:=ZF>=10 AND 前5天 AND C=H;
跌10:=DF>=10 AND 前5天 AND C=L;
涨20:=ZF>=20 AND 前5天 AND C=H;
跌20:=DF>=20 AND 前5天 AND C=L;
涨停板:=IF(INBLOCK('科创板'),涨20,IF(INBLOCK('创业板') AND DATE>1200823,涨20,IF(INBLOCK('ST板块'),涨5,涨10)));
跌停板:=IF(INBLOCK('科创板'),跌20,IF(INBLOCK('创业板') AND DATE>1200823,跌20,IF(INBLOCK('ST板块'),跌5,跌10)));
STICKLINE(涨停板,O,C,2.7,0),COLORYELLOW;
STICKLINE(涨停板,O,C,1.5,0),COLORRED;
STICKLINE(跌停板,O,C,1.5,0),COLORBLUE;
曾涨5:=ZF>=5 AND 前5天 AND C<H;
曾跌5:=DF>=5 AND 前5天 AND C>L;
曾涨10:=ZF>=10 AND 前5天 AND C<H;
曾跌10:=DF>=10 AND 前5天 AND C>L;
曾涨20:=ZF>=20 AND 前5天 AND C<H;
曾跌20:=DF>=20 AND 前5天 AND C>L;
曾涨停板:=IF(INBLOCK('科创板'),曾涨20,IF(INBLOCK('创业板') AND DATE>1200823,曾涨20,IF(INBLOCK('ST板块'),曾涨5,曾涨10)));
曾跌停板:=IF(INBLOCK('科创板'),曾跌20,IF(INBLOCK('创业板') AND DATE>1200823,曾跌20,IF(INBLOCK('ST板块'),曾跌5,曾跌10)));
STICKLINE(曾涨停板,O,C,0.1,0),COLORLImaGENTA;
DRAWICON(曾涨停板,H*1.001,37);
DRAWTEXT(曾涨停板,H-0.02,'大阳!'),COLORCYAN;
STICKLINE(曾跌停板,O,C,0.1,0),COLORBLUE;
DRAWICON(曾跌停板,L*0.98,36);
DRAWTEXT(曾跌停板,L-0.1,'大阴!'),COLORLIRED;
拉升力:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,30)-LLV(LOW,36))*0.6*CLOSE;
拉升力A:=SMA(拉升力,6.3,1);
波峰波谷:SMA(拉升力A,3,1),COLORFF00FF;
拉升力B:=3*拉升力A-2.1*波峰波谷;
空方:=3*波峰波谷-1* 拉升力A;
做空:IF(空方>拉升力B,拉升力B,空方),LINETHICK2,COLOR00FF00;
做空周期:HHV(做空,21),COLORBLUE,LINETHICK2;
多头:IF(做空>=REF(做空,1) ,做空,DRAWNULL),COLORRED,LINETHICK3;
DRAWICON(做空>=REF(做空,1) AND REF(做空,1)<REF(做空,2),做空,23);
空头:IF(做空<REF(做空,1),做空,DRAWNULL),COLORGREEN,LINETHICK3;
{DRAWICON(做空<=REF(做空,1) AND REF(做空,1)>REF(做空,2),做空,19);}