开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Duplicate Order ID


 

I think the best for you is to get the excel file which comes with the IB API and do some tests in their code.?

What you have now developed I can not check if it is valid or it will work. I started the same way, by copying first the excel file of IB and then doing some minor changes and debugging. So if you already did this, then I recommend starting again. You should also debug the code to see how it works, like for example, setting a breakpoint?into the procedures called by the TWS usually?placed in the API module after your request has been sent.

Hope that helps

El lun, 1 ago 2022 a las 12:37, Metrodus79 (<robert.metasch@...>) escribió:
Hello joanmarcel119, hello Jürgen

I'm not anymore sure if the the request for the is valuable for me. To make the request i need a contract object and fill this with all the information that also need to place an order. I'm not sure if the contract object need all the information that i put in.

Request for?

Sub M_REAL_ORDER_KONTRAKT_DETAILS_ANFORDERN()

Call M_GLOB_DEKLARATIONEN_EXCEC
?? ?
??? If Not (objTWSControl Is Nothing) Then
????? ?
??????? If objTWSControl.m_isConnected Then
?????? ?
??????????? 'Create object contract
??????????? Set contract = objTWSControl.contract

??????????? 'Fill this object it with contract information
??????????? With objTWSControl.contract

??????????????? .Symbol = UCase(wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("SYMBOL")))
??????????????? .secType = UCase(wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("SECTYP")))
??????????????? .lastTradeDateOrContractMonth = wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("VERFALLSDATUM"))
??????????????? .multiplier = UCase(wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("MULTIPLIKATOR")))
??????????????? .exchange = UCase(wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("B?RSE")))
??????????????? .currency = UCase(wksRealImport.Cells(lngZ, flngFindeSpaltewksRealImport("W?HRUNG")))
??????????? ?
??????????? End With
?????????? ?
??????????? Dim lngreqId As Long
?????????? ?
??????????? lngreqId = 1
???????????
?????????? 'Call for detailed contract information.
??????????? Call objTWSControl.m_TWSControl.reqContractDetailsEx(lngreqId, objTWSControl.m_contractInfo)
?????? ?
??????? End If
??
?? End if

end Sub

Public Event send me the contract object in class modul

Public WithEvents m_TWSControl As Tws
Public contract As TWSLib.IContract

Private Sub m_TWSControl_contractDetailsEx(ByVal lngreqId As Long, ByVal contract As ComContractDetails)

Call M_REAL_ORDER_KONTRAKT_OBJEKT(lngreqId, contract)

End Sub

Do i get the same object back what i declared before? is This my problem here?

Thanks again but I'm struggling with this.



Join [email protected] to automatically receive all group messages.