Skip to content

Intraday Data Adjustment Factor Challenges #1903

Open
@luxiaolei

Description

@luxiaolei

Intraday (e.g. M5) Data Adjustment Factor Challenges

Problem Description

I'm implementing a system that downloads and processes stock data for QLib, including M5 (5-minute) intraday data. I've encountered a significant challenge with adjustment factors for intraday data, particularly during market hours when the final EOD adjustment factors aren't yet available.

Specific Issues

  1. Real-time Adjustment Factor Gap:

    • During market hours, I only have raw M5 OHLCV data without adjustment factors
    • The final adjustment factors are only available after market close
    • Using previous day's factors creates discontinuities when corporate actions occur
  2. Data Continuity Problems:

    • If I use previous day's factor during market hours, there's a mismatch between:
      • The actual M5 bars during market hours
      • How that same data will appear in historical backtests after adjustment
    • This can lead to different behaviors between backtesting and live trading
  3. Potential Approaches:

    • Use previous day's factor for real-time data (simple but creates discontinuities)
    • Implement a dual approach: provisional adjustment during market hours, then EOD reconciliation
    • Store both raw and adjusted data (complex but accurate)

Current QLib Documentation

I've searched the QLib documentation and GitHub issues but found limited guidance on handling this specific challenge. The documentation describes adjustment factors for daily data but doesn't address the timing challenges for intraday data.

Questions

  1. What is the recommended approach in QLib for handling intraday adjustment factors?
  2. Does QLib have any built-in mechanisms for provisional/final adjustment of intraday data?
  3. How do other QLib users address this issue in production systems with real-time data?
  4. Would the QLib team consider adding documentation or examples for this common use case?

Any guidance would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions