Hi,
I would like to set the ratio for one leg in VBA. The
Quantity is for the whole structure.
How to do that? Do I need to add it as a third leg?
Could you please help me?
Here is my source code:
Dim hOrder As New COMPLEXORDER
' Complex options order header ---------------------------
hOrder.Strategy = "Vertical"
hOrder.SetSymbol 0, Symbol
hOrder.SetExchange 0, Exch
hOrder.SetPriceType 0, "Limit"
hOrder.SetTIF 0, "Day"
hOrder.SetQuantity 0, Qty
hOrder.SetAccount 0, Acct
' Leg 1
hOrder.SetSide 1, Side
hOrder.SetPosition 1, "Open"
hOrder.SetOptType 1, PC
hOrder.SetMonth 1, Mat
hOrder.SetStrike 1, Strike
' Leg 2
If (Side = "Buy") Then
hOrder.SetSide 2, "Sell"
ElseIf (Side = "Sell") Then
hOrder.SetSide 2, "Buy"
End If
hOrder.SetPosition 2, "Open"
hOrder.SetOptType 2, PC
hOrder.SetMonth 2, Mat
hOrder.SetStrike 2, Strike2
hOrder.SetPrice 0, Px
If (Live) Then
rtnVal = hOrder.Submit(myerr)
If Not rtnVal Then
If myerr <> "" Then
MsgBox myerr
MsgBox (Now() & "--" & str & "-- Error -- " & myerr)
Else
MsgBox "Failed - Please Contact REDI Support."
End If
Else
Debug.Print (Now() & "--" & str & "-- Order Submitted")
End If
Else
MsgBox (str & " Not live order")
End If
End Sub