QuantConnect / QuantConnect/Lean

Data types can define how they update security cache

Open
#8,856 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior
  • Data sources can define a way to update the security cache price properties

See related https://github.com/QuantConnect/Lean/pull/7808

Actual Behavior

Not possible. Security cache class knows how to handle trade/tick/quote bars, does not how to handle python data for example

Potential Solution
  • We can create a base virtual function in BaseData class
  • override in quotebar/tradebar and tick, this would just be moving the code from the security cache into each specific data type
  • at this point custom data sources in python could define their own implementation. We could explore adding a helper method for o/h/l/c/v just to make users life easier
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

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.

Research direction

Start by locating BaseData and SecurityCache, then inspect how trade bars, quote bars, and ticks currently update security-cache price properties. The change is complete when custom data sources, including Python data, can define their own cache update behavior while existing data types retain their handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, python
Domain
backend, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.