Skip to navigation

WSH Event Data

View as MarkdownOpen in Claude

Introduction

The function EClient.reqWshEventData is used to request various calendar events from Wall Street Horizon. The event data is then received via the callback EWrapper.wshEventData. Pending event data requests can be canceled with the function EClient.cancelWshEventData.

Note: Prior to sending this message, the API client must make a request for metadata via EClient.reqWshMetaData.

Also note that TWS will not support multiple concurrent requests. Previous request should succeed, fail, or be cancelled by client before next one. TWS will reject such requests with text “Duplicate WSH meta-data request” or “Duplicate WSH event request”.


Request Event Data

EClient.reqWshEventData(requestId, wshEventData)

Requests event data from the WSH calendar.

requestId
int

Request identifier used to track data.

wshEventData
WshEventData

Unique object used to track all parameters for the event data request.


self.reqWshEventData(1101, eventDataObj, serverVersion)

Receive Event Data

EWrapper.wshEventData(requestId, dataJson)

Returns calendar events from the WSH.

requestId
int

Request identifier used to track data.

dataJson
string

Event data json format.


def wshEventData(self, reqId: int, dataJson: str):
print("WshEventData.", "ReqId:", reqId, "Data JSON:", dataJson)

Cancel Event Data

EClient.cancelWshEventData(requestId)

Cancels pending WSH event data request.

requestId
int

Request identifier used to track data.


self.cancelWshEventData(1101, eventDataObj)