QuantConnect / QuantConnect/Lean

Historical Universe Chains

Open
#8,661 1 comment 0 reactions 1 assignee View on GitHub

@jhonabreul is already working on this.

Since Mar 31, 2025.

depth feature
Dominant language
C#
Stars
21.7k
Forks
5.3k
Avg merge
2d 22h
Merged PRs (30d)
34

Description

Expected Behavior

We can get historical Future chains data in an algorithm.

Actual Behavior

self.futures_chain returns the current chain.

This algorithm

class USFutureDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2020, 6, 1)
        self.set_end_date(2021, 6, 1)
        self._future = self.add_future(Futures.Metals.GOLD)
        self._future.set_filter(lambda universe: universe.standards_only().front_month())
        history = self.history[FuturesChain](self._future.symbol, self.time-timedelta(30), self.time)
        for c in history:
            pass

throws

During the algorithm initialization, the following exception has occurred: Data type 'FuturesChain' missing parameterless constructor. E.g. public FuturesChain() { }
at initialize
for c in history:
in main.py: line 10
Data type 'FuturesChain' missing parameterless constructor. E.g. public FuturesChain() { }

Potential Solution

N/A

Reproducing the Problem

Run the algorithm above

System Information

QC Cloud

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.