网友求助:
条件 MACD指标 DIFF上交DEA 在主图满足条件当天K线处画一条收盘线,线段保留5天(如不可,可直接画条直线也可以)
附上MACD指标
{MACD}
DIFF:=EMA(CLOSE,9)-EMA(CLOSE,21);
DEA:=EMA(DIFF,6);
MACD:=2*(DIFF-DEA);
解答如下:
DIFF:=EMA(CLOSE,9)-EMA(CLOSE,21);
DEA:=EMA(DIFF,6);
aa:=cross(DIFF,DEA);
t:=BARSLAST(aa);
tt:=if(t<=4,t,0);
HORILINE(aa,c,tt<ref(tt,1) );