{"record":{"id":"1c4ac98f31cb7a64","repo":"microsoft/qlib","slug":"start-time-uses-a-future-date-if-you-want-to-ge","errorCode":null,"errorMessage":"`start_time` uses a future date, if you want to get future trading days, you can use: `future=True`","messagePattern":"`start_time` uses a future date, if you want to get future trading days, you can use: `future=True`","errorType":"exception","errorClass":"IndexError","httpStatus":null,"severity":"error","filePath":"qlib/data/data.py","lineNumber":145,"sourceCode":"        Returns\n        -------\n        pd.Timestamp\n            the real start time.\n        pd.Timestamp\n            the real end time.\n        int\n            the index of start time.\n        int\n            the index of end time.\n        \"\"\"\n        start_time = pd.Timestamp(start_time)\n        end_time = pd.Timestamp(end_time)\n        calendar, calendar_index = self._get_calendar(freq=freq, future=future)\n        if start_time not in calendar_index:\n            try:\n                start_time = calendar[bisect.bisect_left(calendar, start_time)]\n            except IndexError as index_e:\n                raise IndexError(\n                    \"`start_time` uses a future date, if you want to get future trading days, you can use: `future=True`\"\n                ) from index_e\n        start_index = calendar_index[start_time]\n        if end_time not in calendar_index:\n            end_time = calendar[bisect.bisect_right(calendar, end_time) - 1]\n        end_index = calendar_index[end_time]\n        return start_time, end_time, start_index, end_index\n\n    def _get_calendar(self, freq, future):\n        \"\"\"Load calendar using memcache.\n\n        Parameters\n        ----------\n        freq : str\n            frequency of read calendar file.\n        future : bool\n            whether including future trading day.\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/data.py#L127-L163","documentation":"Error \"`start_time` uses a future date, if you want to get future trading days, you can use: `future=True`\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/data/data.py:145 when the guard condition fails: \"`start_time` uses a future date\". It triggers when the code path receives input or a state that violates the precondition checked at this point — e.g. an unimplemented abstract method being called, an unsupported argument type/value, or an invalid configuration. To avoid it, satisfy the documented precondition before this call: implement the required method in your subclass, or pass a supported value of the expected type as described by the message.","commonSituations":"See trigger scenarios.","solutions":["Pass `future=True` if you intentionally want future trading days.","Use a `start_time` that is not in the future relative to the calendar."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}