Skip to main content
The User model represents a client or trader in the MetaTrader 5 platform, containing personal information, credentials, and account settings.

Properties

login
int
The user’s login number (unique identifier)
name
string
required
The user’s full name
group
string
required
The trading group the user belongs to
leverage
int
User’s leverage ratio (e.g., 100 for 1:100 leverage)
password
string
User’s trading password
password_investor
string
User’s investor (read-only) password
rights
int
User access rights (bitfield)
email
string
required
User’s email address
city
string
User’s city
phone
string
User’s phone number
phone_password
string
Password for phone trading
status
string
User account status
state
string
User’s state/province
address
string
User’s street address
comment
string
Additional comments or notes about the user
zipcode
string
User’s postal/ZIP code
agent_account
int
Agent account number if user has an agent
id_number
string
User’s identification number
reg_date
string
Registration date

Example

{
  "login": 12345678,
  "name": "John Doe",
  "group": "demo\\standard",
  "leverage": 100,
  "password": "SecurePassword123",
  "password_investor": "InvestorPass456",
  "rights": 1,
  "email": "[email protected]",
  "city": "New York",
  "phone": "+1234567890",
  "phone_password": "PhonePass789",
  "status": "active",
  "state": "NY",
  "address": "123 Main Street",
  "comment": "VIP client",
  "zipcode": "10001",
  "agent_account": 0,
  "id_number": "ID123456",
  "reg_date": "2024-01-15T10:30:00Z"
}

Methods

The User model provides getter and setter methods for all properties:
  • getLogin() / setLogin($login) - Get/set the user login
  • getName() / setName($name) - Get/set the user name
  • getGroup() / setGroup($group) - Get/set the trading group
  • getLeverage() / setLeverage($leverage) - Get/set the leverage
  • getPassword() / setPassword($password) - Get/set the password
  • getPasswordInvestor() / setPasswordInvestor($password_investor) - Get/set investor password
  • getRights() / setRights($rights) - Get/set user rights
  • getEmail() / setEmail($email) - Get/set the email
  • getCity() / setCity($city) - Get/set the city
  • getPhone() / setPhone($phone) - Get/set the phone number
  • getPhonePassword() / setPhonePassword($phone_password) - Get/set phone password
  • getStatus() / setStatus($status) - Get/set the status
  • getState() / setState($state) - Get/set the state
  • getAddress() / setAddress($address) - Get/set the address
  • getComment() / setComment($comment) - Get/set comments
  • getZipcode() / setZipcode($zipcode) - Get/set the zipcode
  • getAgentAccount() / setAgentAccount($agent_account) - Get/set agent account
  • getIdNumber() / setIdNumber($id_number) - Get/set ID number
  • getRegDate() / setRegDate($reg_date) - Get/set registration date

Usage Example

use D4T\MT5Sdk\Models\User;

// Create a user instance
$user = new User([
    'name' => 'John Doe',
    'group' => 'demo\\\\standard',
    'email' => '[email protected]',
    'leverage' => 100,
    'city' => 'New York'
]);

// Access properties
$name = $user->getName();
$email = $user->getEmail();
$group = $user->getGroup();

// Update properties
$user->setLeverage(200);
$user->setPhone('+1234567890');

Build docs developers (and LLMs) love