//--------------------------------------------------------------------- #property copyright "Dima S., 2010 г." #property link "dimascub@mail.com" #property version "1.01" #property description "Индикатор для проверки работы библиотеки TextDisplay." //--------------------------------------------------------------------- #property indicator_chart_window //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Version history //--------------------------------------------------------------------- // 07.10.2010г. - V1.00 // - FIRST RELEASE // // 20.10.2010г. - V1.01 // - ADDED - setting angle for table output; // - ADDED - horizontal and vertical shift of the table; // //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Include libraries //--------------------------------------------------------------------- #include //--------------------------------------------------------------------- //===================================================================== // External input parameters //===================================================================== input ENUM_BASE_CORNER Corner=CORNER_LEFT_UPPER; input int UpDownBorderShift=2; input int LeftRightBorderShift=1; input color TitlesColor=White; //--------------------------------------------------------------------- //--------------------------------------------------------------------- TableDisplay Table1; //--------------------------------------------------------------------- #define NUMBER 8 //--------------------------------------------------------------------- string names[NUMBER]={ "EURUSD","GBPUSD","AUDUSD","NZDUSD","USDCHF","USDCAD","USDJPY","EURJPY" }; int c1_coord_y[ NUMBER ] = { 0, 1, 2, 3, 4, 5, 6, 7 }; int c2_coord_y[ NUMBER ] = { 7, 6, 5, 4, 3, 2, 1, 0 }; //--------------------------------------------------------------------- double rates[NUMBER]; datetime times[NUMBER]; MqlTick tick; //--------------------------------------------------------------------- // Обработчик события инициализации: //--------------------------------------------------------------------- int OnInit() { ArrayInitialize(times,0); ArrayInitialize(rates,0); // Create table Table1.SetParams(0,0,Corner); // Show prices for(int i=0; itimes[i] || times[i]==0) { Table1.SetText(i,DoubleToString(tick.bid,(int)(SymbolInfoInteger(names[i],SYMBOL_DIGITS)))); if(tick.bid>rates[i] && rates[i]>0.1) { Table1.SetColor(i,Lime); } else if(tick.bid0.1) { Table1.SetColor(i,Red); } else { Table1.SetColor(i,Yellow); } rates[ i ] = tick.bid; times[ i ] = tick.time; } Table1.SetText(i+NUMBER,DoubleToString(( tick.ask-tick.bid)/SymbolInfoDouble(names[i],SYMBOL_POINT),0)); } } //+------------------------------------------------------------------+