//+------------------------------------------------------------------+ //| JS-BollingerBands.mq4 | //| js_sergey@list.ru © 2009, | //| Пишу торговые системы | //+------------------------------------------------------------------+ #property copyright " js_sergey@list.ru " #property link " http://multiexperts.ru/ " #property indicator_chart_window #property indicator_buffers 5 #property indicator_color1 LimeGreen #property indicator_color2 RoyalBlue #property indicator_color3 RoyalBlue #property indicator_color4 Crimson #property indicator_color5 Crimson //---- input parameters extern string n2 = " Bollinger2 Настройки "; extern int BandsPeriod = 20; extern int BandsShift = 0; extern double BandsDeviations_1 = 2.0; extern double BandsDeviations_2 = 1.0; extern int BandsMetod = 0;//1,2,3 extern int BandsPrice = 4;//1,2,3,4 double Buffer_0[]; double Buffer_1[]; double Buffer_2[]; double Buffer_3[]; double Buffer_4[]; //---- //+------------------------------------------------------------------+ int init() { //---- 3 indicator buffers mapping SetIndexBuffer(0,Buffer_0); SetIndexBuffer(1,Buffer_1); SetIndexBuffer(2,Buffer_2); SetIndexBuffer(3,Buffer_3); SetIndexBuffer(4,Buffer_4); //---- drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_LINE); SetIndexStyle(3,DRAW_LINE); SetIndexStyle(4,DRAW_LINE); return(0); } //+------------------------------------------------------------------+ int start() { double stddev_1, ma_1; int limit; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- main loop for(int i=0; i