question

Upvotes
Accepted
410 1 1 3

Can I retrieve the destination name of a previously submitted order?

(posting on behalf of a client)

Is it possible to retrieve the destination name for a previously submitted order?

(i.e. I'm querying open orders and would like to see to what destinations those orders were sent)

redi-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
410 1 1 3

Yes, this is possible using "DisplayExchange". Here's an example in VB:

Sub DataSubscription_CacheEvent(ByVal Action As Long, ByVal ROW As Long)
  Dim I As Integer
  Dim BrSeq As Variant
  Dim Side As Variant
  Dim ExecQuantity As Variant
  Dim symbol As Variant
  Dim ExecPrice As Variant
  Dim Status As Variant
  Dim myerr As Variant
  Dim Account As Variant
  Dim Quantity As Variant
  Dim RefNum As Variant
  Dim PriceType As Variant
  Dim OrderRefKey As Variant
  Dim ParentOrdRefKey As Variant
  Dim Exchange As Variant
  Dim Price As Variant
  Dim TIF As Variant
  Dim Memo As Variant
  Dim MsgType As Variant
  Dim OrdDesc As String
  Dim ProgressPct As Double
  Dim AvgPrice As Variant
Dim DisplayExchange As Variant

  ' =========== Action List ==============
  '  1 : Snapshot
  '  4 : New insert
  '  5 : Update
  ' ======================================

  If (Action = 1) Then

    For I = 0 To ROW - 1
      DataSubscription.GetCell I, "BrSeq", BrSeq, myerr
      DataSubscription.GetCell I, "Side", Side, myerr
      DataSubscription.GetCell I, "ExecQuantity", ExecQuantity, myerr
      DataSubscription.GetCell I, "ExecPrice", ExecPrice, myerr
      DataSubscription.GetCell I, "symbol", symbol, myerr
      DataSubscription.GetCell I, "Account", Account, myerr
      DataSubscription.GetCell I, "Quantity", Quantity, myerr
      DataSubscription.GetCell I, "RefNum", RefNum, myerr
      DataSubscription.GetCell I, "Status", Status, myerr
      DataSubscription.GetCell I, "PriceType", PriceType, myerr
      DataSubscription.GetCell I, "Price", Price, myerr
      DataSubscription.GetCell I, "Memo", Memo, myerr
      DataSubscription.GetCell I, "TIF", TIF, myerr
      DataSubscription.GetCell I, "OrderRefKey", OrderRefKey, myerr
      DataSubscription.GetCell I, "ParentOrdRefKey", ParentOrdRefKey, myerr
      DataSubscription.GetCell I, "MsgType", MsgType, myerr
      DataSubscription.GetCell I, "AvgExecPrice", AvgPrice, myerr
      DataSubscription.GetCell I, "DisplayExchange", DisplayExchange, myerr

      'If Not OrderRefKey = "NONE" And Not MsgType = "ADMIN" And Not PriceType = "Invalid" Then
        Worksheets("Demo").Cells(currRow, "A").Value = Side
        Worksheets("Demo").Cells(currRow, "B").Value = Quantity
        Worksheets("Demo").Cells(currRow, "C").Value = symbol
        Worksheets("Demo").Cells(currRow, "D").Value = PriceType
        Worksheets("Demo").Cells(currRow, "E").Value = Price
        Worksheets("Demo").Cells(currRow, "F").Value = TIF
        Worksheets("Demo").Cells(currRow, "G").Value = OrderRefKey
        Worksheets("Demo").Cells(currRow, "H").Value = RefNum
        Worksheets("Demo").Cells(currRow, "I").Value = Status
        Worksheets("Demo").Cells(currRow, "J").Value = ExecQuantity
        Worksheets("Demo").Cells(currRow, "K").Value = ExecPrice
        Worksheets("Demo").Cells(currRow, "L").Value = MsgType
        Worksheets("Demo").Cells(currRow, "M").Value = AvgPrice
        Worksheets("Demo").Cells(currRow, "N").Value = DisplayExchange

        currRow = currRow + 1
      'End If
      
    Next I

  Else
    DataSubscription.GetCell ROW, "BrSeq", BrSeq, myerr
    DataSubscription.GetCell ROW, "Side", Side, myerr
    DataSubscription.GetCell ROW, "ExecQuantity", ExecQuantity, myerr
    DataSubscription.GetCell ROW, "ExecPrice", ExecPrice, myerr
    DataSubscription.GetCell ROW, "symbol", symbol, myerr
    DataSubscription.GetCell ROW, "Account", Account, myerr
    DataSubscription.GetCell ROW, "Quantity", Quantity, myerr
    DataSubscription.GetCell ROW, "RefNum", RefNum, myerr
    DataSubscription.GetCell ROW, "Status", Status, myerr
    DataSubscription.GetCell ROW, "PriceType", PriceType, myerr
    DataSubscription.GetCell ROW, "Price", Price, myerr
    DataSubscription.GetCell ROW, "Memo", Memo, myerr
    DataSubscription.GetCell ROW, "TIF", TIF, myerr
    DataSubscription.GetCell ROW, "OrderRefKey", OrderRefKey, myerr
    DataSubscription.GetCell ROW, "ParentOrdRefKey", ParentOrdRefKey, myerr
    DataSubscription.GetCell ROW, "MsgType", MsgType, myerr
    DataSubscription.GetCell ROW, "AvgPrice", AvgPrice, myerr
    DataSubscription.GetCell ROW, "DisplayExchange", DisplayExchange, myerr

    'If Not OrderRefKey = "NONE" And Not MsgType = "ADMIN" And Not PriceType = "Invalid" Then
      Worksheets("Demo").Cells(currRow, "A").Value = Side
      Worksheets("Demo").Cells(currRow, "B").Value = Quantity
      Worksheets("Demo").Cells(currRow, "C").Value = symbol
      Worksheets("Demo").Cells(currRow, "D").Value = PriceType
      Worksheets("Demo").Cells(currRow, "E").Value = Price
      Worksheets("Demo").Cells(currRow, "F").Value = TIF
      Worksheets("Demo").Cells(currRow, "G").Value = OrderRefKey
      Worksheets("Demo").Cells(currRow, "H").Value = RefNum
      Worksheets("Demo").Cells(currRow, "I").Value = Status
      Worksheets("Demo").Cells(currRow, "J").Value = ExecQuantity
      Worksheets("Demo").Cells(currRow, "K").Value = ExecPrice
      Worksheets("Demo").Cells(currRow, "L").Value = MsgType
      Worksheets("Demo").Cells(currRow, "M").Value = AvgPrice
      Worksheets("Demo").Cells(currRow, "N").Value = DisplayExchange
      currRow = currRow + 1
    'End If
  End If

End Sub


1576704288542.png (129.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.