CYS量价背离(通达信公式 副图 源码 测试图)
CYS量价背离,参数跟系统的CYS一样,优化,自用,易懂,公式没加密
顶背离,底背离用到未来函数,只能作为参考!
DRAWGBK(O>=0,RGB(22,22,22),RGB(22,22,22),0,'0',0);
+5,DOTLINE,COLORYELLOW;
DRAWTEXT(ISLASTBAR,+5,' +5金线'),COLORWHITE;
-6,DOTLINE,COLORRED;
DRAWTEXT(ISLASTBAR,-6,' -6'),COLORWHITE;
DRAWBAND(-16,RGB(64,128,64),-20,RGB(22,22,22));
DRAWBAND(-20,RGB(0,100,0),-25,RGB(22,22,22));
DRAWTEXT(ISLASTBAR,-16,' -16'),COLORWHITE;
DRAWTEXT(ISLASTBAR,-20,' -20'),COLORWHITE;
DRAWTEXT(ISLASTBAR,-25,' -25'),COLORWHITE;
CYC13:=0.01*EMA(AMOUNT,13)/EMA(VOL,13);
CYS:(CLOSE-CYC13)/CYC13*100,COLORYELLOW,LINETHICK2;
N:=5;
底背离:=REF(C,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),1))+1)>C AND REF(CYS,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),1))+1)<CYS AND FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),COLORWHITE,NODRAW;
DRAWLINE(FILTER(BACKSET(REF(CYS,N)=LLV(CYS,2*N+1),N+1),N) AND CYS=LLV(CYS,N+1),CYS,FILTER(底背离>0,5),CYS,0),COLORWHITE,DOTLINE;
DRAWTEXT(底背离,CYS,'↑底背离'),COLORWHITE;
顶背离:=REF(C,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),1))+1)<C AND REF(CYS,BARSLAST(REF(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),1))+1)>CYS AND FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),COLORGREEN,NODRAW;
DRAWLINE(FILTER(BACKSET(REF(CYS,N)=HHV(CYS,2*N+1),N+1),N) AND CYS=HHV(CYS,N+1),CYS,FILTER(顶背离>0,5),CYS,0),COLORGREEN,DOTLINE;
DRAWTEXT(顶背离,CYS,'↓顶背离'),COLORGREEN;
DRAWTEXT_FIX(C>0,0.65,0.90,0,'穿过红线(-6)是多头'),COLORLIRED;
DRAWTEXT_FIX(C>0,0.78,0.90,0,'绿色(-16~-25)是超卖区(关注)'),COLORLIGREEN;
DRAWTEXT_FIX(C>0,0.01,0.9,0,'CYS - 市场盈亏指标'),COLORYELLOW;
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!