股道至简 最好的均线系统{考夫曼自适应均线}

N 最小5 最大30  默认20
K 最小1最大10  默认8
DIRECTION:=ABS(CLOSE-REF(CLOSE,N));
VOLATILITY:=SUM(ABS(CLOSE-REF(CLOSE,1)),N);
ER:=DIRECTION/VOLATILITY;
FSC:=2/(2+1);
SSC:=2/(30+1);
SC:=ER*(FSC-SSC)+SSC;
SCSQ:=SC*SC;
KMA:DMA(CLOSE,SCSQ),COLORBLUE,LINETHICK2;
THRESHOLD:=STD(KMA-REF(KMA,1),20)*K/10;
BUY:=KMA-LLV(KMA,4)>THRESHOLD;
SELL:=HHV(KMA,4)-KMA>THRESHOLD;
买入:IF(BUY=1 AND SELL=0,KMA,DRAWNULL),COLORRED,LINETHICK2;
观望:IF((BUY=0 AND SELL=0) OR (BUY=1 AND SELL=1),KMA,DRAWNULL),COLORBLUE,LINETHICK2;
卖出:IF(BUY=0 AND SELL=1,KMA,DRAWNULL),COLOR66BB99,LINETHICK2;

(0)

相关推荐