info_o_koncie
Download scriptThis tool is designed to provide traders with a comprehensive, real-time health check of their trading account. It functions as an informational dashboard that extracts critical data directly from the trading server and displays it clearly on the chart screen.
Instead of requiring the user to manually navigate through various menus to find specific figures, the script automatically gathers and organizes the following information:
Account Overview & Infrastructure
The script identifies the fundamental settings of your current environment, including the name of the transaction server you are connected to, the currency in which your account is held, and your current leverage. It also clarifies the "StopOut Mode" of the broker, explaining whether the system uses a fixed percentage or an absolute value to determine when trades will be automatically closed.
Financial Position & Margin Analysis
A significant portion of the logic is dedicated to calculating your "Margin Health." It distinguishes between:
- Balance vs. Equity: The difference between your actual account balance and the current market value of your open positions.
- Free Cash vs. Locked Funds: It displays exactly how much money is available for withdrawal or opening new trades versus how much capital is currently "locked" to maintain your existing positions.
- Security Deposit Levels: It calculates a dynamic security deposit percentage, helping you visualize how much breathing room your account has based on current market movements.
Risk & Requirement Monitoring
To help with position sizing and risk management, the script performs several calculations:
- StopOut Thresholds: It displays both the "Acceptable" StopOut level (set by your broker) and your "Actual" StopOut level based on real-time market conditions. This allows you to see how close you are to a forced liquidation.
- Minimum Trade Requirements: Based on the specific instrument you are viewing, it calculates the exact deposit required to open a minimum-sized position.
- Market Deviation: It retrieves the "Freeze Level," which tells you the minimum price distance from the current market where new orders may be restricted.
User Experience
The script is designed to be user-friendly and accessible, offering a dual-language interface (English and Polish). It updates this information automatically, refreshing the data to ensure that the trader always sees the most accurate reflection of their account's financial status at any given moment.
//+------------------------------------------------------------------+
//| 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 wartoci rachunku.";
else x="Obliczenie stosunku % miêdzy wolnymi rodkami i rzeczywist¹ wartoci¹ 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);
switch (y)
{case 0.01: z = 100;break;
case 0.1: z = 10;break;
case 1: z = 1;break;}
if (AccountBalance()<AccountEquity())
{poz_depozytu_biez=(AccountBalance()/AccountMargin())*100;}
else {poz_depozytu_biez=(AccountEquity()/AccountMargin())*100;}
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 dwignia : ", 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);
}
//+------------------------------------------------------------------+
Comments