//+------------------------------------------------------------------+ //| OscSAR.mq4 | //| Copyright © 2010, LeMan. | //| b-market@mail.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, LeMan." #property link "b-market@mail.ru" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Blue //---- extern double Step = 0.02; extern double Maximum = 0.2; //---- double OscBuffer[]; //+------------------------------------------------------------------+ int init() { string short_name; //---- IndicatorDigits(Digits); //---- SetIndexStyle(0, DRAW_LINE); SetIndexBuffer(0, OscBuffer); //---- SetIndexDrawBegin(0, 14); //---- short_name = "OscSAR (" + Step + "," + Maximum + ") "; IndicatorShortName(short_name); //---- return(0); } //+------------------------------------------------------------------+ int start() { int i, limit, counted_bars = IndicatorCounted(); //---- if (Bars < 3) { return(0); } //---- if (counted_bars > 0) { counted_bars--; } limit = Bars - counted_bars - 1; for (i = limit; i >= 0; i--) { OscBuffer[i] = Close[i] - iSAR(NULL, 0, Step, Maximum, i); } //---- return(0); } //+------------------------------------------------------------------+