Introduction

View as MarkdownOpen in Claude

For many functions, such as EClient.reqHistoricalData, you will need to request market data for a contract. Given that you may not know how long a symbol has been available, you can use EClient.reqHeadTimestamp to find the first available point of data for a given whatToShow value.

ReqHeadTimeStamp counts as an ongoing historical data request, similar to using EClient.reqHistoricalData’s keepUpToDate=True flag. As a result, users should always:

  • Cancel timestamp requests using [EClient.cancelHeadTimeStamp](/tws-api/doc/market-data-historical/finding-the-earliest-available-data-point/cancelling-timestamp-requests).
  • All EClient.reqHeadTimestamp requests follow the [30 second bar limitations](/tws-api/doc/market-data-historical/historical-data-limitations/introduction), regardless of which bar size value has been requested.