通达信多空对比副图公式
短期:100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5)),LINETHICK1;
中期:100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10)),LINETHICK1;
中长期:100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20)),LINETHICK1;
长期:100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30)),LINETHICK1,COLORRED;
{短期:(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100,LINETHICK1;
中期:(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100,LINETHICK1;
中长期:(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100,LINETHICK1;
长期:(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,LINETHICK1,COLORRED};
四剑归零:DRAWTEXT(短期=0 AND 中期=0 AND 长期=0,(20),'0'),COLORFFFF00;
{2线背离}
{A1:=短期<REF(短期,1) AND 中期>REF(中期,1) AND 中长期<REF(中长期,1) AND 长期<REF(长期,1);
A2:=短期>REF(短期,1) AND 中期<REF(中期,1) AND 中长期>REF(中长期,1) AND 长期>REF(长期,1);
背离2:IF(A1 OR A2,0,-10),COLOR008000;}
{3线背离}
{A3:=中长期>REF(中长期,1) AND 短期<REF(短期,1) AND 中期<REF(中期,1) AND 长期<REF(长期,1);
A4:=中长期<REF(中长期,1) AND 短期>REF(短期,1) AND 中期>REF(中期,1) AND 长期>REF(长期,1);
背离3:IF(A3 OR A4,0,-10),COLORFF8000;}
{4线背离}
{A5:=长期>REF(长期,1) AND 短期<REF(短期,1) AND 中长期<REF(中长期,1) AND 中期<REF(中期,1);
A6:=长期<REF(长期,1) AND 短期>REF(短期,1) AND 中长期>REF(中长期,1) AND 中期>REF(中期,1);
背离4:IF(A5 OR A6,90,100),COLORGREEN;}
{画线}
{50,COLORLIMAGENTA};
{底部反弹投机}
投机:IF(短期<20 AND 长期<20,-10,5),COLOR0000FF;
{深红色强势投机线}
强投机:IF(中长期>=45 AND 长期>=45,长期,DRAWNULL),COLORRED,LINETHICK2;
1532399537.png
|