The Position at Index Request
The purpose of this functionality is to provide the position id for a particular provider, account, and optionally an instrument and position type at a certain index. The range of the index goes from 1 to the total number of positions. This can be used together with the number of positions request.
The positionAtIndex format
positionAtIndex( Provider | Account | [Instrument] | [PositionType] | Index )
The standard call of the RTD function which uses positionAtIndex:
=RTD("qst.rtd", "", "positionAtIndex( Provider | Account | [Instrument] | [PositionType] | Index )")
The positionAtIndex parameters are explained below:
Provider – the order entry provider, ex. PTS, QOR
Account – filter by account number
Instrument – [optional] filter by a specific instrument, if missing it will filter by provider and account
PositionType – [optional] filter by the type of positions: ALL (open positions and fills), NET (net positions), OPEN (only open positions), FILLS (only fills); if missing it will be equivalent to all open positions and fills
Index - the index selected, the range of the index starts from 1 up to the total number of positions filtered
Note
The order of these parameters is mandatory, ex. Parameter 1, Provider, cannot be switched with parameter 2, Account. The parameters are not case sensitive.
Note
When the request is used for a type of positions, ex. fills, the index range will correspond to the total number of fills. Ex. if there are 10 positions where only 4 are fills and the rest are open positions, when the FILLS parameter is used, the index range is 1 to 4. If ALL is used (open positions + fills), then the index range becomes 1 to 10.
Example of positionAtIndex request
After selecting any desired cell from the Excel spreadsheet, copy paste the RTD function in the formula bar, having replaced the RTD parameters accordingly. Or enter the parameters separately and combine them for the RTD request.
Requesting the net position id at index 4 from account 886:
=RTD("qst.rtd", "", "positionAtIndex( PTS | 886 | | NET | 4 )")
Requesting the open position at index 5 from account 886:
=RTD("qst.rtd", "", "positionAtIndex( PTS | 886 | | OPEN | 5 )")
Requesting the fill at index 2 from account 886 and instrument ESU26:
=RTD("qst.rtd", "", "positionAtIndex( PTS | 886 | ESU26 | FILLS | 2 )")
Requesting the position id at index 1 from account 886 and instrument ESU26 using concatenation:
=RTD("qst.rtd", "", "positionAtIndex( PTS | 886 | ESU26 | ALL | 1 )")