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
Best Answer
-
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.
0
Answers
-
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?
0 -
Hi @zoya faberov, Yes the versions are different [see screenshots].
version_staging.JPGversion_prod.JPG
Also the users are different (I don't have a production login). That's about all I could tell you. Thank You.
0 -
Hello @DDALY ,
Versions are very different.
I believe this would explain interface difference, and consequently, the API usage difference.
0 -
Hi
@zoya faberov, Can you confirm whether this is a bug or intentional behavior? The version that doesn't work is the later version and it seems unlikely that they would knowingly release an upgrade that would cause the sample API applications to fail, no? Thanks!0 -
Hi @DDALY ,
I will try to obtain more information on this from the product development.
- In my personal opinion, what we see is a difference in interface, and the later interface, v21, is more efficient, making the extra call unnecessary.
- As a developer and designer, I would prefer to keep development and production on the same version whenever possible, to avoid any discrepancies between them, due to any causes.
- As the way to save time, while allowing to deploy your code in prod, as a temporary measure, I could comment out this call just prior to being deployed in prod.
I will update this question, once we have more information- appreciate your patience.
0 -
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
0 -
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.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛