MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
牛线:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210,COLORWHITE;
马线:MA(牛线,3),COLORFF7F00;
K:COST(80),LINETHICK1;
{第一种指标}
{引力线:(MA(C,30)+MA(C,72))/2;
(MA(C,30)+MA(C,72))/2*0.9;
(MA(C,30)+MA(C,72))/2*1.1;
(MA(C,30)+MA(C,72))/2*1.2;
(MA(C,30)+MA(C,72))/2*0.8;
(MA(C,30)+MA(C,72))/2*1.3;}
{第二种个股指标}
{地心引力线:(MA(C,30)+MA(C,72))/2;
地心引力区1:地心引力线*1.2;
地心引力区2:地心引力线*0.8;
地心引力区3:地心引力线*1.1;
地心引力区4:地心引力线*0.9;
大盘指数:C;}
磁力线:(MA(CLOSE,30)+MA(CLOSE,72))/2,COLORGREEN;
多空线:(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
DRAWTEXT(crOSS(多空线,磁力线),多空线,'进场'),COLORGREEN,LINETHICK2;
DRAWTEXT(CROSS(磁力线,多空线),磁力线,'走人'),COLORRED,LINETHICK2;
DA:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;
DB:=(EMA(C,10)+EMA(C,20)+EMA(C,40)+EMA(C,80))/4;
DRAWTEXT(CROSS(DA-DB,0),L*0.95,'★B'),COLORRED;
JH:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(Abs(C-REF(C,1)),5,1)*100;
DRAWTEXT(CROSS(84,JH),H*1.02,'☆S'),COLORGREEN;
地心引力区1:磁力线*1.1,LINETHICK2,COLORRED;
地心引力区2:磁力线*0.9,LINETHICK2,COLORFF33FF;
{ _通达信股票指标公式}
高:PLOYLINE(1,CONST(HHV(H,50))),COLOR770077,LINETHICK1;
低:PLOYLINE(1,CONST(LLV(L,50))),COLOR777700,LINETHICK1;
中:PLOYLINE(1,(高-低)/2+低),COLOR005555,LINETHICK2;
MA6:=MA(C,6),COLORWHITE;
MA18:=MA(C,24),COLORYELLOW;
MA55:=MA(C,55),COLORFF00FF;
MA135:=MA(C,135),COLORFFCC66;
生命线:=EMA(CLOSE,453),LINETHICK1,COLORRED;
TY:=C;
A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10); C1:=BacKSET(B1,10+1); HD:=FILTER(C1,10);
A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10); C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);
A:=REF(C,BArslAST(HD)); B:=REF(C,BARSLAST(LD));
T1:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD) ;
T2:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);
买进价:=((C-REF(MA6,1))/6+MA6)*1.004;
买进条件:=CROSS(C,买进价) AND 买进价>REF(买进价,1);
买进:IF(买进条件,L,H),COLORWHITE,POINTDOT;
STICKLINE(买进条件,H,L,0,1),COLORWHITE,LINETHICK2;
STICKLINE(买进条件,O,C,4,1),COLORWHITE,LINETHICK2;
加码价:=((C-REF(MA18,1))/18+MA18)*1.004;
加码条件:=CROSS(C,加码价) AND 加码价>REF(加码价,1);
加码:IF(加码条件,L,H),COLORYELLOW,POINTDOT;
STICKLINE(加码条件,H,L,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(加码条件,O,C,4,1),COLORYELLOW,LINETHICK2;