Get Positions
Syntax
Description
The getPositions
function retrieves a list of all currently open positions in the trading portfolio. This function is useful for monitoring the current holdings and their status, which can then be used for making informed trading decisions, such as rebalancing the portfolio or applying stop-loss conditions.
Returns
An array of objects, where each object represents an open position. Each object contains the following properties:
symbol
: the ticker symbol of the asset.openDate
: position open dateopenPrice
: position open pricecloseDate
: position close dateclosePrice
: position close priceunits
: position unitsside
: position sidestats
pl
: position current plplPct
: position pl in percentageduration
: open duration in hours