#property indicator_chart_window #property indicator_buffers 3 #property indicator_color2 Blue #property indicator_color3 Red double BufSAR[]; double BufBuy[]; double BufSell[]; int init() { SetIndexBuffer(0,BufSAR); SetIndexBuffer(1,BufBuy); SetIndexBuffer(2,BufSell); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,2,Blue); SetIndexArrow(1,233); SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2,Red); SetIndexArrow(2,234); return(0); } int start() { int counted_bar = IndicatorCounted(); int limit = Bars-counted_bar; if(counted_bar == 0) limit -= 1; for (int i = limit-1; i>=0; i--) { BufSAR[i] = iSAR(NULL,0,0.02,0.2,i); } if(counted_bar == 0) limit -= 2; for (i = limit-1; i>=0; i--) { BufBuy[i] = EMPTY_VALUE; if(BufSAR[i+1] >= Close[i+1] && BufSAR[i] <= Close[i]) { BufBuy[i] = Low[i]-20*Point; } BufSell[i] = EMPTY_VALUE; if(BufSAR[i+1] <= Close[i+1] && BufSAR[i] >= Close[i]) { BufSell[i] = High[i]+20*Point; } } return(0); }