//+------------------------------------------------------------------+ //| chart_delta_MACD.mq4 | //| Copyright © 2010, 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 CLR_NONE #property indicator_color4 CLR_NONE #property indicator_color5 Gray #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; int type=MODE_MAIN; extern int History=200; // количество рассчетных баров для отображения индикатора extern int per1=25,per2=50,sign=3; // параметры макд string simb[28]={ "EURGBP","EURAUD","EURNZD","EURUSD","EURCAD","EURCHF","EURJPY", "GBPAUD","GBPNZD","GBPUSD","GBPCAD","GBPCHF","GBPJPY","AUDNZD", "AUDUSD","AUDCAD","AUDCHF","AUDJPY","NZDUSD","NZDCAD","NZDCHF", "NZDJPY","USDCAD","USDCHF","USDJPY","CADCHF","CADJPY","CHFJPY"}; string Val[8] ={"EUR","GBP","AUD","NZD","USD","CAD","CHF","JPY"}; color Valcol[8]={Red,Violet,Yellow,LightSeaGreen,Green,Aqua,Orange,FireBrick}; int n[]; int sum=0; double z[8],z0[],z1[],z2[],z3[],z4[],z5[],z6[],z7[]; int ind[8]; //+------------------------------------------------------------------+ //| 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; } } IndicatorBuffers(8); SetIndexBuffer(0,z0); SetIndexBuffer(1,z1); SetIndexBuffer(2,z2); SetIndexBuffer(3,z3); SetIndexBuffer(4,z4); SetIndexBuffer(5,z5); SetIndexBuffer(6,z6); SetIndexBuffer(7,z7); string text=""; for(a=0;a<8;a++) { SetIndexStyle(a,line(a),EMPTY,EMPTY,col(a)); SetIndexDrawBegin(a,100); if(ind[a]!=0) { SetIndexLabel(a,Val[a]); text=StringConcatenate(Val[a]," ", text);} } IndicatorDigits(2); string short_name="chart_delta_MACD ( "+ text +")"; IndicatorShortName(short_name); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if (limit>History-1) limit=History-1; //------------------------------------------------------------------------------------------- for(int i=0;i