As you suspected, the API doesn¡¯t support it. You need to implement any option strategy detection on your client.?
On Feb 26, 2023 at 12:48 PM -0800, Simon Steiner via groups.io <steinersimon@...>, wrote:
toggle quoted message
Show quoted text
Hi,
I trade option strategies in TWS, and I make great use of the predefined strategies (Spreads, Butterfly, etc.) of the Strategy Builder:
<dummyfile.0.part>
After executing a strategy, TWS shows the strategy name under 'Financial Instrument' in the portfolio app. If I open the instrument description, it also shows the strategy like this for example:
<dummyfile.1.part>
When I pull information from the API I haven't seen this information anywhere (not in execDetails, openOrders, positions, etc.)
Am I missing something, or is there simply no way to either extract the strategy type information from the executions, nor to alternatively request the information somehow through the API?
When I manually create an option strategy through a combo contract and pass that contract to the reqContractDetails request, I get an error: "'BAG' isn't supported for contract data request. Please enter a valid security type".?
Is the only way to assign a strategy type to my execution by creating some sort of reverse logic on the client side? For instance what I could extract every leg of a combo order and see if they match any pre-defined strategy. I had hoped I wouldn't have to
implement that, but that the API makes this easier somehow.
Curious what approach others may have, since this must be a common issue.
Thanks,
Simon