原版SAR指标显示红柱,和大多数软件K线重叠,显得凌乱。所以,自己做了修改,把上涨红柱,换成蓝柱显示!
_持仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORFF0000,{COLOR9955FF};
_空仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORGREEN,{COLORDDFF00};
_现价:CLOSE,COLORWHITE,NODRAW;
_10日涨跌%: (C-REF(CLOSE,10))/REF(CLOSE,10)*100,COLORGREEN,NODRAW;
连红:BARSLAST(CLOSE SAR(4,2,20)),NODRAW;
连绿:BARSLAST(CLOSE SAR(4,2,20)),NODRAW;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2 =(9.5-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,4,0),COLORRED;
STICKLINE(涨停,H,L,0,0),COLORRED;
跌停:=IF((C2-C)*100/C2 =(9.5-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,4,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
SAR也是隨著股價的強弱上升或下降,但上升或下降的速度,是隨著AF與區間極值這兩個參數的變化,也可以說這兩個參數是一種加速因子,如此才能形成拋物線的樣子。