Files
MQL5Data/Documents/Docs/XCAccount.md
T
2026-03-14 08:26:58 +03:30

3.4 KiB

XCAccount

it is a module which used for Accoess Trading Account Data in SaherElm's XTrade Framework.

Dependencies

there is no Dependencies on this modules.

Instancing

there is not any args in Constructor.

Instructions

use provided Actions for Access Account informations in where you need.

Actions

long GetUserAccount()

retrieve Current User Identifier.

long GetLeverage()

retrieve Current Account Leverage.

bool CanExpertTrade()

retrieve Flag which Specified Trading using Experts or Manual.

ENUM_ACCOUNT_TRADE_MODE GetTradeMode()

retrieve Current Account Trading Mode.

  • ACCOUNT_TRADE_MODE_DEMO;
  • ACCOUNT_TRADE_MODE_CONTEST;
  • ACCOUNT_TRADE_MODE_REAL;

double GetBalance()

retrieve Current Account Balance.

double GetCredit()

retrieve Current Account Credit.

double GetProfit()

retrieve Current Account's Amount of Profits.

double GetEquity()

retrieve Current Account's Amount of Equity.

double GetMargin()

retrieve Current Account's Amount of Margin.

double GetFreeMargin()

retrieve Current Account's Amount of Free Margin.

double GetMarginLevel()

retrieve Current Account's Margin Level.

double GetMarginCall()

retrieve Current Account's Margin Call Level.

double GetMarginStopOut()

retrieve Current Account's Margin Stopout Level.

string GetName()

retrieve Current Account's User Name.

string GetServerName()

retrieve Current Account's Server Name.

string GetCurrency()

retrieve Current Account's Currency.

string GetCompany()

retrieve Current Account's Market Name.

double CalculateTradeProfit(const string symbol, ENUM_ORDER_TYPE type, double volume, double entry, double exit)

Calculate and Retrieved Trade Profit based on Account Currency.

double CalculateMarging(const string symbol, ENUM_ORDER_TYPE type, double volume, double entry)

Calculate and Retrieved Specified Trades used Marigin.

double CalculateFreeMarging(const string symbol, ENUM_ORDER_TYPE type, double volume, double entry)

Calculate and Retrieved Specified Trades Free Marigin.

double CalculateMaxVolume(const string symbol, ENUM_ORDER_TYPE type, double entry, double percent = 100)

Calculate Max Allowed Specified Trade's Volume for Entry.

double GetPointValue(string symbol)

Retrieve Specified Symbol's Point Value.

double CalculateRiskAmount(string symbol, double points, double volume)

Calculate How many Risk Currency in a Trade when risk Points and Trade Volume is Specified. used when we have to know how many risk in $ Currency, for a Trade when we risk 100 Point, by Providing 0.01 Lot as Volume.

double CalculateRiskPoints(string symbol, double volume, double amount)

Calculate Risk Points in a Trade when Volume and Curreny Amount is Specified. used when we want to know How many points risk in a Trade when we have to risk 5$ in a Trade by 0.01 Lot as Volume.

double CalculateVolume(string symbol, double amount, double points)

Calculate Trade Volume when Risk Amount in Currency and Risk Amount in Points Specified. used when we want to know Open a Trade by how Size of Volume when we have to risk 5$ in a Trade when 100 points risking.

string GetBalanceReportMessage()

Prepare and Retrieve Balance Report Message for Current Account.

Maintainer

Hadi Khazaee asl

https://www.saherelm.ir

hadi_khazaee_asl@yahoo.com