今天在网上闲逛,把一个大智慧的 稳赚趋势 改成通达信的,给想学习源码的同学们分享, 指标主要是依据股价的10日和20日均线为基础,控制K线变色,而其均线也随趋势改变颜色。
结合指标源码看图:
ZJ:EMA(C,10),COLOR0000FF;
HY:EMA(C,20),COLORFF00FF;
IF(ZJ REF(ZJ,1),ZJ,DRAWNULL),COLORRED,LINETHICK2;
IF(ZJ =REF(ZJ,1),ZJ,DRAWNULL),COLORGREEN,LINETHICK2;
IF(HY REF(HY,1),HY,DRAWNULL),COLORMAGENTA,LINETHICK2;
IF(HY REF(HY,1),HY,DRAWNULL),COLORBLUE,LINETHICK2;
STICKLINE(CLOSE ZJ,HIGH,L,0,0),COLORRED;
STICKLINE(CLOSE ZJ,C,OPEN,2.5,0),COLORRED;
STICKLINE(CLOSE = ZJ,H,L,3,0),COLORWHITE;
STICKLINE(CLOSE ZJ,H,L,0,0),COLORYELLOW;
STICKLINE(CLOSE ZJ,O,C,2.5,0),COLORYELLOW;
STICKLINE(CLOSE HY,OPEN,CLOSE,2.5,0),COLORCYAN;
STICKLINE(CLOSE HY,HIGH,L,0,0),COLORCYAN;