//+------------------------------------------------------------------+
//|                                                info_o_koncie.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Info-Trade"
#property link      "http://infotrade.efuturo.eu"
#property indicator_chart_window
extern string chose_language=" 0 - English, 1 - Polish ";
extern int language=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
string x;
double y,poz_depozytu_biez,StopOutLevel;
int z;

// Funkcja AccountStopoutLevel zwraca wartość poziomu po przekroczeniu, którego zamykane są najbardziej stratne pozycje.
if (language==1)
{
if(AccountStopoutMode() != 0)   x="Porównanie poziomu wolnych środków do absolutnej wartości rachunku.";
else  x="Obliczenie stosunku % między wolnymi środkami i rzeczywistą wartością rach.";
}
else
{
if(AccountStopoutMode() != 0)   x="Comparing the level of free cash to the absolute value of the account.";
else  x="Calculation of the percentage ratio between the free cash and the actual value of the account";
}

y=MarketInfo(Symbol(),MODE_MINLOT);

if (y==0.01) z = 100;
else
if (y==0.1) z = 10;
else
if (y==1) z = 1;

//switch (y)
//{case 0.01: z = 100;break;
//case 0.1: z = 10;break;
//case 1: z = 1;break;}

if (AccountMargin()!=0)
if (AccountBalance()<AccountEquity()) 
{poz_depozytu_biez=(AccountBalance()/AccountMargin())*100;} 
else {poz_depozytu_biez=(AccountEquity()/AccountMargin())*100;}

if (AccountEquity()!=0)
if (AccountBalance()<AccountEquity()) 
{StopOutLevel = (AccountBalance()/AccountEquity())*100;}
else {StopOutLevel = (AccountFreeMargin()/AccountEquity())*100;}

if (language==1)
{
   Comment(
   "Adres serwera transakcyjnego : ", AccountServer(),"\n",  
   "Tryb StopOut : ", x,"\n", 
   "Aktualna dźwignia : ", AccountLeverage(),"\n",
   "Waluta w której prowadzony jest rachunek : ",AccountCurrency(),"\n",
   "Saldo konta : ",AccountBalance(),"\n",
   "Wartość konta : ",AccountEquity(),"\n",
   "Minimalna wielkość pozycji : ",y,"\n",
   "Dopuszczalny poziom StopOut : ", AccountStopoutLevel()," %","\n",
   "Aktualny poziom StopOut : ",StopOutLevel," %\n",
   "Aktualny poziom zabezpieczenia depozytu :",poz_depozytu_biez," %","\n",
   "Wolne środki (do wypłaty/otwarcia pozycji) : ", AccountFreeMargin(),"\n",
   "Środki zablokowane pod depozyt otwartych pozycji : ", AccountMargin(),"\n",
   "Wymagany depozyt dla otwarcia nowej pozycji (MIN_LOT) : ", MarketInfo(Symbol(),32)/z,"\n",
   "Minimalne obecne odchylenie od rynku (pips) : ", MarketInfo(Symbol(), MODE_FREEZELEVEL),"\n"
    );
}
else
{
   Comment(
   "Account server : ", AccountServer(),"\n",  
   "StopOut mode : ", x,"\n", 
   "Actual laverage : ", AccountLeverage(),"\n",
   "Currency for the account : ",AccountCurrency(),"\n",
   "Account balance : ",AccountBalance(),"\n",
   "Account equity : ",AccountEquity(),"\n",
   "Min. position : ",y,"\n",
   "Acceptable level of StopOut : ", AccountStopoutLevel()," %","\n",
   "Actual level of StopOut : ",StopOutLevel," %\n",
   "The current level of security deposit :",poz_depozytu_biez," %","\n",
   "Free cash : ", AccountFreeMargin(),"\n",
   "Cash locked for the current deposit : ", AccountMargin(),"\n",
   "Deposit required for opening a new MIN_LOT position : ", MarketInfo(Symbol(),32)/z,"\n",
   "Minimum deviation from the current market (pips) : ", MarketInfo(Symbol(), MODE_FREEZELEVEL),"\n"
    );
}
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
RefreshRates();
init();
Sleep(13000);
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+