//+------------------------------------------------------------------+ //| MA_Ishimoku.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 1 #property indicator_color1 LightCoral //---- 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. //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer4[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(2); //---- indicators SetIndexStyle(0,DRAW_LINE,EMPTY,2,LightCoral); SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer4); IndicatorShortName("MA_Ishimoku"+period_a+" "+period_b+" "+period_c); //---- 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 i=Bars-counted_bars; if(counted_bars==0) i-=1+period_c; 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