The Order Id at Index Request

The purpose of this functionality is to provide a snapshot of the order id for a particular provider, account, instrument (optional) at a certain index. The range of the index goes from 1 to the total number of orders. This can be used together with the number of orders request.

The orderIdAtIndex format

The orderIdAtIndex request receives a total of 5 parameters which will filter the searched order id.
The parameters are separated by a vertical bar ‘|’ character. Parameters in [ ] can be omitted.
orderIdAtIndex( Provider | Account | [Instrument] | [Working] | Index )

The standard call of the RTD function which uses orderIdAtIndex:

=RTD(“qst.rtd”, “”, “orderIdAtIndex( Provider | Account | [Instrument] | [Working] | Index )”)

The orderIdAtIndex 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

  • Working – [optional] filter by active orders by using the keyword “WRK”, if missing it will display all orders (including canceled ones)

  • Index - the index selected, the range of the index starts from 1 up to the total number of orders

Note

The order of these parameters is mandatory, ex. Parameter 1, Provider, cannot be switched with parameter 2, Account.

Note

If the index requested is greater than the total number of orders, an error message will be returned.

Note

When the request is used for active orders (WRK parameter), the index range will correspond to the total number of active orders. Ex. if there are 10 orders where only 4 are still active and the rest are canceled, when WRK is used, the index range is 1 to 4. If WRK is missing (all orders), then the index range becomes 1 to 10.

Note

This request works like a snapshot, if an active order is canceled/filled in the meanwhile, the request needs to be requeried for the corresponding index.

Because Excel caches the response, when requering from Excel it is needed to change the request each time: a simple add/remove of a space is enough. If the parameters are listed separately and concatenated for the request, adding/removing a space in the cell of a parameter will trigger the requery.

Example of orderIdAtIndex 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.

  1. Requesting the order id at index 8 from account 1:

=RTD(“qst.rtd”, “”, “orderIdAtIndex( PTS | 1 | | | 8 )”)
../_images/orderIdAtIndex_all.png

  1. Requesting the active order id at index 1 from account 1:

=RTD(“qst.rtd”, “”, “orderIdAtIndex( PTS | 1 | | WRK | 1 )”)
../_images/orderIdAtIndex_wrk.png

  1. Requesting the order id at index 4 from account 1 and instrument ZCH26:

=RTD(“qst.rtd”, “”, “orderIdAtIndex( PTS | 1 | ZCH26 | | 4 )”)
../_images/orderIdAtIndex_all_ins.png

  1. Requesting the active order id at index 2 from account 1 and instrument ZCH26 using concatenation:

=RTD(“qst.rtd”, “”, “orderIdAtIndex( PTS | 1 | ZCH26 | WRK | 2 )”)
In the screenshot the orderIdAtIndex parameters are concatenated: =CONCAT(B1,”|”,B2,”|”,B3,”|”,B5,”|”,B10) , resulting in the string “PTS|1|ZCH26|WRK|2” . This concatenation is then passed as a parameter to the main request: =RTD(“qst.rtd”,””,”orderIdAtIndex(”& CONCAT(B1,”|”,B2,”|”,B3,”|”,B5,”|”,A10) & “)”).
../_images/orderIdAtIndex_wrk_ins.png