Redi Trade Automation
Hello All,
I am working on automating our trading based of an excel spreadsheet. We were provided a spreadsheet we can place orders in and click a button, running a macro to send the orders to the Redi Platform.
What we want to do from here is either update the existing macro or create a new one that automatically sends the trades, once all the required fields are populated. In other words once the Macro recognizes the required trade fields are all populated it will automatically trigger the existing macro sending the trades to the Redi system; without actually clicking to send the trades.
Would someone be able to help us either modify the existing macro or create a new one to trigger the existing Macro once the criteria is met?
Thanks!
Best Answer
-
Hello @cisola,
We strive to help, by guiding developers and developer community toward coding, owning and maintaining robust solutions.
The examples that we provide to the community are simple, well-documented, and widely applicable.
We do not code custom use cases to requirements, rather we are willing to help in advisory capacity for you take responsibility for coding and maintaining.
But whenever possible, we try to find a way to help.
Your use case is not simple, as you require:
- To react to any change in price
- Validate all inputs and create a valid REDI order
- Submit order to REDI
- Update the worksheet with the result of the latest submission request, whether valid or not
In my understanding, the use case is just complex enough, that there are several ways to approach it. I have coded, as an example, within the code you have included, a version of what I believe your require.
The cornerstones of my approach are:
- User Defined Function SENDORDERS that is in Module 6 and reacts to changes and submits orders.
- public variables changeFlag cellToChange and ValueToSet that signal the change out of UDF and allow Status cells to be updated with the results
- Sub Workbook_SheetCalculate on sheet itself, that updates the status on the sheet
It is very likely that this is not all that you require, or not exactly as you envision, or you would prefer a different approach.
In this case, I hope that the example that you will find attached, will help guide you toward fully implementing to your requirements, next.
-Zoya
0
Answers
-
Hi @cisola,
To confirm, does your sheet have a column/cell that says "Trade Now" or "True/False" or anything like that?
-Brian
0 -
0
-
Hi @cisola,
We'd like to suggest, defining a User Defined Function in Excel
that will verify all the required cells are populated, with the valid values, and trigger as you require.
0 -
Thanks, however could you possibly be more specific? I Just need the function to do: IF "Trade now" cell reads "Yes" THEN run "Send Orders" macro.
0 -
Hi @cisola
Not sure if what I am about to answer is what you are looking for
But will try to answer straight-on.
Developer-> View Code
Insert->ModuleType something like:
Function ORDERCOND(Ready)
If Ready = "Yes" Then
'Copy code from our order example for example
Dim hOrder As New OPTIONORDER
hOrder.Side = "Buy"
hOrder.symbol = "SBUX"
hOrder.Type = "Call"
hOrder.Date = "Apr '16"
'....
b = hOrder.Submit(myerr)
End If
End Function
And save.When you type "=ORDERCOND" into one of your cells, enter the location of "Trade now" cell, such as
=ORDERCOND(B9)
If you are looking to validate more parameters, before creating the order, just use the same approach, increase the number of parameters into ORDERCOND and run the checks.
0 -
Thanks @zoya faberov We have a macro that sends orders to Redi Unfortunately, to run that macro we need to click a button. Once clicked it takes the information filled in cells(side, symbol, etc.) &sends the order to Redi. We created a way to automatically populate required cells & have a cell that recognizes when all fields are populated ("Trade now"). Once "Trade Now" cell is populated "Yes" we want to automatically run the existing "Send Orders" Macro
something like this?
Function ORDERCOND(Ready)
If Ready = "Yes" Then'Run Macro "Send Orders"
End If
End Function0 -
Hello @cisola,
The macro that is associated with the button is implemented in code.
Are you able to view the code of the macro?
Do you see in the code the order being populated from the fields and submitted?
Are you able to introduce the check of the cell(s), that you require, into that code, prior to submit?
0 -
I have attached the Spreadsheet here, hopefully that works. the macro used is names "ThisWorkbook.SendOrders"... When the "trade now" (column P) is populated "yes" we want to instantly run the "send order" Macro without any human intervention.
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.4K 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
- 559 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
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 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 中文论坛