N1:=8;N2:=22;N3:=44;
AA:=(HHV(HIGH,120)-LLV(LOW,120))/30,LINETHICK;
VAR1:=(2*CLOSE+HIGH+LOW)/4;
转换线:(HHV(HIGH,N1)+LLV(LOW,N1))/2,COLORAAFF99,LINETHICK2;
基准线:(HHV(HIGH,N2)+LLV(LOW,N2))/2,COLORFF6DD8,LINETHICK2;
迟行带:REFX(CLOSE,N2),COLORFF9224,LINETHICK2;
先行带A:REF((转换线+基准线)/2,N2),COLORYELLOW,LINETHICK;
先行带B:REF((HHV(HIGH,N3)+LLV(LOW,N3))/2,N2),COLOR909090;
STICKLINE(先行带A<先行带B,先行带A,先行带B,2,1.5),COLOR339933;
STICKLINE(先行带A>=先行带B,先行带A,先行带B,2,0.1),COLOR0033CC;
PLOYLINE(1,先行带A),COLORYELLOW;
PLOYLINE(1,基准线),COLORFF6DD8;
PLOYLINE(1,转换线),COLORAAFF99;
{ 爱约股_通达信股票指标公式}
DRAWTEXT(CROSS(转换线,基准线) AND VAR1<MIN(先行带A,先行带B),MIN(基准线,LOW)*0.995,'▲'),COLORRED;
DRAWTEXT(CROSS(转换线,基准线) AND RANGE(VAR1,MIN(先行带A,先行带B),MAX(先行带A,先行带B)),LOW*0.995,'▲N▲'),COLORRED;
DRAWTEXT(CROSS(转换线,基准线) AND VAR1>MAX(先行带A,先行带B),LOW-AA*0.5,'▲N▲N▲'),COLORRED;
DRAWTEXT(CROSS(基准线,转换线) AND VAR1<MIN(先行带A,先行带B),MAX(基准线,HIGH)+AA*2,'▼N▼N▼'),COLORFF9966;
DRAWTEXT(CROSS(基准线,转换线) AND RANGE(VAR1,MIN(先行带A,先行带B),MAX(先行带A,先行带B)),MAX(基准线,HIGH)+AA,'▼N▼'),COLORFF9966;
DRAWTEXT(CROSS(基准线,转换线) AND VAR1>MAX(先行带A,先行带B),MAX(基准线,HIGH)+AA,'▼'),COLORFF9966;
{阴柱}
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3.5,0 ),COLOR009900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3.4,0 ),COLOR00AA00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3.3,0 ),COLOR00BB00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3.2,0 ),COLOR00CC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.8,0 ),COLOR00DD00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00EE00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLOR00FF00;
{红柱}
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLORFFBBFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLORFF00FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.5,0) ,COLORFF22FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.4,0) ,COLORFF44FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.3,0) ,COLORFF66FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.2,0) ,COLORFF88FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.8,0) ,COLORFF99FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLORFFAAFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLORFFBBFF;