microsoft / microsoft/qlib

Request for LYR, TTM, LF computation for PIT data

Open
#1,266 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

🌟 Feature Description

When using pit data for computing, there are usually three ways to deal with them, which are lf, lyr and ttm. lf processing means the last file, which returns the value from last financial report; lyr means the last year ratio, which returns the value from the latest yearly report; ttm means trailing 12 months, which returns the mean value of the last 4 quarters.

Motivation

  1. Scenario: When using pit data for caculation some indicator, the processing is neccessary, for the quarterly data may increase with the quarter. In order to solve the problem, we usually use the latest 4 quarters mean value instead. However, the pit database store only the quarterly data, we need a method to transform them into other forms.
  2. References: Like ricequant, there is a suffix like "_mrq_0", "_lf", "lyr" or "_ttm" to specify the type of data you want to fetch. See here for more information.

Alternatives

In fact, we can store pit data as a single feature in the directory of daily frequency stock data. So do the "ttm", "lyr" and "lf" data. However, storing in this way cannot maximize the potential of the pit database. So maybe developping a new file suffix like _ttm instead of just choosing between _a and _q can help a lot.

Or if all the data can be computed dynamically, and only raw quarterly data saved in our database is perfect. I’m thinking about developing operators like TTM, LF specifically applied on pit data, and maybe this is the best solution to the problem

Contributor guide

No contributing guide indexed for this repository

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

No files, tests, or entry points are named. Start by locating the existing PIT data processing and operator paths, then clarify how LF, LYR, and TTM should be represented and calculated. Done means the chosen approach supports these transformations from quarterly PIT data with documented behavior and coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, fintech-quant
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.