Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intraday Data Adjustment Factor Challenges #1903

Open
luxiaolei opened this issue Apr 1, 2025 · 0 comments
Open

Intraday Data Adjustment Factor Challenges #1903

luxiaolei opened this issue Apr 1, 2025 · 0 comments
Labels
question Further information is requested

Comments

@luxiaolei
Copy link

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!

@luxiaolei luxiaolei added the question Further information is requested label Apr 1, 2025
@luxiaolei luxiaolei changed the title Intraday (M5) Data Adjustment Factor Challenges Intraday Data Adjustment Factor Challenges Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant