【源码分享】趋势比对副图指标公式(通达信电脑 手机版)
电脑版效果展示:
手机版效果展示:
公式源码:
R1:=3*SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,5,1)-2*SMA(SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,5,1),3,1);
R2:=3*SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13))*100,5,1)-2*SMA(SMA((C-LLV(L,13))/(HHV(H,13)-LLV(L,13))*100,5,1),3,1);
R3:=3*SMA((C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100,5,1)-2*SMA(SMA((C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100,5,1),3,1);
R4:=3*SMA((C-LLV(L,43))/(HHV(H,43)-LLV(L,43))*100,5,1)-2*SMA(SMA((C-LLV(L,43))/(HHV(H,43)-LLV(L,43))*100,5,1),3,1);
R5:=3*SMA((C-LLV(L,55))/(HHV(H,43)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
短趋势:(R1+R2+R3+R5+R4)/5,LINETHICK2;
IF(短趋势>=REF(短趋势,1),短趋势,DRAWNULL),COLORRED,LINETHICK2;
短趋势3:EMA(短趋势,3);
超短趋势:短趋势-REF(短趋势,1);
超短趋势3:EMA(超短趋势,3);
金叉共振:CROSS(短趋势,短趋势3) AND CROSS(超短趋势,超短趋势3),COLORYELLOW,NODRAW;
死叉共振:CROSS(短趋势3,短趋势) AND CROSS(超短趋势3,超短趋势),COLORMAGENTA,NODRAW;
STICKLINE(金叉共振,短趋势3,超短趋势,1,0)COLORYELLOW;
STICKLINE(死叉共振,短趋势,超短趋势3,1,0)COLORMAGENTA;
DRAWTEXT(ISLASTBAR,短趋势,' 短趋势'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,超短趋势,' 超短趋势'),COLORYELLOW;