Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Transactions /
  • REDI API /
avatar image
Question by DDALY · Sep 08, 2021 at 02:37 PM · redi-apivba

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

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

7 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by brian.mullane · Sep 09, 2021 at 06:23 PM

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 Sub
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by DDALY · Sep 15, 2021 at 04:14 PM

Hi @brian.mullane, Ok so the order object needed more details. That's working for me now. Thanks a lot!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by DDALY · Sep 27, 2021 at 05:29 PM

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 Sub
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya faberov · Sep 27, 2021 at 11:55 PM

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?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by DDALY · Sep 30, 2021 at 04:19 PM

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]

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya faberov · Sep 30, 2021 at 06:10 PM

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:

rediMap.gif

"IBCO DMA" is "IBO2 DMA", per programmatic interface.


redimap.gif (131.9 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by DDALY · Oct 01, 2021 at 03:11 PM

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!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

I was wondering how I can stop making the Bid, ASK and Last field automatically populate from the REDI API in my order entry tool in excel, it might be coded into the VBA somewhere in the sheet, i am not sure how to fix it

I am sending and canceling orders via excel VBA and Redi on 150 stocks. Redi crashes after a certain period of time, I will often get this response "Microsoft Excel is waiting for another application to complete an OLE action."

How do I set the ratio for one leg in VBA?

Redi Trade Automation

Excel DDE real-time data retrieval

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges