//+------------------------------------------------------------------+ //| MMA color.mq4 | //| Copyright © 2006, Rustem Bigeev. | //| http://www.parch.ru | //+------------------------------------------------------------------+ //---- indicator settings #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Black #property indicator_color2 Blue #property indicator_color3 Red //---- indicator buffers double ExtBuffer0[]; double ExtBuffer1[]; double ExtBuffer2[]; extern int PeriodMA=120; extern int TypeMA=1; extern string Mode1_ = "0 - MODE_SMA Простое скользящее среднее "; extern string Mode2_ = "1 - MODE_EMA Экспоненциальное скользящее среднее "; extern string Mode3_ = "2 - MODE_SMMA Сглаженное скользящее среднее "; extern string Mode4_ = "3 - MODE_LWMA Линейно-взвешенное скользящее среднее "; extern int PriceMA=4; extern string Price1_ = "0 - PRICE_CLOSE Цена закрытия"; extern string Price2_ = "1 - PRICE_OPEN Цена открытия"; extern string Price3_ = "2 - PRICE_HIGH Цена максимума"; extern string Price4_ = "3 - PRICE_LOW Цена минимума" ; extern string Price5_ = "4 - PRICE_MEDIAN Цена середины" ; extern string Price6_ = "5 - PRICE_TYPICAL Цена типическая"; extern string Price7_ = "6 - PRICE_WEIGHTED Цена взвешенная" ; extern int Shift=6; extern double Sensit=0.0001; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_NONE); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexStyle(2,DRAW_HISTOGRAM); IndicatorDigits(Digits+1); SetIndexDrawBegin(0,34); SetIndexDrawBegin(1,34); SetIndexDrawBegin(2,34); //---- 3 indicator buffers mapping SetIndexBuffer(0,ExtBuffer0); SetIndexBuffer(1,ExtBuffer1); SetIndexBuffer(2,ExtBuffer2); //---- name for DataWindow and indicator subwindow label IndicatorShortName("MMA color("+PeriodMA+", "+Shift+", "+TypeMA+", "+PriceMA+", "+Sensit+")"); SetIndexLabel(1,NULL); SetIndexLabel(2,NULL); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Awesome Oscillator | //+------------------------------------------------------------------+ int start() { double prev,current; int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars > 0) counted_bars--; int limit = Bars - counted_bars; if(counted_bars==0) limit--; //---- macd for(int i=0; i=0; i--) { current=ExtBuffer0[i]; prev=ExtBuffer0[i+1]; if(current>prev+Sensit) up=true; if(current