/
Creating Recurring Fees

Creating Recurring Fees

The following variables are available for creating recurring adjustments:

Variable Name

Description

$date

The date on which the adjustment will be posted. (e.g. 2011-08-15)

$activationDateLast of Month only: The "Activated" date set on Account Overview page (if account status is enabled for instance).

$totalShares

Last of Month only: Total number of shares traded that month.

$totalExecutions

Last of Month only: Total number of fills for the month.

$totalOrders

Last of Month only: Total number of orders for the month.

$netProfitLoss

Last of Month only: gross realized profit (or loss) minus direct trade fees for the month.

$unrealizedProfitLossDeltaLast of Month only: Change in unrealized profit (or loss) from the previous month (v1.6.2.77+).

$unrealizedProfitLoss

Unrealized profit (or loss) for all open positions marked to the market for the adjustment date.

$longUnrealizedProfitLoss

Same as above for long positions.

$shortUnrealizedProfitLoss

Same as above for short positions.

$latestLongPositionValue

Market value of ALL open long positions for the adjustment date (will always be >= 0).

$latestShortPositionValue

Market value of ALL open short positions for the adjustment date (will always be >= 0).

$longPositionCountTotal number of long positions on the adjustment date (v1.5.96.17+).
$shortPositionCountTotal number of short positions on the adjustment date (v1.5.96.17+).

$profitLossByType

Break down of profit / loss information by instrument type:
INSTRUMENT_TYPE_EQUITY, INSTRUMENT_TYPE_OPTION, INSTRUMENT_TYPE_FUTURE,
INSTRUMENT_TYPE_CURRENCY_PAIR, INSTRUMENT_TYPE_MUTUAL_FUND, INSTRUMENT_TYPE_BOND

$profitLossByType[type]->realized

Last of Month only: gross realized profit loss for the month.

$profitLossByType[type]->shortUnrealized


$profitLossByType[type]->longUnrealized


$profitLossByType[type]->longValue


$profitLossByType[type]->shortValue


$monthlyFees

Last of Month only: total fee adjustments for the month. (Negative for debit, positive for credit)

$monthlyTotalsByCategory

Last of Month only: total adjustments by category name for the month. (e.g. $monthlyTotalsByCategory["Misc"])

$totalsByCategory

Last of Month only: total adjustments by category name since inception.

$equity

Cash in the account on the adjustment date. Note: if more than one recurring plan is assigned, this amount will
reflect the result of any previously applied plan (see order of recurring adjustments).

$mostRecentTradeDateLast of Month only: The most recent date with trading activity up to and including $date. Journal fills and Canceled fills are excluded.


Examples of using variables to come up with specific values for options:

Values calculated

Description

Long Market Value for Options

$latestLongPositionValueOption = isset($profitLossByType[INSTRUMENT_TYPE_OPTION]) ? $profitLossByType[INSTRUMENT_TYPE_OPTION]->longValue : 0;

Short Market Value for Options

$latestShortPositionValueOption = isset($profitLossByType[INSTRUMENT_TYPE_OPTION]) ? $profitLossByType[INSTRUMENT_TYPE_OPTION]->shortValue : 0;

Total Absolute Value for Options

$totalAbsolutePositionValueOption = isset($profitLossByType[INSTRUMENT_TYPE_OPTION]) ? $profitLossByType[INSTRUMENT_TYPE_OPTION]-> longValue + $profitLossByType[INSTRUMENT_TYPE_OPTION]-> shortValue : 0;

Total Net Value for Options$totalNetPositionValueOption = isset($profitLossByType[INSTRUMENT_TYPE_OPTION]) ? $profitLossByType[INSTRUMENT_TYPE_OPTION]-> longValue - $profitLossByType[INSTRUMENT_TYPE_OPTION]-> shortValue : 0;


Related Topics / How To

Sample Recurring Adjustment Plans


Related content

Fee Rules
More like this
Uploading an Adjustments File
Uploading an Adjustments File
More like this
Trade Fees
Read with this
Sample Recurring Adjustment Plans
Sample Recurring Adjustment Plans
More like this
Fee Schedule Formulas
Fee Schedule Formulas
Read with this
Adjustment Categories
Adjustment Categories
More like this