//+------------------------------------------------------------------+ //| Universalny_Sound_indicator.mq4 //| Copyright © 2011, lukas1 //| Правообладатель Лукашук Виктор Геннадьевич aka lukas1 //| Внимание: данная программа не будет работать принципиально //| со стандартными встроенными индикаторами, //| работает только с пользовательскими индикаторами. //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, lukas1" #property link "lukas1@ngs.ru" #include #property indicator_separate_window //---- indicator parameters extern string Indicator_Name="Bulls"; extern double Alert_Level = 0; #property indicator_color1 Silver //---- indicator buffers double Buffer2[]; //---- int br1=0; string ticker; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() {ticker=StringTrimRight(StringTrimLeft(Indicator_Name)); IndicatorBuffers (1); IndicatorDigits (Digits); IndicatorShortName("UniSound ("+ticker+")"); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,Buffer2); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() {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; if(counted_bars==0) limit--; //---- for(int i = limit; i >=0; i--) //for(int i = 1000; i >=0; i--) { Buffer2[i]=iCustom(Symbol(),0, ticker, 0,i); } if(((Buffer2[2]<0 && Buffer2[1]>Alert_Level) || (Buffer2[2]>0 && Buffer2[1]