Skip to content

MarginLevel

📊 Structure: MarginLevel

Description of fields used for user margin level calculations.

Field Type Default Value Description
login int User login (should ideally be replaced with user ID)
group string User group name
leverage int User leverage
balance double 0.0 Account balance (used together with credit)
credit double 0.0 Credit amount (can only be decreased)
equity double 0.0 Equity (balance + profit + credit)
profit double 0.0 Current floating profit or loss
storage double 0.0 Swap charges (for overnight positions)
commission double 0.0 Commission for all trades
margin double 0.0 Required margin (used funds)
margin_free double 0.0 Free margin (available for new positions)
margin_level double 0.0 Margin level (in percent or absolute value)
margin_type int MARGIN_TYPE_PERCENT Margin calculation type: percent or absolute (defined by enum)
level_type int MARGINLEVEL_OK Account status: OK, margin call, or stop out (defined by enum values)