Skip to content

ProfilePL

AccountProfilePL contains realized PL settings per symbol. All such settings are defined in AccountProfilePLSetting. AccountProfilePL has the following attributes and can be accessed via pending config or real-time config:

attributes required default settings attribute type description
id Y – INT The ID of the profile; generated.
name Y – STRING The name of the profile
description N n/a STRING Free text

AccountProfilePLSetting

AccountProfilePLSetting supplies markup and comments for settling accumulated closed P&L. Closing trades realize P&L independently of this profile. A successful nonzero settlement transfers the adjusted amount to the P&L wallet and removes the corresponding original amount from unsettled closed P&L; it does not close a remaining open position. If conversion or markup reduces the settlement amount to zero, closed P&L remains unsettled and no booking is made. P&L accumulated before settlement is combined before markup is applied.

AccountProfilePLSetting has the below attributes:

attributes required default settings attribute type description
profile Y – INT The name of the profile
symbol Y – STRING The symbol on which the defined pl settings will be applied, or * as a fallback for all other symbols. An explicit symbol row takes precedence over the fallback.
markup Y 0 DOUBLE The percentage adjustment to accumulated closed P&L at settlement, including when the settlement and quote currencies are the same. Profit credits are multiplied by 1 - markup/100; loss debits by 1 + markup/100. For example, with no currency conversion, a 10% markup settles a profit of 100 as 90 and a loss of -100 as -110. Timing and booking currency come from the P&L settlement profile.

Allowed values: 0 or greater; no upper bound is enforced. At 100 a profit settles as zero and remains unsettled.
comment N – STRING Free text for the comment of the settlement booking. The following tokens are replaced when the P&L is settled:

- #SYM# – symbol name
- #CONV# – conversion rate from the symbol’s quote currency to the settlement currency
- #MARKUP# – the markup percentage applied

Example: the template sym: #SYM#; conv: #CONV#; markup: #MARKUP# produces a comment such as sym: EURUSD; conv: 1; markup: 0.5 in the account report. The tokens are optional and can be combined with any wording.
comment 2 – – VARCHAR(64) A second comment template supporting the same tokens as comment.