九毛八公式指标
公式模块:
具体叙述一下,就是想在日k线叠加周K线的图中,标明周K线的涨幅(文字标明就可以,比如“涨”或“跌”)。
请教老师如何编写这个公式,稍后会截图说明;
1.将周涨幅,标注在每周第一天,
2.将周涨幅,标注在每周最后一天;
请教老师该如何编写这个公式,在此先感谢。
2.再建指标引用这个指标的周线数据
{111}
A0:="1引用.量#WEEK"!=REF("1引用.量#WEEK",1);
OO:="1引用.开#WEEK";
CC:="1引用.收#WEEK";
DD:="1引用.涨#WEEK";
STICKLINE(CC>=OO,CC,OO,4,0),COLOR800080;
STICKLINE(CC<=OO,CC,OO,4,0),COLOR006F00;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DRAWTEXT(A0 AND DD>0,L,'涨'),COLORYELLOW;
DRAWTEXT(REFX(A0,1) AND DD>0,L,'涨'),COLORYELLOW;
DRAWTEXT(A0 AND DD<0,L,'跌'),COLORGREEN;
DRAWTEXT(REFX(A0,1) AND DD<0,L,'跌'),COLORGREEN;
DRAWTEXT(A0 AND DD=0,L,'平'),COLORWHITE;
DRAWTEXT(REFX(A0,1) AND DD=0,L,'平'),COLORWHITE;
{222}
A0:="1引用.量#WEEK"!=REF("1引用.量#WEEK",1);
OO:="1引用.开#WEEK";
CC:="1引用.收#WEEK";
DD:="1引用.涨#WEEK";
STICKLINE(CC>=OO,CC,OO,4,0),COLOR800080;
STICKLINE(CC<=OO,CC,OO,4,0),COLOR006F00;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DRAWTEXT(A0 AND DD>0,L,'涨'),COLORYELLOW;
DRAWTEXT(REFX(A0,1) AND DD>0,L,'涨'),COLORYELLOW;
DRAWTEXT(A0 AND DD<0,L,'跌'),COLORGREEN;
DRAWTEXT(REFX(A0,1) AND DD<0,L,'跌'),COLORGREEN;
DRAWTEXT(A0 AND DD=0,L,'平'),COLORWHITE;
DRAWTEXT(REFX(A0,1) AND DD=0,L,'平'),COLORWHITE;
DRAWNUMBER(A0,MAX(CC,OO)*1.02,INTPART(DD*100+0.5)/100);