//+------------------------------------------------------------------+ //| chart_MACD_4.mq4 | //| Copyright © 2008, MetaQuotes Software Corp. | //| forex_@i.ua KONDOR | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_buffers 8 #property indicator_color1 Gray #property indicator_color2 Gray #property indicator_color3 Gray #property indicator_color4 CLR_NONE #property indicator_color5 CLR_NONE #property indicator_color6 CLR_NONE #property indicator_color7 CLR_NONE #property indicator_color8 CLR_NONE extern int EUR= 1; // можно включить(выключить) данную валюту в(из) рассчет(а) индикатора extern int GBP= 1; // 0 - выключить extern int AUD= 0; extern int NZD= 0; extern int USD= 1; extern int CAD= 0; extern int CHF= 0; extern int JPY= 0; extern int per1=25,per2=50,sign=3; // параметры макд extern int History=200; // количество рассчетных баров для отображения индикатора int type=MODE_MAIN; double z0[],z1[],z2[],z3[],z4[],z5[],z6[],z7[]; int ind[8]; int n[]; double z[]; string simb[]; int sum=0; string Val[8]={"EUR","GBP","AUD","NZD","USD","CAD","CHF","JPY"}; color Valcol[8]={Red,Violet,Yellow,LightSeaGreen,Green,Aqua,Orange,FireBrick}; string short_name; string text; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators ind[0]=EUR; ind[1]=GBP; ind[2]=AUD; ind[3]=NZD; ind[4]=USD; ind[5]=CAD; ind[6]=CHF; ind[7]=JPY; sum=0; for(int a=0; a<8; a++) { if(ind[a]!=0) { sum++; ArrayResize(n,sum); n[sum-1]=a; } } ArrayResize(z,sum); ArrayResize(simb,sum); ArraySort(n,WHOLE_ARRAY,0,MODE_ASCEND); // сортировка индексов по возрастанию for(a=0; a0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit--; if(limit>History-1) limit=History-1; ArrayResize(z,ArraySize(z0)); //------------------------------------------------------------------------------------------- int xtot=20; int y=5; for(int i=0;i0) z0[i]= z[0]; if(ArraySize(z)>1) z1[i]= z[1]; if(ArraySize(z)>2) z2[i]= z[2]; if(ArraySize(z)>3) z3[i]= z[3]; if(ArraySize(z)>4) z4[i]= z[4]; if(ArraySize(z)>5) z5[i]= z[5]; if(ArraySize(z)>6) z6[i]= z[6]; if(ArraySize(z)>7) z7[i]= z[7]; } double cls=1; for(a=0; a