OPTIONORDER.GetExchangeCount() returns no exchanges
Hi, ORDER.GetExchangeCount() returns a full count of destinations for me but OPTIONORDER.GetExchangeCount() does not. NOTE: I can see the destinations for options orders in the UI. The actual return value of these functions is Empty for ORDER and False for OPTIONORDER. Permissions issue? Thanks
Best Answer
-
Hi @DDALY ,
Have you checked out the sample code in this sheet? Here, you're setting the order object with the symbol, type, date, etc for the option order, then retrieving the values.
Here, I return a value of 201 (on my test ID).
-Brian
Sub LoadDestList()
Dim I As Integer
Dim NamedRng As String
Dim cnt As Variant
Dim Dest As Variant
Dim DestTemp As Variant
Dim RetVal As Variant
Dim RetVal2 As Variant
Dim RNGSort As String
Dim obj As Object
Dim FindDest As String
Dim COL As Long
Dim RNGCut As String
Dim MSG As String
Dim exch As Variant
Dim objRegExp As New RegExp
Dim strPattern As String: strPattern = "[ ][A-Z]"
Dim regEx As New RegExp
Dim Myrange As Range
Dim inputMatches As Object
Dim Count As Integer: Count = 0
Dim hOrder As New OPTIONORDER
hOrder.symbol = UCase(Worksheets("REDIOptionOrderEntry").Cells(2, "C").Value)
hOrder.Type = Worksheets("REDIOptionOrderEntry").Cells(3, "C").Value
hOrder.Date = Worksheets("REDIOptionOrderEntry").Cells(4, "C").Value
hOrder.Strike = Worksheets("REDIOptionOrderEntry").Cells(5, "C").Value
RetVal = hOrder.GetExchangeCount(cnt)
Worksheets("REDISettings").Range("D3:D1000").Clear
Worksheets("REDISettings").Range("D3:D1000").Interior.Color = RGB(242, 242, 242)
For I = 0 To cnt - 1
exch = hOrder.GetExchangeAt(I)
'Debug.Print exch & " " & I
With regEx
.Global = True
.MultiLine = True
.IgnoreCase = False
.Pattern = strPattern
End With
If regEx.Test(exch) Then
Set inputMatches = regEx.Execute(exch)
'Debug.Print exch & " " & inputMatches.Count
If inputMatches.Count = 1 Then
Worksheets("REDISettings").Cells(Count + 3, "D").Interior.Color = RGB(255, 255, 255)
Worksheets("REDISettings").Cells(Count + 3, "D").Borders.Color = RGB(234, 234, 234)
Worksheets("REDISettings").Cells(Count + 3, "D").Value = exch
Count = Count + 1
End If
End If
Next I
Worksheets("REDISettings").Range("D3:D" & Count + 2).Sort Key1:=Worksheets("REDISettings").Range("D3:D" & Count + 2), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
NamedRng = "=REDISettings!R3C4:R" & Count + 2 & "C4"
Names.Add Name:="Destinations", RefersToR1C1:=NamedRng
End Sub0
Answers
-
Hi @brian.mullane, Ok so the order object needed more details. That's working for me now. Thanks a lot!
0 -
Hi @brian.mullane, I'm having a problem with data for one of our production users. The destination he uses on the UI is "IBCO DMA" as per screenshot.
However if I try to get destinations in code (below) using the same order details, I only get "IBO2 DMA". Any ideas?
Sub GetOptionDest()
Dim hOrder As New OPTIONORDER
Dim RetVal, I, cnt, exch
hOrder.Symbol = "VICI"
hOrder.Type = "Put"
hOrder.Date = "Jan '23"
hOrder.Strike = 30
RetVal = hOrder.GetExchangeCount(cnt)
For I = 0 To cnt - 1
exch = hOrder.GetExchangeAt(I)
Cells(I + 2, 5).Value = exch
Next I
End Sub0 -
Hello @DDALY ,
I would try to populate as in example
hOrder.Symbol = "SPX"
hOrder.Type = "Call"
hOrder.Date = "Dec '21"
hOrder.Strike = "3800"
hOrder.OptionSymbol = "SPX"let us know if this makes a difference?
0 -
Hi @zoya faberov, No unfortunately that didn't help. Also I get the same problem listing the destination for equity orders. If I set up the basic order details in the ORDER object and retrieve the exchanges I can't see "IBCO DMA" which is what the user selects for equity orders via the UI. Please let me know if you have any other ideas, otherwise I might just set up the desired destinations in the application config. Thanks!
[Also I saw you comment - NOTED - in future I'll create a new question]
0 -
Hi @DDALY ,
I think I understand what is going on. At first I thought the user was not able to populate the destinations correctly, so I have approached from that assumption.
Please refer to REDI Destination Name Mappings doc.
See below:
"IBCO DMA" is "IBO2 DMA", per programmatic interface.
0 -
Hi @zoya faberov, Yes this makes sense now. I confirmed that an order entered with "IBO2 DMA" via the API shows up on the UI as "IBCO DMA" so we're all set. Thanks so much!
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 690 Datastream
- 1.5K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 560 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 281 Open PermID
- 46 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 721 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛