通达信中短趋势 源码
回归斜率线A:=EMA(SLOPE(C,21)*20+C,42);
经典RL:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
经典K:=SMA(经典RL,3,1); 经典D:=SMA(经典K,3,1); 经典J:=3*经典K-2*经典D;
MAHL1:=100*((EMA((H+L)/2,3)-LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20)))/(LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20))));
MAHL2:=IF(EMA(C,2)>回归斜率线A AND MAHL1>0,EMA(C,3),LLV(EMA((H+L)/2,5),30));{A}
MAHL3:=IF(EMA(C,2)>回归斜率线A AND MAHL1>0,LLV(EMA((H+L)/2,5),30),EMA(C,5));{A}
MAHL4:DRAWBAND(MAHL2,RGB(105,32,32),MAHL3,RGB(0,154,154));
MAHL5:DRAWBAND(EMA(C,2),RGB(135,32,32),EMA(C,5),RGB(0,154,154));
MAHL6:DRAWBAND(EMA(C,2),RGB(135,32,32),EMA(C,9),RGB(0,154,154));
回归斜率带:DRAWBAND(回归斜率线A,RGB(235,0,230),REF(回归斜率线A,2),RGB(0,104,154));
{C>昨C红K柱+C>O红K柱 C>昨C红K柱 C=昨C是跟白色24线
C<昨C蓝K柱+C>O红K柱 C<昨C蓝K柱}
STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,0 ),COLORRED;
STICKLINE(C<O AND C>REF(C,1),C,O,3,0),COLORFFCC00;
STICKLINE(CLOSE> REF(CLOSE,1) AND C>O ,OPEN,CLOSE,3,0 ),COLOR000055;{红K};
STICKLINE(CLOSE> REF(CLOSE,1) AND C>O,OPEN,CLOSE,2.7,0 ),COLOR000077;{红K};
STICKLINE(CLOSE> REF(CLOSE,1) AND C>O,OPEN,CLOSE,2.1,0 ),COLOR000099;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLOR0000BB;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLOR0000DD;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLOR0000FF;
STICKLINE(CLOSE= REF(CLOSE,1) ,H,L,3,1 ),COLOR999999;
STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,0 ),COLORWHITE;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR555555;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR777777;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR999999;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORBBBBBB;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORDDDDDD;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORFFFFFF;
STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;
STICKLINE(C<REF(C,1) AND C>O,C,O,3,0),COLORFFCC00;
STICKLINE(C<REF(C,1) AND C<O ,OPEN,CLOSE,3,0 ),COLOR990000;
STICKLINE(C<REF(C,1) AND C<O ,OPEN,CLOSE,2.7,0 ),COLORCC0000;
STICKLINE(CLOSE< REF(C,1) ,OPEN,CLOSE,2.1,0 ),COLORFF4400;
STICKLINE(CLOSE< REF(C,1) ,OPEN,CLOSE,1.5,0 ),COLORFF8800;
STICKLINE(CLOSE< REF(C,1) ,OPEN,CLOSE,0.9,0 ),COLORFFCC00;
经典KDJ买:IF(CROSS(经典K,经典D),(L-(H-L)/2),DRAWNULL),POINTDOT,LINETHICK6,COLOR0000FF;{高亮红}
回归斜率买:IF(CROSS(EMA(C,3),回归斜率线A),(L-(H-L)/3),DRAWNULL),POINTDOT,COLOR0000FF;{高亮红}
回归斜率买_:DRAWICON(CROSS(EMA(C,3),回归斜率线A),(L-(H-L)/3),1),{买};
回归斜率卖:IF(CROSS(回归斜率线A,EMA(C,2)),(H+(H-L)/3),DRAWNULL),POINTDOT,COLOR00CF00;{中绿}
卖:DRAWICON(CROSS(回归斜率线A,EMA(C,2)),(H+(H-L)/3),2);{股票指标网}
经典KDJ卖:IF(CROSS(经典D,经典K),(H+(H-L)/2),DRAWNULL),CROSSDOT,LINETHICK3,COLOR00CF00;{中绿};
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
回归斜率线A赋值:EMA(SLOPE(C,21)*20+C,42)
经典RL赋值:(收盘价-9日内最低价最低值)/(9日内最高价最高值-9日内最低价最低值)*100
经典RL的3日[1日权重]移动平均
经典K的3日[1日权重]移动平均
经典J赋值:3*经典K-2*经典D
MAHL1赋值:100*((EMA((H+L)/2,3)-LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20)))/(LLV(EMA((H+L)/2,5),30)-(EMA(H,20)-EMA(L,20))))
MAHL2赋值:IF(C的2日指数移动平均>回归斜率线A AND MAHL1>0,C的3日指数移动平均,LLV(EMA((H+L)/2,5),30))
{A}
MAHL3赋值:IF(C的2日指数移动平均>回归斜率线A AND MAHL1>0,LLV(EMA((H+L)/2,5),30),EMA(C,5))
输出{A}
MAHL4:DRAWBAND(MAHL2,RGB(105,32,32),MAHL3,RGB(0,154,154))
输出
MAHL5:DRAWBAND(C的2日指数移动平均,RGB(135,32,32),C的5日指数移动平均,RGB(0,154,154))
输出
MAHL6:DRAWBAND(C的2日指数移动平均,RGB(135,32,32),C的9日指数移动平均,RGB(0,154,154))
输出
回归斜率带:DRAWBAND(回归斜率线A,RGB(235,0,230),2日前的回归斜率线A,RGB(0,104,154))
{C>昨C红K柱+C>O红K柱 C>昨C红K柱 C=昨C是跟白色24线
C<昨C蓝K柱+C>O红K柱 C<昨C蓝K柱}
STICKLINE(收盘价> 1日前的收盘价 ,最高价,最低价,0,0 ),画红色
STICKLINE(C1日前的C,C,O,3,0),COLORFFCC00
STICKLINE(收盘价> 1日前的收盘价 AND C>O ,开盘价,收盘价,3,0 ),COLOR000055
{红K}
STICKLINE(收盘价> 1日前的收盘价 AND C>O,开盘价,收盘价,2.7,0 ),COLOR000077
{红K}
STICKLINE(收盘价> 1日前的收盘价 AND C>O,开盘价,收盘价,2.1,0 ),COLOR000099
STICKLINE(收盘价> 1日前的收盘价 ,开盘价,收盘价,1.5,0 ),COLOR0000BB
STICKLINE(收盘价> 1日前的收盘价 ,开盘价,收盘价,0.9,0 ),COLOR0000DD
STICKLINE(收盘价> 1日前的收盘价 ,开盘价,收盘价,0.3,0 ),COLOR0000FF
STICKLINE(收盘价= 1日前的收盘价 ,H,L,3,1 ),COLOR999999
STICKLINE(收盘价= 1日前的收盘价 ,最高价,最低价,0,0 ),画白色
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,3,0 ),COLOR555555
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,2.7,0 ),COLOR777777
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,2.1,0 ),COLOR999999
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,1.5,0 ),COLORBBBBBB
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,0.9,0 ),COLORDDDDDD
STICKLINE(收盘价= 1日前的收盘价 ,开盘价,收盘价,0.3,0 ),COLORFFFFFF
STICKLINE(收盘价< 1日前的收盘价 ,最高价,最低价,0,1 ),画青色
STICKLINE(C<1日前的C AND C>O,C,O,3,0),COLORFFCC00
STICKLINE(C<1日前的C AND C
STICKLINE(C<1日前的C AND C
STICKLINE(收盘价< 1日前的C ,开盘价,收盘价,2.1,0 ),COLORFF4400
STICKLINE(收盘价< 1日前的C ,开盘价,收盘价,1.5,0 ),COLORFF8800
STICKLINE(收盘价< 1日前的C ,开盘价,收盘价,0.9,0 ),COLORFFCC00
经典KDJ买:IF(经典K上穿经典D,(L-(H-L)/2),DRAWNULL),POINTDOT,LINETHICK6,COLOR0000FF
输出{高亮红}
回归斜率买:IF(CROSS(C的3日指数移动平均,回归斜率线A),(L-(H-L)/3),DRAWNULL),POINTDOT,COLOR0000FF
{高亮红}
回归斜率买_:DRAWICON(CROSS(C的3日指数移动平均,回归斜率线A),(L-(H-L)/3),1),{买}
输出
回归斜率卖:IF(CROSS(回归斜率线A,C的2日指数移动平均),(H+(H-L)/3),DRAWNULL),POINTDOT,COLOR00CF00
输出{中绿}
卖:DRAWICON(CROSS(回归斜率线A,C的2日指数移动平均),(H+(H-L)/3),2)
{股票指标网}
经典KDJ卖:IF(经典D上穿经典K,(H+(H-L)/2),DRAWNULL),CROSSDOT, 线宽为3,COLOR00CF00
{中绿}