//+------------------------------------------------------------------+ //| MA_Ishimoku_2.mq4 | //| Copyright © 2010, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 LightCoral #property indicator_color2 DodgerBlue #property indicator_color3 DodgerBlue //---- input parameters extern int period_a=3; // период, используемый для вычисления наивысшего значения цены extern int period_b=5; // период, используеммый для вычисления наинизшего значения цены extern int period_c=8; // период, используеммый для вычисления скользящей средней extern int mode_a=3; // параметры, используемые для поиска наивысшей и наинизшей цен: extern int mode_b=3; // 0- OPEN; 1- LOW; 2- HIGH; 3- CLOSE; 4- VOLUME. extern double percent_a=0.1; // процент отклонения от средней для построения верхней границы канала. extern double percent_b=0.1; // процент отклонения от средней для построения нижней границы канала. extern bool line_up=false; // false - верхня граница не строится ; true- верхняя граница строится; extern bool line_dw=false; // false- нижняя граница не строится ; true- нижняя граница строится; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(4); //---- indicators SetIndexStyle(0,DRAW_LINE,EMPTY,2,LightCoral); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE,EMPTY,2,DodgerBlue); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE,EMPTY,2,DodgerBlue); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); IndicatorShortName("MA_Ishimoku_Convert_Channel"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { 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-=1+period_c; int i=limit; // ArrayResize(Buffer2,Bars); if(mode_a<0 || mode_a>4){mode_a=0;} if(mode_b<0 || mode_b>4){mode_b=0;} while(i>=0) { //---- double ish_1=High[iHighest(NULL,0,mode_a,period_a,i)]; double ish_2=Low[iLowest(NULL,0,mode_b,period_b,i)]; ExtMapBuffer4[i]=(ish_1+ish_2)/2; double sum=0; for(int y=i;y