Finding Earliest Data Point
Earliest Available Data
To find the earliest available data point for a given instrument and data type a function is in the API starting in v973.02 and v963 of TWS/LYNX, LYNXApi.EClient.reqHeadTimestamp
** Python **
self.reqHeadTimeStamp(4101, ContractSamples.USStockAtSmart(), "TRADES", 0, 1)
** Java **
client.reqHeadTimestamp(4003, ContractSamples.USStock(), "TRADES", 1, 1);
The resulting head timestamp is returned to the function LYNXApi.EWrapper.headTimestamp
** Python **
class TestWrapper(wrapper.EWrapper):
def headTimestamp(self, reqId:int, headTimestamp:str):
print("HeadTimestamp. ReqId:", reqId, "HeadTimeStamp:", headTimestamp)
** Java **
public class EWrapperImpl implements EWrapper {
@Override
public void headTimestamp(int reqId, String headTimestamp) {
System.out.println("Head timestamp. Req Id: " + reqId + ", headTimestamp: " + headTimestamp);
}
A reqHeadTimeStamp request can be cancelled with LYNXApi.EClient.cancelHeadTimestamp
** Python **
self.cancelHeadTimeStamp(4101)
** Java **
client.cancelHeadTimestamp(4003);