//+------------------------------------------------------------------+ //| OtherChart.mq4 | //| Copyright © 2008, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "jax1000" #property link "jax1000@list.ru" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red extern int period1=20;//начальный период интервала extern int period2=100;//конечный период интервала extern int MA_Method=0;//метод сглаживания скользящей extern int Price=0; extern int shift=0;//сдвиг скользящих, относительно номера бара extern int width=1;//толщина линии индикатора //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ double Buffer[]; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { SetIndexStyle(0,0,0,width); SetIndexBuffer(0,Buffer); SetIndexLabel(0,"SUM/MA"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- последний посчитанный бар будет пересчитан if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- основной цикл for(int i=0; i