API functions to read portfolio level summary information.
Note: These functions are only available to libraries that use at-desktop client. They help reduce the work of programmers. Other libraries return portfolio as a collection of records & these values can be easily calculated from the collection.
Signatures
/*
* Retrieve portfolio M2M (Position category = DAY).
*/
function getPortfolioMtm(pseudoAccount)
/*
* Retrieve portfolio PNL (Position category = DAY).
*/
function getPortfolioPnl(pseudoAccount)
/*
* Retrieve portfolio position count (Position category = DAY).
*/
function getPortfolioPositionCount(pseudoAccount)
/*
* Retrieve portfolio OPEN position count (Position category = DAY).
*/
function getPortfolioOpenPositionCount(pseudoAccount)
/*
* Retrieve portfolio CLOSED position count (Position category = DAY).
*/
function getPortfolioClosedPositionCount(pseudoAccount)
/*
* Retrieve portfolio open short quantity (Position category = DAY).
*/
function getPortfolioOpenShortQuantity(pseudoAccount)
/*
* Retrieve portfolio open long quantity (Position category = DAY).
*/
function getPortfolioOpenLongQuantity(pseudoAccount)
/*
* Retrieve portfolio M2M (Position category = NET).
*/
function getPortfolioMtmNET(pseudoAccount)
/*
* Retrieve portfolio PNL (Position category = NET).
*/
function getPortfolioPnlNET(pseudoAccount)
/*
* Retrieve portfolio position count (Position category = NET).
*/
function getPortfolioPositionCountNET(pseudoAccount)
/*
* Retrieve portfolio OPEN position count (Position category = NET).
*/
function getPortfolioOpenPositionCountNET(pseudoAccount)
/*
* Retrieve portfolio CLOSED position count (Position category = NET).
*/
function getPortfolioClosedPositionCountNET(pseudoAccount)
/*
* Retrieve portfolio open short quantity (Position category = NET).
*/
function getPortfolioOpenShortQuantityNET(pseudoAccount)
/*
* Retrieve portfolio open long quantity (Position category = NET).
*/
function getPortfolioOpenLongQuantityNET(pseudoAccount)
/*
* Retrieve portfolio order count.
*/
function getPortfolioOrderCount(pseudoAccount)
/*
* Retrieve portfolio "open" order count.
*/
function getPortfolioOpenOrderCount(pseudoAccount)
/*
* Retrieve portfolio "complete" order count.
*/
function getPortfolioCompleteOrderCount(pseudoAccount)
/*
* Retrieve portfolio "cancelled" order count.
*/
function getPortfolioCancelledOrderCount(pseudoAccount)
/*
* Retrieve portfolio "rejected" order count.
*/
function getPortfolioRejectedOrderCount(pseudoAccount)
/*
* Retrieve portfolio "trigger pending" order count.
*/
function getPortfolioTriggerPendingOrderCount(pseudoAccount)
Example
mtm = getPortfolioMtm("XX1234");
pnl = getPortfolioPnl("XX1234");
positionCount = getPortfolioPositionCount("XX1234");
openPositionCount = getPortfolioOpenPositionCount("XX1234");
closedPositionCount = getPortfolioClosedPositionCount("XX1234");
openShortQuantity = getPortfolioOpenShortQuantity("XX1234");
openLongQuantity = getPortfolioOpenLongQuantity("XX1234");
mtmNET = getPortfolioMtmNET("XX1234");
pnlNET = getPortfolioPnlNET("XX1234");
positionCountNET = getPortfolioPositionCountNET("XX1234");
openPositionCountNET = getPortfolioOpenPositionCountNET("XX1234");
closedPositionCountNET = getPortfolioClosedPositionCountNET("XX1234");
openShortQuantityNET = getPortfolioOpenShortQuantityNET("XX1234");
openLongQuantityNET = getPortfolioOpenLongQuantityNET("XX1234");
orderCount = getPortfolioOrderCount("XX1234");
openOrderCount = getPortfolioOpenOrderCount("XX1234");
completeOrderCount = getPortfolioCompleteOrderCount("XX1234");
cancelledOrderCount = getPortfolioCancelledOrderCount("XX1234");
rejectedOrderCount = getPortfolioRejectedOrderCount("XX1234");
triggerPendingOrderCount = getPortfolioTriggerPendingOrderCount("XX1234");
Signatures
/*
* Retrieve portfolio M2M (Position category = DAY).
*/
double getPortfolioMtm(string pseudoAccount)
/*
* Retrieve portfolio PNL (Position category = DAY).
*/
double getPortfolioPnl(string pseudoAccount)
/*
* Retrieve portfolio position count (Position category = DAY).
*/
long getPortfolioPositionCount(string pseudoAccount)
/*
* Retrieve portfolio OPEN position count (Position category = DAY).
*/
long getPortfolioOpenPositionCount(string pseudoAccount)
/*
* Retrieve portfolio CLOSED position count (Position category = DAY).
*/
long getPortfolioClosedPositionCount(string pseudoAccount)
/*
* Retrieve portfolio open short quantity (Position category = DAY).
*/
long getPortfolioOpenShortQuantity(string pseudoAccount)
/*
* Retrieve portfolio open long quantity (Position category = DAY).
*/
long getPortfolioOpenLongQuantity(string pseudoAccount)
/*
* Retrieve portfolio M2M (Position category = NET).
*/
double getPortfolioMtmNET(string pseudoAccount)
/*
* Retrieve portfolio PNL (Position category = NET).
*/
double getPortfolioPnlNET(string pseudoAccount)
/*
* Retrieve portfolio position count (Position category = NET).
*/
long getPortfolioPositionCountNET(string pseudoAccount)
/*
* Retrieve portfolio OPEN position count (Position category = NET).
*/
long getPortfolioOpenPositionCountNET(string pseudoAccount)
/*
* Retrieve portfolio CLOSED position count (Position category = NET).
*/
long getPortfolioClosedPositionCountNET(string pseudoAccount)
/*
* Retrieve portfolio open short quantity (Position category = NET).
*/
long getPortfolioOpenShortQuantityNET(string pseudoAccount)
/*
* Retrieve portfolio open long quantity (Position category = NET).
*/
long getPortfolioOpenLongQuantityNET(string pseudoAccount)
/*
* Retrieve portfolio order count.
*/
long getPortfolioOrderCount(string pseudoAccount)
/*
* Retrieve portfolio "open" order count.
*/
long getPortfolioOpenOrderCount(string pseudoAccount)
/*
* Retrieve portfolio "complete" order count.
*/
long getPortfolioCompleteOrderCount(string pseudoAccount)
/*
* Retrieve portfolio "cancelled" order count.
*/
long getPortfolioCancelledOrderCount(string pseudoAccount)
/*
* Retrieve portfolio "rejected" order count.
*/
long getPortfolioRejectedOrderCount(string pseudoAccount)
/*
* Retrieve portfolio "trigger pending" order count.
*/
long getPortfolioTriggerPendingOrderCount(string pseudoAccount)
Examples
double mtm = getPortfolioMtm("XX1234");
double pnl = getPortfolioPnl("XX1234");
long positionCount = getPortfolioPositionCount("XX1234");
long openPositionCount = getPortfolioOpenPositionCount("XX1234");
long closedPositionCount = getPortfolioClosedPositionCount("XX1234");
long openShortQuantity = getPortfolioOpenShortQuantity("XX1234");
long openLongQuantity = getPortfolioOpenLongQuantity("XX1234");
double mtmNET = getPortfolioMtmNET("XX1234");
double pnlNET = getPortfolioPnlNET("XX1234");
long positionCountNET = getPortfolioPositionCountNET("XX1234");
long openPositionCountNET = getPortfolioOpenPositionCountNET("XX1234");
long closedPositionCountNET = getPortfolioClosedPositionCountNET("XX1234");
long openShortQuantityNET = getPortfolioOpenShortQuantityNET("XX1234");
long openLongQuantityNET = getPortfolioOpenLongQuantityNET("XX1234");
long orderCount = getPortfolioOrderCount("XX1234");
long openOrderCount = getPortfolioOpenOrderCount("XX1234");
long completeOrderCount = getPortfolioCompleteOrderCount("XX1234");
long cancelledOrderCount = getPortfolioCancelledOrderCount("XX1234");
long rejectedOrderCount = getPortfolioRejectedOrderCount("XX1234");
long triggerPendingOrderCount = getPortfolioTriggerPendingOrderCount("XX1234");
Signatures
' Retrieve portfolio M2M (Position category = DAY).
Public Function GetPortfolioMtm(pseudoAccount As String) As Double
' Retrieve portfolio PNL (Position category = DAY).
Public Function GetPortfolioPnl(pseudoAccount As String) As Double
' Retrieve portfolio position count (Position category = DAY).
Public Function GetPortfolioPositionCount(pseudoAccount As String) As Long
' Retrieve portfolio OPEN position count (Position category = DAY).
Public Function GetPortfolioOpenPositionCount(pseudoAccount As String) As Long
' Retrieve portfolio CLOSED position count (Position category = DAY).
Public Function GetPortfolioClosedPositionCount(pseudoAccount As String) As Long
' Retrieve portfolio open short quantity (Position category = DAY).
Public Function GetPortfolioOpenShortQuantity(pseudoAccount As String) As Long
' Retrieve portfolio open long quantity (Position category = DAY).
Public Function GetPortfolioOpenLongQuantity(pseudoAccount As String) As Long
' Retrieve portfolio order count.
Public Function GetPortfolioOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio "open" order count.
Public Function GetPortfolioOpenOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio "complete" order count.
Public Function GetPortfolioCompleteOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio "cancelled" order count.
Public Function GetPortfolioCancelledOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio "rejected" order count.
Public Function GetPortfolioRejectedOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio "trigger pending" order count.
Public Function GetPortfolioTriggerPendingOrderCount(pseudoAccount As String) As Long
' Retrieve portfolio M2M (Position category = NET).
Public Function GetPortfolioMtmNET(pseudoAccount As String) As Double
' Retrieve portfolio PNL (Position category = NET).
Public Function GetPortfolioPnlNET(pseudoAccount As String) As Double
' Retrieve portfolio position count (Position category = NET).
Public Function GetPortfolioPositionCountNET(pseudoAccount As String) As Long
' Retrieve portfolio OPEN position count (Position category = NET).
Public Function GetPortfolioOpenPositionCountNET(pseudoAccount As String) As Long
' Retrieve portfolio CLOSED position count (Position category = NET).
Public Function GetPortfolioClosedPositionCountNET(pseudoAccount As String) As Long
' Retrieve portfolio open short quantity (Position category = NET).
Public Function GetPortfolioOpenShortQuantityNET(pseudoAccount As String) As Long
' Retrieve portfolio open long quantity (Position category = NET).
Public Function GetPortfolioOpenLongQuantityNET(pseudoAccount As String) As Long
Parameters
- account – pseudo account
Return value
Requested portfolio statistic value