//--------------------------------------------------------------------- #property copyright "Dima S., 2010 ã." #property link "dimascub@mail.com" #property version "1.01" #property description "Market Watch" //--------------------------------------------------------------------- #property indicator_chart_window //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Version history: //--------------------------------------------------------------------- // 11.10.2010. - V1.00 // - FIRST RELEASE; // // 20.10.2010. - V1.01 // - ADDED - parameters for vertical and horizontal shift of the table; // //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Include libraries: //--------------------------------------------------------------------- #include //--------------------------------------------------------------------- //===================================================================== // External input parameters: //===================================================================== input string CurrencylList = "EURUSD; GBPUSD; EURGBP; AUDUSD; NZDUSD; AUDNZD; USDJPY; USDCHF; USDCAD; EURJPY; GBPJPY; AUDJPY; NZDJPY; CHFJPY; CADJPY; XAUUSD;"; input string TimeFrameList = "H1; H4; D1; MN"; input int UpDownBorderShift=1; input int LeftRightBorderShift=1; input color TitlesColor=LightCyan; //--------------------------------------------------------------------- //--------------------------------------------------------------------- string Symbol_Array[ ]; // list of symbols string TimeFrame_Array[ ]; // list of timeframes ENUM_TIMEFRAMES TFs[]; string Titles_Array[]={ "Bid:","Spread:","StopLev:","ToOpen:","Hi-Lo:","DailyAv:" }; //--------------------------------------------------------------------- //--------------------------------------------------------------------- SymbolWatchDisplay *Watches[]; TableDisplay TitlesDisplay; //--------------------------------------------------------------------- //--------------------------------------------------------------------- int currencies_count; int timeframes_count; bool is_first_init=true; //--------------------------------------------------------------------- #define WIDTH 128 #define HEIGHT 128 #define FONTSIZE 10 //--------------------------------------------------------------------- // OnInit event handler //--------------------------------------------------------------------- int OnInit() { // List of symbols: currencies_count=StringToArrayString(CurrencylList,Symbol_Array); if(currencies_count>16) { currencies_count=16; } // List of timeframes: timeframes_count=StringToArrayString(TimeFrameList,TimeFrame_Array); ArrayResize(TFs,timeframes_count); for(int k=0; k0) { np=StringFind(st,_delimiter); if(np<0) { stp= st; st = ""; } else { stp= StringSubstr(st,0,np); st = StringSubstr(st,np+1); } i++; ArrayResize(ad,i); StringTrimLeft(stp); ad[i-1]=stp; } return(ArraySize(ad)); } //--------------------------------------------------------------------- // Get color depending on symbol //--------------------------------------------------------------------- color get_currency_color(string _currency) { int i; for(i=0; i