Per Symbol
Trade fee formulas use a simple language (a modified version of the PHP programming language) to specify how fees should be assessed in PropReports.
A "Per Symbol" formula runs once for every instrument traded per day and the result is saved as the fee on the last fill for that day.
The formula will NOT run for any instruments that contain an execution with fees manually set. Canceled executions or those with a status that is not regular are disregarded and not included in any of the totals.
Important: Make sure the Formula Type is set to "Per Symbol" when creating a plan.
The following variables are available when creating a Per Symbol formula:
Variable Name | Description |
---|---|
$date | The trade date in YYYY-MM-DD format (e.g. 2011-08-15). |
$quantity | Total shares or contracts traded in this symbol. |
$quantityBought | Total shares or contracts bought. |
$quantityBoughtToOpen | Shares or contracts bought to open a long position. First execution has side/intention set to B. |
$quantityBoughtToClose | Shares or contracts bought to cover a short position. First execution has side/intention set to C. |
$quantitySold | Number of shares or contracts sold. |
$quantitySoldToOpen | Shares or contracts sold to open a short position. First execution has side/intention set to T. |
$quantitySoldToClose | Shares or contracts sold to close a long position. First execution has side/intention set to S. |
$orderCount | Total number of orders in this symbol. This is determined by the Order Id on each execution. |
$symbol | Ticker symbol of the instrument being traded. |
$multiplier | The multiplier (can be called "contract size" for options and "value multiplier" for futures) used when computing profit and loss. |
$listingExchange | Listing exchange for the security being traded (see list of exchange codes). |
$spotRate | The conversion rate from the trade currency to the account currency. |
$dailyValueBought | Value of all purchase transactions in this symbol in the currency of the account. |
$dailyValueSold | Value of all sale transactions in this symbol in the currency of the account. |
Important: The order intention quantities (quantityBoughtToOpen, quantitySoldToClose, etc) are based on how executions are marked in the data being imported. Not all data sources send the intention of the trade.