Summary of CBOE Book Viewer Collector
The article discusses a software program designed to continuously collect and analyze market data from the CBOE (Chicago Board Options Exchange) for the SPY (S&P 500 ETF) trading symbol. The program operates 24/7, polling data from the CBOE's book viewer at specified intervals, and is structured to handle various market sessions, including early, pre-market, regular, and after-hours trading.
Key Features
- Continuous Operation: The program runs continuously, polling data every second during market hours (04:00 to 20:00 New York time) and every minute during closed sessions.
- Data Output: It writes CSV files every second during live sessions and JSON files every minute, along with immediate updates when data quality changes.
- Market Session Handling: The program identifies the current market session and adjusts its polling frequency accordingly, with different intervals for open and closed sessions.
- Data Quality Monitoring: It includes mechanisms to check the freshness of the data and reloads the page if the data becomes stale.
- Error Handling: The program is designed to recover from browser or page failures by recreating the browser session as needed.
Technical Implementation
The program is implemented in C# and utilizes the Playwright library for browser automation. It captures market data by evaluating the DOM of the CBOE book viewer page, parsing the relevant information into structured data formats, and storing it in CSV and JSON files for further analysis.
Data Structure
The captured data includes details such as the best bid and ask prices, market depth, trade prints, and timestamps. The program also calculates various metrics like the spread and book imbalance, providing a comprehensive view of the market state.
Logging and Monitoring
The program logs its operations, including any errors encountered during execution, to ensure that issues can be diagnosed and addressed promptly. It also provides console output to inform users of its current status and any significant events, such as session transitions or data quality changes.
Conclusion
This CBOE Book Viewer Collector is a robust tool for real-time market data collection and analysis, designed to support trading strategies and investment decisions by providing timely and accurate market information.