AccountInfo

Author: Sergey Mechanic
Miscellaneous
It opens Message Boxes to the user
0 Views
0 Downloads
0 Favorites
AccountInfo
//+------------------------------------------------------------------+
//|                                                 Account Info.mq4 |
//|                                                  Sergey Mechanic |
//|        https://login.mql5.com/ru/users/sergey_mechanic/portfolio |
//+------------------------------------------------------------------+
#property copyright "Sergey Mechanic"
#property link      "https://login.mql5.com/ru/users/sergey_mechanic/portfolio"
#property version   "1.00"

void OnStart()
{
    // òèï âû÷èñëåíèÿ ìàðæè: 0 - â ïðîöåíòàõ, 1 - ñðàâíåíèå óðîâíÿ ñâîáîäíîé ìàðæè ñ àáñîëþòíûì çíà÷åíèåì
    string StopoutUnits;
   
    int StopoutMode = AccountStopoutMode();
    
    if(StopoutMode == 0)
        StopoutUnits = "(equity / used margin * 100):";
    else
        StopoutUnits = "(stopout mode = 1):\t";
        
    string AccountType;
    
    if(IsDemo() == true)
        AccountType = "Demo";
    else
        AccountType = "Real";
    
   
    string AccountInfo =    "Account number:\t\t" + DoubleToStr(AccountNumber(), 0)       + "\n" +
                            "Account type:\t\t"   + AccountType                           + "\n" +
                            "Account owner:\t\t"  + AccountName()                         + "\n" +                          
                            "Company:\t\t\t"      + AccountCompany()                      + "\n" +
                            "Server:\t\t\t"       + AccountServer()                       + "\n" +
                            "Currency:\t\t\t"     + AccountCurrency()                     + "\n" +
                            "Leverage:\t\t\t"     + DoubleToStr(AccountLeverage(), 0)     + "\n\n" +
                    
                            "Balance:\t\t\t"      + DoubleToStr(AccountBalance(), 2)      + "\n" +
                            "Equity:\t\t\t"       + DoubleToStr(AccountEquity(), 2)       + "\n" +
                            "Floating profit:\t\t"+ DoubleToStr(AccountProfit(), 2)       + "\n" +                 
                            "Used margin:\t\t"    + DoubleToStr(AccountMargin(), 2)       + "\n" +
                            "Free margin:\t\t"    + DoubleToStr(AccountFreeMargin(), 2)   + "\n" +                
                            "Credit:\t\t\t"       + DoubleToStr(AccountCredit(), 2)       + "\n\n" +
                            
                            "Stopout"                                               + "\n" +
                            StopoutUnits + "\t"  + DoubleToStr(AccountStopoutLevel(), 0);

                    
	MessageBox(AccountInfo, "Account Information", MB_OK);
	
	return;
}

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---