Message: AccountVariable

File: WebAPI/rules_1.proto

Description

Account based variable. Rule with account variables (account alert) is processed and evaluated separately for each available account. Accounts excluded from processing:

      Omnibus accounts.

      Accounts related to non-derivative brokerages.

      Accounts without statement support (without trading_account_2.Account.cleared_by_statements=True).

      Accounts that had “Zero positions at the end of the day” option during last account’s clearing.

      Accounts that had “Zero balances at the end of the day” option during last account’s clearing.

Accounts that are members of account groups are excluded from processing too. But if ConditionRule.account_rule_parameters.restrict_rule_to_main_accounts_of_co_margin_groups is true, the rule applies only to main accounts of co-margin account groups.

Note: There is a common limit on triggering rate among all user’s rules with account variables, 500 rule triggerings per hour per account by default. If it exceeds, further triggerings are suppressed until the rate lowers.

Note: Price based account variable will produce values in USD.

Used in

Operand

Fields

type

Type: uint32

Description: Type of account variable. This field is associated with AccountVariable.Type enum.

Required: yes.

Enum Type

Description: Type of account variable.

Values

      TYPE_UNSPECIFIED = 0

      TYPE_TOTAL_MARGIN = 1

     Margin requirement calculated for worst-case based on open positions and working orders.

      TYPE_POSITION_MARGIN = 2

     Margin requirement based on current positions only, with margin multiplier applied.

      TYPE_NO_MULTIPLIER_POSITION_MARGIN = 27

     Margin requirement without multipliers based on current positions only.

      TYPE_PURCHASING_POWER = 3

     Available account funds including balance, realized profit (or loss), collateral and credits. OTE and MVO are included regarding the account risk parameters.

      TYPE_OTE = 4

     Open trade equity, or potential profit (or loss) from futures and future-style options positions based on the opening price of the position and the current future trade/best bid/best ask (regarding to the risk account settings) or settlement price if trade is not available.

      TYPE_OTE_UPL = 26

     OTE + UPL.

      TYPE_OPEN_TRADE_LOSS_UNREALIZED_LOSS = 5

     Absolute value of (OTE + UPL) if it is negative otherwise zero value.

      TYPE_MVO = 6

     Market value of options calculated as the current market trade/best bid/best ask of the option (regarding to the risk account settings) times the number of options (positive for long options and negative for short options) in the portfolio.

      TYPE_NLV = 7

     Net Liquidity Value. It includes current balance, OTE, MVO and collateral values.

      TYPE_MVF = 8

     Market value of futures calculated as the current market trade/best bid/best ask (regarding to the risk account settings) times the number of futures (positive for long and negative for short) in the portfolio.

      TYPE_MARGIN_CREDIT = 9

     Allowable margin credit of the account.

      TYPE_MARGIN_EXCESS = 10

     Margin excess. It consists of the purchasing power minus total margin.

      TYPE_CASH_EXCESS = 11

     Cash Excess.

      TYPE_CURRENT_BALANCE = 13

     Current account’s balance.

      TYPE_PROFIT_LOSS = 14

     Realized profit/loss.

      TYPE_UNREALIZED_PROFIT_LOSS = 15

     Unrealized profit/loss for options.

      TYPE_OTE_UPL_AND_PL = 16

     Sum of OTE, UPL and realized profit/loss values.

      TYPE_YESTERDAY_BALANCE = 17

     Cash balance from the last statement.

      TYPE_YESTERDAY_NET_LIQUIDATION_VALUE = 28

     NLV (cash balance + collateral + OTE + MVO) from the last statement.

      TYPE_YESTERDAY_OTE = 23

     Open trade equity from the last statement.

      TYPE_YESTERDAY_MVO = 24

     Market value of options from the last statement.

      TYPE_YESTERDAY_COLLATERAL = 12

     Collateral on Deposit.

      TYPE_NET_CHANGE_PC = 25

     (profit_loss / abs(yesterday_balance)) in percentage.

      TYPE_NET_LIQUIDATION_VALUE_PC = 29

     (profit_loss / yesterday_net_liquidation_value) in percentage.

      TYPE_TOTAL_FILLED_QTY = 18

     Sum of all fill sizes for the current day.

      TYPE_TOTAL_FILLED_ORDERS = 19

     Count of filled orders for the current day.

      TYPE_LONG_OPEN_POSITIONS_QTY = 20

     Sum of position quantities among all long open positions on the account.

      TYPE_SHORT_OPEN_POSITIONS_QTY = 21

     Sum of position quantities among all short open positions on the account.

      TYPE_MIN_DAYS_TILL_POSITION_CONTRACT_EXPIRATION = 22

     Minimal value of days till contract expiration (in calendar days, not trading) among all open positions on contracts with expiration date on the account. It does not have a value when there are no such open positions on the account.

      TYPE_YESTERDAY_OLDEST_MARGIN_CALL_AGE_DAYS = 30

     Age (in days) of the oldest outstanding margin call from the last statement.

      TYPE_YESTERDAY_TOTAL_OUTSTANDING_MARGIN_CALLS = 31

     Total outstanding margin calls in the account from the last statement.