Account model represents a trading account in the MetaTrader 5 platform, containing balance, equity, margin, and other account-related information.
Properties
The account login number (unique identifier for the trading account)
Current account balance
Current profit on open positions
Profit that is blocked (reserved)
Commission that is blocked (reserved)
Account leverage ratio (e.g., 100 for 1:100 leverage)
Total volume of open positions
Account equity (balance + profit)
Margin used by open positions
Free margin available for trading
Margin level percentage (equity/margin * 100)
Example
Methods
The Account model provides getter and setter methods for all properties:getLogin()/setLogin($login)- Get/set the account logingetBalance()/setBalance($balance)- Get/set the account balancegetProfit()/setProfit($profit)- Get/set the current profitgetBlockedProfit()/setBlockedProfit($blocked_profit)- Get/set blocked profitgetBlockedCommission()/setBlockedCommission($blocked_commission)- Get/set blocked commissiongetLeverage()/setLeverage($leverage)- Get/set the leveragegetVolume()/setVolume($volume)- Get/set the total volumegetEquity()/setEquity($equity)- Get/set the equitygetMargin()/setMargin($margin)- Get/set the used margingetMarginFree()/setMarginFree($margin_free)- Get/set the free margingetMarginLevel()/setMarginLevel($margin_level)- Get/set the margin level