通达信缠中说禅趋势主图源码分享
SHORT:=7;
LONG:=19;
T:=PERIOD;
D:=IF(T=0,30,IF(T=1,25,IF(T=8,25,IF(T=2,20,IF(T=3,20,IF(T=4,20,IF(T=5,10,IF(T=6,10,IF(T=7,10,IF(T=9,10,IF(T=10,10,10)))))))))));
RMA:EMA(CLOSE,SHORT),COLORLIGRAY;
NMA:EMA(CLOSE,LONG),COLORMAGENTA;
RISK:IF(NMA>RMA,NMA,DRAWNULL),COLORGREEN;
UP:DRAWLINE(L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1) AND L=LLV(L,D) AND RMA<=NMA,L,H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1) AND H=HHV(H,D) AND RMA>=NMA,H,0),COLOR0000FF,LINETHICK2;
DOWN:DRAWLINE(H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1) AND H=HHV(H,D) AND RMA>=NMA,H,L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1) AND L=LLV(L,D) AND RMA<=NMA,L,0),COLOR00FF00,LINETHICK2;
UH:HHV(H,55),COLORBROWN;
MID:(HHV(H,55)+LLV(L,55))/2,COLORBROWN;
DL:LLV(L,55),COLORBROWN;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SHORT赋值:7
LONG赋值:19
T赋值:PERIOD
D赋值:IF(T=0,30,IF(T=1,25,IF(T=8,25,IF(T=2,20,IF(T=3,20,IF(T=4,20,IF(T=5,10,IF(T=6,10,IF(T=7,10,IF(T=9,10,IF(T=10,10,10)))))))))))
输出RMA:收盘价的SHORT日指数移动平均,COLORLIGRAY
输出NMA:收盘价的LONG日指数移动平均,COLORMAGENTA
如果NMA>RMA返回NMA否则返回DRAWNULL
输出UP:DRAWLINE(L=LLV(L,上次NMA上穿RMA距今天数+1) AND L=LLV(L,D) AND RMA<=NMA,L,H=HHV(H,BARSLAST(RMA上穿NMA)+1) AND H=HHV(H,D) AND RMA>=NMA,H,0),COLOR0000FF,LINETHICK2
DOWN:DRAWLINE(H=HHV(H,上次RMA上穿NMA距今天数+1) AND H=HHV(H,D) AND RMA>=NMA,H,L=LLV(L,BARSLAST(NMA上穿RMA)+1) AND L=LLV(L,D) AND RMA<=NMA,L,0),COLOR00FF00,LINETHICK2
输出UH:55日内H最高值,COLORBROWN
MI输出D:(55日内H最高值+55日内L最低值)/2,COLORBROWN
DL:55日内L最低值,COLORBROWN