quantjourney-bidask 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. quantjourney_bidask-1.0.2/CHANGELOG.md +137 -0
  2. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/PKG-INFO +20 -20
  3. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/README.md +16 -16
  4. quantjourney_bidask-1.0.2/docs/usage_examples.ipynb +1003 -0
  5. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/pyproject.toml +4 -4
  6. quantjourney_bidask-1.0.1/CHANGELOG.md +0 -61
  7. quantjourney_bidask-1.0.1/docs/usage_examples.ipynb +0 -0
  8. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/LICENSE +0 -0
  9. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/MANIFEST.in +0 -0
  10. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/data/fetch.py +0 -0
  11. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/animated_spread_monitor.py +0 -0
  12. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/basic_spread_estimation.py +0 -0
  13. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/crypto_spread_comparison.py +0 -0
  14. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/liquidity_risk_monitor.py +0 -0
  15. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/simple_data_example.py +0 -0
  16. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/threshold_alert_monitor.py +0 -0
  17. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/examples/websocket_realtime_demo.py +0 -0
  18. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/__init__.py +0 -0
  19. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/_compare_edge.py +0 -0
  20. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/edge.py +0 -0
  21. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/edge_expanding.py +0 -0
  22. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/edge_hft.py +0 -0
  23. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask/edge_rolling.py +0 -0
  24. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/quantjourney_bidask.egg-info/SOURCES.txt +0 -0
  25. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/requirements.txt +0 -0
  26. {quantjourney_bidask-1.0.1 → quantjourney_bidask-1.0.2}/setup.cfg +0 -0
@@ -0,0 +1,137 @@
1
+ # Changelog
2
+
3
+ All notable changes to the quantjourney-bidask project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.1] - 2025-06-28
9
+
10
+ ### Fixed
11
+ - Fixed critical test failures in `edge_rolling` with step parameter indexing
12
+ - Corrected websocket spread calculation to show realistic 1.5-3.5 bps instead of 0 bps
13
+ - Fixed variable naming issues (E741, A002) - renamed `l` to `log_low`, `open` to `open_prices`
14
+ - Removed unused variables (F841) across codebase
15
+ - Fixed line length issues (E501) for better code readability
16
+
17
+ ### Changed
18
+ - Enhanced websocket demo duration from 10s to 30s with detailed price analysis
19
+ - Improved spread calculation logic with realistic fallback estimates
20
+ - Updated all example file names for better clarity:
21
+ - `realtime_spread_monitor.py` → `websocket_realtime_demo.py`
22
+ - `spread_estimator.py` → `basic_spread_estimation.py`
23
+ - `spread_monitor.py` → `threshold_alert_monitor.py`
24
+ - Modernized version management using `importlib.metadata`
25
+
26
+ ### Removed
27
+ - Removed unused `websocket_fetcher.py` (308 lines) - was never used in examples
28
+ - Cleaned up unused imports and dependencies
29
+
30
+ ### Added
31
+ - Comprehensive professional docstrings for all files with authorship and framework branding
32
+ - `MAINTAINERS.md` with project maintainer information
33
+ - `VERSION_MANAGEMENT.md` documenting version management approach
34
+ - Enhanced README.md with professional badges and updated example references
35
+
36
+ ## [1.0.0] - 2025-06-28
37
+
38
+ ### Added - Major Release
39
+ - **Performance Optimization**: Complete rewrite with Numba JIT compilation for 10x+ speed improvement
40
+ - **HFT-Ready Implementation**: Added `edge_hft.py` with ultra-low latency for high-frequency trading
41
+ - **Enhanced Algorithm Accuracy**: Improved numerical stability and edge case handling
42
+ - **Advanced Rolling Windows**: Full pandas compatibility with step parameter support
43
+ - **Comprehensive Testing**: 32 unit tests with 100% pass rate including edge cases
44
+ - **Professional Documentation**: Complete API documentation with examples and FAQ section
45
+
46
+ ### Enhanced Core Library
47
+ - **`edge()`**: Numba-optimized core estimator with debug mode and robust error handling
48
+ - **`edge_rolling()`**: Vectorized rolling window implementation with step support
49
+ - **`edge_expanding()`**: Optimized expanding window calculations
50
+ - **`edge_hft()`**: Ultra-fast implementation for production HFT systems
51
+
52
+ ### Real-Time Data Integration
53
+ - **WebSocket Support**: Live BTC data streaming from Binance and other exchanges
54
+ - **Fallback Systems**: Robust synthetic data generation when live data unavailable
55
+ - **Multi-Exchange Support**: CCXT integration for multiple cryptocurrency exchanges
56
+ - **Stock Data Integration**: Yahoo Finance integration for equity data
57
+
58
+ ### Advanced Examples
59
+ - **`animated_spread_monitor.py`**: Real-time animated visualizations with 30s websocket demo
60
+ - **`crypto_spread_comparison.py`**: Multi-asset cryptocurrency spread analysis
61
+ - **`liquidity_risk_monitor.py`**: Advanced risk monitoring with spread-based metrics
62
+ - **`websocket_realtime_demo.py`**: Production-ready real-time monitoring architecture
63
+ - **`threshold_alert_monitor.py`**: Configurable threshold-based alerting system
64
+
65
+ ### Technical Improvements
66
+ - **Numba JIT Compilation**: Core algorithms optimized with `@jit(nopython=True, cache=True)`
67
+ - **Memory Efficiency**: Optimized array operations and reduced memory footprint
68
+ - **Error Handling**: Comprehensive validation and graceful degradation
69
+ - **Pandas Integration**: Full compatibility with pandas rolling/expanding operations
70
+ - **Type Hints**: Complete type annotations for better IDE support
71
+
72
+ ### Testing & Quality
73
+ - **Comprehensive Test Suite**: 32 tests covering all functionality and edge cases
74
+ - **Sandbox Environment**: Complete user experience testing before PyPI release
75
+ - **Code Quality**: Fixed all linting issues (E741, A002, F841, E501)
76
+ - **Documentation Testing**: Verified all examples work with real and synthetic data
77
+
78
+ ### Package Management
79
+ - **Modern Packaging**: Updated to latest pyproject.toml standards
80
+ - **Single-Source Versioning**: Streamlined version management with importlib.metadata
81
+ - **Professional Structure**: Clean package organization with proper docstrings
82
+ - **GitHub Actions**: Automated testing and build validation
83
+
84
+ ## [0.9.0] - 2024-06-24
85
+
86
+ ### Added
87
+ - Initial release of quantjourney-bidask package
88
+ - EDGE (Efficient estimator of bid-ask spreads) implementation based on Ardia, Guidotti & Kroencke (2024)
89
+ - Core functionality:
90
+ - `edge()`: Single spread estimate from OHLC data
91
+ - `edge_rolling()`: Rolling window spread estimates with vectorized operations
92
+ - `edge_expanding()`: Expanding window spread estimates
93
+ - Data fetching capabilities:
94
+ - `fetch_yfinance_data()`: Yahoo Finance integration via yfinance
95
+ - `fetch_binance_data()`: Binance API integration via custom FastAPI server
96
+ - Real-time monitoring:
97
+ - `LiveSpreadMonitor`: WebSocket-based real-time spread monitoring
98
+ - Configurable alert thresholds and callbacks
99
+ - Multi-symbol support for cryptocurrency pairs
100
+ - Comprehensive examples:
101
+ - Basic spread estimation with synthetic and real data
102
+ - Animated spread monitoring for presentations
103
+ - Multi-cryptocurrency spread comparison analysis
104
+ - Liquidity risk monitoring with statistical alerts
105
+ - Real-time WebSocket implementation examples
106
+ - Professional documentation:
107
+ - Detailed docstrings following NumPy style
108
+ - Academic paper validation (matches expected results)
109
+ - Usage examples with both synthetic and real market data
110
+ - Testing framework:
111
+ - Unit tests for core functionality
112
+ - Validation against original research paper results
113
+ - Edge case handling (missing data, insufficient observations)
114
+
115
+ ### Technical Details
116
+ - Implements the methodology from "Efficient estimation of bid–ask spreads from open, high, low, and close prices" (Journal of Financial Economics, 2024)
117
+ - Vectorized operations for high-performance rolling calculations
118
+ - Proper handling of missing values and edge cases
119
+ - Support for multiple data frequencies (minute, hourly, daily)
120
+ - WebSocket integration for real-time cryptocurrency data
121
+ - Modern Python packaging with pyproject.toml
122
+
123
+ ### Dependencies
124
+ - numpy >= 1.20
125
+ - pandas >= 1.5
126
+ - requests >= 2.28
127
+ - yfinance >= 0.2
128
+ - matplotlib >= 3.5
129
+ - plotly >= 5.0
130
+ - websocket-client >= 1.0
131
+
132
+ ### Author
133
+ - Jakub Polec (jakub@quantjourney.pro)
134
+ - QuantJourney
135
+
136
+ ### License
137
+ - MIT License
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantjourney-bidask
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Efficient bid-ask spread estimator from OHLC prices
5
5
  Author-email: Jakub Polec <jakub@quantjourney.pro>
6
6
  License: MIT
7
- Project-URL: Homepage, https://github.com/QuantJourneyOrg/qj_bidask
8
- Project-URL: Repository, https://github.com/QuantJourneyOrg/qj_bidask
9
- Project-URL: Bug Tracker, https://github.com/QuantJourneyOrg/qj_bidask/issues
7
+ Project-URL: Homepage, https://github.com/QuantJourneyOrg/quantjourney-bidask
8
+ Project-URL: Repository, https://github.com/QuantJourneyOrg/quantjourney-bidask
9
+ Project-URL: Bug Tracker, https://github.com/QuantJourneyOrg/quantjourney-bidask/issues
10
10
  Keywords: finance,bid-ask,spread,trading,quantitative,OHLC
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Financial and Insurance Industry
@@ -43,12 +43,12 @@ Dynamic: license-file
43
43
 
44
44
  # QuantJourney Bid-Ask Spread Estimator
45
45
 
46
- ![Build Status](https://github.com/QuantJourneyOrg/qj_bidask/actions/workflows/test.yml/badge.svg)
46
+ ![Build Status](https://github.com/QuantJourneyOrg/quantjourney-bidask/actions/workflows/test.yml/badge.svg)
47
47
  [![PyPi Version](https://img.shields.io/pypi/v/quantjourney-bidask.svg)](https://pypi.org/project/quantjourney-bidask/)
48
48
  [![Python Versions](https://img.shields.io/pypi/pyversions/quantjourney-bidask.svg)](https://pypi.org/project/quantjourney-bidask/)
49
49
  [![Downloads](https://pepy.tech/badge/quantjourney-bidask)](https://pepy.tech/project/quantjourney-bidask)
50
- [![License](https://img.shields.io/github/license/QuantJourneyOrg/qj_bidask.svg)](https://github.com/QuantJourneyOrg/qj_bidask/blob/main/LICENSE)
51
- [![GitHub Stars](https://img.shields.io/github/stars/QuantJourneyOrg/qj_bidask?style=social)](https://github.com/QuantJourneyOrg/qj_bidask)
50
+ [![License](https://img.shields.io/github/license/QuantJourneyOrg/quantjourney-bidask.svg)](https://github.com/QuantJourneyOrg/quantjourney-bidask/blob/main/LICENSE)
51
+ [![GitHub Stars](https://img.shields.io/github/stars/QuantJourneyOrg/quantjourney-bidask?style=social)](https://github.com/QuantJourneyOrg/quantjourney-bidask)
52
52
 
53
53
 
54
54
  The `quantjourney-bidask` library provides an efficient estimator for calculating bid-ask spreads from open, high, low, and close (OHLC) prices, based on the methodology described in:
@@ -75,13 +75,13 @@ This library is designed for quantitative finance professionals, researchers, an
75
75
  The package includes comprehensive examples with beautiful visualizations:
76
76
 
77
77
  ### Spread Monitor Results
78
- ![Spread Monitor](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/refs/heads/main/_output/spread_monitor_results.png)
78
+ ![Spread Monitor](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/refs/heads/main/_output/spread_monitor_results.png)
79
79
 
80
80
  ### Basic Data Analysis
81
- ![Crypto Spread Analysis](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/ad49bd78c82ab1c44561d0f2e707ae304575a147/_output/crypto_spread_comprehensive_analysis.png)
81
+ ![Crypto Spread Analysis](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/ad49bd78c82ab1c44561d0f2e707ae304575a147/_output/crypto_spread_comprehensive_analysis.png)
82
82
 
83
83
  ### Crypto Spread Comparison
84
- ![Crypto Spread Comparison](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/refs/heads/main/_output/crypto_spread_comparison.png)
84
+ ![Crypto Spread Comparison](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/refs/heads/main/_output/crypto_spread_comparison.png)
85
85
 
86
86
  ## FAQ
87
87
 
@@ -136,8 +136,8 @@ pip install quantjourney-bidask
136
136
  For development (local setup):
137
137
 
138
138
  ```bash
139
- git clone https://github.com/QuantJourneyOrg/qj_bidask
140
- cd qj_bidask
139
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
140
+ cd quantjourney-bidask
141
141
  pip install -e .
142
142
  ```
143
143
 
@@ -303,8 +303,8 @@ for example in examples_path.glob('*.py'):
303
303
  Or clone the repository for full access to examples and tests:
304
304
 
305
305
  ```bash
306
- git clone https://github.com/QuantJourneyOrg/qj_bidask
307
- cd qj_bidask
306
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
307
+ cd quantjourney-bidask
308
308
  python examples/simple_data_example.py
309
309
  python examples/basic_spread_estimation.py
310
310
  python examples/animated_spread_monitor.py # 30s real BTC websocket demo
@@ -339,8 +339,8 @@ For full development access including tests:
339
339
 
340
340
  ```bash
341
341
  # Clone the repository
342
- git clone https://github.com/QuantJourneyOrg/qj_bidask
343
- cd qj_bidask
342
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
343
+ cd quantjourney-bidask
344
344
 
345
345
  # Install in development mode
346
346
  pip install -e .
@@ -420,8 +420,8 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
420
420
  ### Development Setup
421
421
 
422
422
  ```bash
423
- git clone https://github.com/QuantJourneyOrg/qj_bidask
424
- cd qj_bidask
423
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
424
+ cd quantjourney-bidask
425
425
  pip install -e ".[dev]"
426
426
 
427
427
  # Run tests
@@ -434,6 +434,6 @@ python examples/websocket_realtime_demo.py # Full dashboard
434
434
 
435
435
  ## Support
436
436
 
437
- - **Documentation**: [GitHub Repository](https://github.com/QuantJourneyOrg/qj_bidask)
438
- - **Issues**: [Bug Tracker](https://github.com/QuantJourneyOrg/qj_bidask/issues)
437
+ - **Documentation**: [GitHub Repository](https://github.com/QuantJourneyOrg/quantjourney-bidask)
438
+ - **Issues**: [Bug Tracker](https://github.com/QuantJourneyOrg/quantjourney-bidask/issues)
439
439
  - **Contact**: jakub@quantjourney.pro
@@ -1,11 +1,11 @@
1
1
  # QuantJourney Bid-Ask Spread Estimator
2
2
 
3
- ![Build Status](https://github.com/QuantJourneyOrg/qj_bidask/actions/workflows/test.yml/badge.svg)
3
+ ![Build Status](https://github.com/QuantJourneyOrg/quantjourney-bidask/actions/workflows/test.yml/badge.svg)
4
4
  [![PyPi Version](https://img.shields.io/pypi/v/quantjourney-bidask.svg)](https://pypi.org/project/quantjourney-bidask/)
5
5
  [![Python Versions](https://img.shields.io/pypi/pyversions/quantjourney-bidask.svg)](https://pypi.org/project/quantjourney-bidask/)
6
6
  [![Downloads](https://pepy.tech/badge/quantjourney-bidask)](https://pepy.tech/project/quantjourney-bidask)
7
- [![License](https://img.shields.io/github/license/QuantJourneyOrg/qj_bidask.svg)](https://github.com/QuantJourneyOrg/qj_bidask/blob/main/LICENSE)
8
- [![GitHub Stars](https://img.shields.io/github/stars/QuantJourneyOrg/qj_bidask?style=social)](https://github.com/QuantJourneyOrg/qj_bidask)
7
+ [![License](https://img.shields.io/github/license/QuantJourneyOrg/quantjourney-bidask.svg)](https://github.com/QuantJourneyOrg/quantjourney-bidask/blob/main/LICENSE)
8
+ [![GitHub Stars](https://img.shields.io/github/stars/QuantJourneyOrg/quantjourney-bidask?style=social)](https://github.com/QuantJourneyOrg/quantjourney-bidask)
9
9
 
10
10
 
11
11
  The `quantjourney-bidask` library provides an efficient estimator for calculating bid-ask spreads from open, high, low, and close (OHLC) prices, based on the methodology described in:
@@ -32,13 +32,13 @@ This library is designed for quantitative finance professionals, researchers, an
32
32
  The package includes comprehensive examples with beautiful visualizations:
33
33
 
34
34
  ### Spread Monitor Results
35
- ![Spread Monitor](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/refs/heads/main/_output/spread_monitor_results.png)
35
+ ![Spread Monitor](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/refs/heads/main/_output/spread_monitor_results.png)
36
36
 
37
37
  ### Basic Data Analysis
38
- ![Crypto Spread Analysis](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/ad49bd78c82ab1c44561d0f2e707ae304575a147/_output/crypto_spread_comprehensive_analysis.png)
38
+ ![Crypto Spread Analysis](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/ad49bd78c82ab1c44561d0f2e707ae304575a147/_output/crypto_spread_comprehensive_analysis.png)
39
39
 
40
40
  ### Crypto Spread Comparison
41
- ![Crypto Spread Comparison](https://raw.githubusercontent.com/QuantJourneyOrg/qj_bidask/refs/heads/main/_output/crypto_spread_comparison.png)
41
+ ![Crypto Spread Comparison](https://raw.githubusercontent.com/QuantJourneyOrg/quantjourney-bidask/refs/heads/main/_output/crypto_spread_comparison.png)
42
42
 
43
43
  ## FAQ
44
44
 
@@ -93,8 +93,8 @@ pip install quantjourney-bidask
93
93
  For development (local setup):
94
94
 
95
95
  ```bash
96
- git clone https://github.com/QuantJourneyOrg/qj_bidask
97
- cd qj_bidask
96
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
97
+ cd quantjourney-bidask
98
98
  pip install -e .
99
99
  ```
100
100
 
@@ -260,8 +260,8 @@ for example in examples_path.glob('*.py'):
260
260
  Or clone the repository for full access to examples and tests:
261
261
 
262
262
  ```bash
263
- git clone https://github.com/QuantJourneyOrg/qj_bidask
264
- cd qj_bidask
263
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
264
+ cd quantjourney-bidask
265
265
  python examples/simple_data_example.py
266
266
  python examples/basic_spread_estimation.py
267
267
  python examples/animated_spread_monitor.py # 30s real BTC websocket demo
@@ -296,8 +296,8 @@ For full development access including tests:
296
296
 
297
297
  ```bash
298
298
  # Clone the repository
299
- git clone https://github.com/QuantJourneyOrg/qj_bidask
300
- cd qj_bidask
299
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
300
+ cd quantjourney-bidask
301
301
 
302
302
  # Install in development mode
303
303
  pip install -e .
@@ -377,8 +377,8 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
377
377
  ### Development Setup
378
378
 
379
379
  ```bash
380
- git clone https://github.com/QuantJourneyOrg/qj_bidask
381
- cd qj_bidask
380
+ git clone https://github.com/QuantJourneyOrg/quantjourney-bidask
381
+ cd quantjourney-bidask
382
382
  pip install -e ".[dev]"
383
383
 
384
384
  # Run tests
@@ -391,6 +391,6 @@ python examples/websocket_realtime_demo.py # Full dashboard
391
391
 
392
392
  ## Support
393
393
 
394
- - **Documentation**: [GitHub Repository](https://github.com/QuantJourneyOrg/qj_bidask)
395
- - **Issues**: [Bug Tracker](https://github.com/QuantJourneyOrg/qj_bidask/issues)
394
+ - **Documentation**: [GitHub Repository](https://github.com/QuantJourneyOrg/quantjourney-bidask)
395
+ - **Issues**: [Bug Tracker](https://github.com/QuantJourneyOrg/quantjourney-bidask/issues)
396
396
  - **Contact**: jakub@quantjourney.pro