Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(warning) Important: Make sure the Formula Type is set to "Per Order" when creating a plan.

Image RemovedImage Added

The following variables are available when creating a Per Order formula:

Variable Name

Description

$date

The trade date in YYYY-MM-DD format (e.g. 2011-08-15).

$type

B = Buy, S = Sell, T = Short, C = Cover. See side and intention codes for more information.

$quantity

Number of shares or contracts traded.

$symbolTicker symbol of the instrument being traded.
$multiplierThe multiplier (can be called "contract size" for options and "value multiplier" for futures) used when computing profit and loss.
$listingExchangeListing exchange for the security being traded (see list of exchange codes).
$spotRateThe conversion rate from the trade currency to the account currency.
$pricePrice of the trade.
$routes

A mapping of route to quantity for this order. To check whether a part of the order was routed to a particular destination you can use isset(). For example, use isset($routes['ARCA']) to check if some or all of the order was sent to ARCA. Use $routes['ARCA'] to get the actual quantity routed.

$originalCommissionCommission as received from the data source.
$originalExchangeFeeExchange/ECN fee as received from the data source.
$originalSecFeeSEC transaction fee as received from the data source.
$originalTafTrade activity fee as received from the data source.
$originalNsccFee

National Securities Clearing Corporation fee as received from the data source.

$originalMiscellaneousFeeMiscellaneous fee as received from the data source. 
$originalClearingFeeOther clearing fee as received from the data source.
$originalOrfOptions Regulatory Fee as received from the data source. (v1.5.98.19.16 or greater)
$originalAccessFeeExchange access fee as received from the data source. (v1.5.98.19.16 or greater)
$originalNfaFeeNational Futures Association fee as received from the data source. (v1.5.98.19.16 or greater)
$fillCountNumber of regular executions comprising this order (not counting any canceled or non-regular fills).
$monthlyVolume

Total cumulative quantity traded during the trade date month up to and including the order being processed.

Note that currently this lumps together volume across all instrument types

The quantity is for the instrument type of the order being evaluated. For example, if a formula is being evaluation for an equity order, monthlyVolume will equal total equity shares the account traded from the beginning of the month up to and including the order processed.