I'm trying to send the diagonal options order below via the API but get Invalid Exchange error. NOTE:-
1. I have successfully entered the exact same order via the UI including destination and account.
2. I can successfully enter a single options order via API using the same account and exchange.
Please advise solution - thank you!
Dim hOrder As New COMPLEXORDER ' Complex options order header hOrder.Strategy = "Diagonal" hOrder.SetSymbol 0, "VICI" hOrder.SetExchange 0, "DEM2 DMA" hOrder.SetPriceType 0, "Limit" hOrder.SetTIF 0, "Day" hOrder.SetQuantity 0, 1 hOrder.SetAccount 0, "3FORGEDD" ' Long Put hOrder.SetSide 1, "Buy" hOrder.SetPosition 1, "Open" hOrder.SetOptType 1, "Put" hOrder.SetMonth 1, "Jan '23" hOrder.SetStrike 1, "30.00" hOrder.SetAccount 1, "3FORGEDD" ' Short Put hOrder.AddOptionLeg hOrder.SetSide 2, "Sell" hOrder.SetPosition 2, "Open" hOrder.SetOptType 2, "Put" hOrder.SetMonth 2, "Dec '21" hOrder.SetStrike 2, "25.00" hOrder.SetAccount 2, "3FORGEDD" hOrder.SetPrice 0, 4 Dim errStr As Variant Dim rtnVal As Variant ' Send order object to REDI EMS rtnVal = hOrder.Submit(errStr)