Receive Contract Details

View as MarkdownOpen in Claude

EWrapper.contractDetails (

reqId: int. Request identifier to track data.

contract: ContractDetails. Contains the full contract object contents including all information about a specific traded instrument.
)

Receives the full contract’s definitions This method will return all contracts matching the requested via EClientSocket::reqContractDetails. For example, one can obtain the whole option chain with it.

1def contractDetails(self, reqId: int, contractDetails: ContractDetails):
2 print(reqId, contractDetails)

EWrapper.contractDetailsEnd (

reqId: int. Request identifier to track data.
)

After all contracts matching the request were returned, this method will mark the end of their reception.

1def contractDetailsEnd(self, reqId: int):
2 print("ContractDetailsEnd. ReqId:", reqId)