HSNP1:=CLOSE-REF(CLOSE,1);
HSNP2:=IF(CLOSE-REF(CLOSE,1)>=0,HSNP1,0);{价涨记为HSNP2}
HSNP3:=REF(CLOSE,1)-CLOSE;
HSNP4:=IF(CLOSE-REF(CLOSE,1)<=0,HSNP3,0); {价跌记为HSNP4}
HSNP5:=SUM(HSNP2,90); {90周期内涨价之和}
HSNP6:=SUM(HSNP4,90); {90周期内跌价之和}
HSNP7:=100*HSNP5/(HSNP5+HSNP6); {有点像PSY定义}
{90周期内收盘涨价和与90周期内上下变动价总和的比值×100;反应涨的情况}
HSNP8:=EMA(HSNP7,21); {求HSNP7的21周期指数移动平均,变化比HSNP7慢,也反应涨的趋势}
HSNP:=EMA(HSNP8,3); {对HSNP8其3周期的指数移动平均,可以肯定HSNP变化比HSNP8要慢}
NP:=(HSNP8-HSNP); {该值为负,说明股价是跌的趋势}
NL:=(HSNP-HSNP8); {该值为负,说明股价是涨的趋势}
STICKLINE(NL<0,-1,NL-1,2,1),COLOR0B0B77; {DARK RED 趋势为涨}
STICKLINE(NP<0,-1,NP-1,2,1),COLOR666666; {GRAY WHIT E趋势为跌}
A:EMA((CLOSE-REF(C,1))/REF(C,1)*10-(INDEXC-REF(INDEXC,1))/REF(INDEXC,1)
*10,5),LINETHICK1,COLORYELLOW;
STICKLINE(A>0,0,A,1,2),COLORRED; {个股走势强于大盘}
STICKLINE(A<0,0,A,1,2),COLORGREEN; {个股走势弱于大盘}
JJ :=(C*2+H+L)/4; {以下为仿MACD的公式计算方法}
SK := EMA(JJ,13) - EMA(JJ,21);
SD := EMA(SK,3);
SP := EMA(SK,10);
长线1:IF(SD>=SP,SD,SP),LINETHICK1,COLORFFFFAA; {淡青色}
{个人认为单独使用参考意义不大,结合下面做多、做空还有点参考意义}
长线2:IF(SP-SD,SP,SD),LINETHICK1,COLORWHITE;
A1:=EMA(CLOSE,7)-EMA(CLOSE,21); {有点像5MA上穿24MA的做多的民间算法}
B1:=EMA((0.668*REF(A1,1)+0.333*A1),1);
做多:IF(A1>=B1,A1,B1),LINETHICK1,COLORRED; {做多红线出来,做多,消失做空}
做空:IF(B1-A1,B1,A1),LINETHICK1,COLORGREEN;
累计强弱5:SUM(A,15),LINETHICK0,COLORFFFFFF;
涨家数:INDEXADV,COLOR0066FF,NODRAW;
跌家数:INDEXDEC,COLOR99FF99,NODRAW;
{涨跌比:涨家数/跌家数*100;
上涨家数:ADVANCE;
下跌家数:DECLINE;
};
市盈:C/FINANCE(33),NODRAW;
市盈FLAG:=1;
收益:FINANCE(33),NODRAW;
公积金:FINANCE(18),NODRAW;