网友求助:
MACD死叉开始,到他金叉结束,这一过程中,在DIFF的最低点画横线,横线的范围是由死叉开始,到金叉结束。
解答如下:
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
bn:=BARSLAST(cross(dea,diff));
ba:=BACKSET(cross(diff,dea),LLVBARS(diff,bn+1)+1);
bn2:=BARSLAST(ref(ba,1)=0 and ba=1);
PARTLINE(bn2 and ba,ref(diff,bn2)),color0000ff,LINETHICK3;
最小值:ref(diff,bn2),POINTDOT,color00ff00;