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 27, 2021 at 06:35 PM · redi-api

COMPLEXORDER - "Side is Required" Error

In production we're getting a "Side is Required" error from the code below however it works fine in the test environment. Any ideas welcome. Thanks!


Private Function SendOptionsOrder() As Integer
'===============================================================
' Send diagonal options order to REDI.
'===============================================================
    Dim Ord As New COMPLEXORDER
    Dim RediRtn As Variant
    Dim RetVal As Integer: RetVal = RET_OK
    Dim ErrMsg As Variant
    
    ' Complex order header
    Ord.Strategy = "Diagonal"
    Ord.SetSymbol 0, "VICI"
    Ord.SetTIF 0, "Day"
    Ord.SetAccount 0, "ACC1"
    
    ' Long Put
    Ord.SetSide 1, "Buy"
    Ord.SetPosition 1, "Open"
    Ord.SetOptType 1, "Put"
    Ord.SetMonth 1, "Jan '23"
    Ord.SetStrike 1, "30.00"
    
    ' Short Put
    Ord.AddOptionLeg
    Ord.SetSide 2, "Sell"
    Ord.SetPosition 2, "Open"
    Ord.SetOptType 2, "Put"
    Ord.SetMonth 2, "Nov '21"
    Ord.SetStrike 2, "25.00"
    
    ' complete header details
    Ord.CustomerIndicator = "xyz"
    Ord.SetExchange 0, "IBCO DMA"
    Ord.SetQuantity 0, 1
    Ord.SetPriceType 0, "Limit"
    Ord.SetPrice 0, 2
        
    ' send order
    RediRtn = Ord.Submit(ErrMsg)
    
    If Not RediRtn Then
        RetVal = RET_FAIL
        If Trim(ErrMsg) = "" Then
          ErrMsg = "No error message returned. Please contact support."
        End If
        ErrMsg = "Options order FAILED." & vbCrLf & vbCrLf & "Error Message: " & ErrMsg
        MsgBox ErrMsg, vbCritical + vbOKOnly, "Order Entry Failed"
    End If
    SendOptionsOrder = RetVal

End Function


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.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by zoya faberov · Sep 28, 2021 at 12:57 AM

Hello @DDALY ,

Try to remove

Ord.AddOptionLeg

Appears to be causing the same misreport, for me - hope this helps

---

When order population requirements for ComplexOrders in REDI turn a bit tricky, I find it helpful to go back to REDI VB ExcelExamples on GitHub -> Example "Order Entry - Complex Option", start with the working example for a specific option type, and work to the current requirement.

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:03 PM

Hi, @zoya faberov, Firstly, that worked so thank you! Also, great advice on the example Excel file - I'll keep that handy for reference.

The problem however is that now it doesn't work for me in the staging environment [see error message]. I remember this was the reason I added that line of code in the first place. Seems like there is some kind of environmental mismatch. How can we fix this?

Capture.JPG



capture.jpg (16.7 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
REFINITIV
Answer by zoya faberov · Oct 06, 2021 at 04:33 PM

Hello @DDALY and all,

Please find our Complex Options -> Diagonal sample updated on GitHub, to set Symbol before setting Strategy.

This example code is verified to work with versions 19 and 21, and by following the same approach, you should be able to have the custom code running under both versions.

Diagonal example does not include setting AddOptionLeg. It is not intended for use for Diagonal, it should only be used for custom strategy.

Hope this information helps

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 07, 2021 at 02:55 PM

Thanks @zoya faberov, got it! Ties back to this solution as well https://community.developers.refinitiv.com/questions/84071/how-to-enter-a-custom-eq-order-via-redi-api.html?childToView=84669#answer-84669.

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 >
7 People are following this question.

Related Questions

L1 Market Data Subscription - Base Price

Dear team. I am testing sending orders via REDI and I'd like to speed up the process for sending orders. Is there a way to send orders in batch mode or is there any other way to make the process faster? Thanks. Riccardo.

We see incorrect prices pulled for most of the canadian equities as of 07/09/2020

REDI CacheControl Cell Names List

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

  • 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