通达信市场盈亏比副图指标 源码分享 附图
CYC13:=0.01*EMA(AMOUNT,13)/EMA(V,13);
CYS:(C-CYC13)/CYC13*100,COLORWHITE,LINETHICK2;
绝对风险区:10,COLORRED,DOTLINE,LINETHICK1;
风险区:5,COLORMAGENTA,DOTLINE,LINETHICK1;
中线值:0,COLORYELLOW,DOTLINE,LINETHICK2;
买入区:-5,COLORLIBLUE,DOTLINE,LINETHICK1;
安全区:-10,COLORGREEN,DOTLINE;
NOTEXT:IF(CYS>=0,CYS,DRAWNULL),COLORRED,LINETHICK2;
NOTEXT2:IF(CYS>=10,CYS,DRAWNULL),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),COLORYELLOW;
DRAWTEXT(底背离,CYS,'↑底背离'),COLORYELLOW;
顶背离:=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),COLORYELLOW;
DRAWTEXT(顶背离,CYS,'↓顶背离'),COLORYELLOW;};
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
CYC13赋值:0.01*成交额的13日指数移动平均/V的13日指数移动平均
输出CYS:(C-CYC13)/CYC13*100,画白色, 线宽为2
输出绝对风险区:10,画红色,DOTLINE,LINETHICK1
输出风险区:5,画洋红色,DOTLINE,LINETHICK1
输出中线值:0,画黄色,DOTLINE, 线宽为2
输出买入区:-5,COLORLIBLUE,DOTLINE,LINETHICK1
输出安全区:-10,画绿色,DOTLINE
如果CYS>=0返回CYS否则返回DRAWNULL
如果CYS>=10返回CYS否则返回DRAWNULL
{N赋值:5
底背离赋值:REF(C,上次REF(FILTER(BACKSET(REF(CYS,N距今天数=2*N+1日内CYS最低值,N+1),N) AND CYS=N+1日内CYS最低值,1))+1)>C AND REF(CYS,上次REF(FILTER(BACKSET(REF(CYS,N距今天数=2*N+1日内CYS最低值,N+1),N) AND CYS=N+1日内CYS最低值,1))+1)
DRAWLINE(FILTER(BACKSET(N日前的CYS=2*N+1日内CYS最低值,N+1),N) AND CYS=N+1日内CYS最低值,CYS,FILTER(底背离>0,5),CYS,0),画黄色
当满足条件底背离时,在CYS和'↑底背离'位置书写文字
顶背离赋值:REF(C,上次REF(FILTER(BACKSET(REF(CYS,N距今天数=2*N+1日内CYS最高值,N+1),N) AND CYS=N+1日内CYS最高值,1))+1)CYS AND FILTER(BACKSET(REF(CYS,N)=2*N+1日内CYS最高值,N+1),N) AND CYS=N+1日内CYS最高值,画绿色,NODRAW
DRAWLINE(FILTER(BACKSET(N日前的CYS=2*N+1日内CYS最高值,N+1),N) AND CYS=N+1日内CYS最高值,CYS,FILTER(顶背离>0,5),CYS,0),画黄色
当满足条件顶背离时,在CYS和'↓顶背离'位置书写文字
}