quantjourney-bidask 0.6.0__py3-none-any.whl → 0.9.0__py3-none-any.whl
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.
- quantjourney_bidask/_version.py +3 -3
- {quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/METADATA +121 -18
- {quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/RECORD +6 -6
- {quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/licenses/LICENSE +1 -1
- {quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/WHEEL +0 -0
- {quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/top_level.txt +0 -0
quantjourney_bidask/_version.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"""Version information for quantjourney_bidask."""
|
2
2
|
|
3
|
-
__version__ = "0.
|
3
|
+
__version__ = "0.9.0"
|
4
4
|
__author__ = "Jakub Polec"
|
5
5
|
__email__ = "jakub@quantjourney.pro"
|
6
|
-
__license__ = "
|
7
|
-
__copyright__ = "Copyright (c)
|
6
|
+
__license__ = "MIT"
|
7
|
+
__copyright__ = "Copyright (c) 2025 Jakub Polec, QuantJourney"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: quantjourney-bidask
|
3
|
-
Version: 0.
|
4
|
-
Summary: Efficient bid-ask spread estimator from OHLC prices
|
3
|
+
Version: 0.9.0
|
4
|
+
Summary: Efficient bid-ask spread estimator from OHLC prices
|
5
5
|
Author-email: Jakub Polec <jakub@quantjourney.pro>
|
6
6
|
License-Expression: MIT
|
7
7
|
Project-URL: Homepage, https://github.com/QuantJourneyOrg/qj_bidask
|
@@ -26,7 +26,6 @@ Requires-Dist: yfinance>=0.2
|
|
26
26
|
Requires-Dist: matplotlib>=3.5
|
27
27
|
Requires-Dist: plotly>=5.0
|
28
28
|
Requires-Dist: websocket-client>=1.0
|
29
|
-
Requires-Dist: ccxt>=4.0
|
30
29
|
Provides-Extra: dev
|
31
30
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
32
31
|
Requires-Dist: pytest-mock>=3.10; extra == "dev"
|
@@ -185,24 +184,126 @@ python examples/realtime_spread_monitor.py --mode dashboard
|
|
185
184
|
python examples/realtime_spread_monitor.py --mode console
|
186
185
|
```
|
187
186
|
|
188
|
-
##
|
187
|
+
## Project Structure
|
189
188
|
|
190
|
-
|
189
|
+
```
|
190
|
+
quantjourney_bidask/
|
191
|
+
├── quantjourney_bidask/ # Main library code
|
192
|
+
│ ├── __init__.py
|
193
|
+
│ ├── edge.py # Core EDGE estimator
|
194
|
+
│ ├── edge_rolling.py # Rolling window estimation
|
195
|
+
│ └── edge_expanding.py # Expanding window estimation
|
196
|
+
├── data/
|
197
|
+
│ └── fetch.py # Simplified data fetcher for examples
|
198
|
+
├── examples/ # Comprehensive usage examples
|
199
|
+
│ ├── simple_data_example.py # Basic usage demonstration
|
200
|
+
│ ├── spread_estimator.py # Spread estimation examples
|
201
|
+
│ ├── animated_spread_monitor.py # Animated visualizations
|
202
|
+
│ ├── crypto_spread_comparison.py # Crypto spread analysis
|
203
|
+
│ ├── liquidity_risk_monitor.py # Risk monitoring
|
204
|
+
│ ├── realtime_spread_monitor.py # Live monitoring dashboard
|
205
|
+
│ └── stock_liquidity_risk.py # Stock liquidity analysis
|
206
|
+
├── tests/ # Unit tests (GitHub only)
|
207
|
+
│ ├── test_edge.py
|
208
|
+
│ ├── test_edge_rolling.py
|
209
|
+
│ └── test_data_fetcher.py
|
210
|
+
└── _output/ # Example output images
|
211
|
+
├── simple_data_example.png
|
212
|
+
├── crypto_spread_comparison.png
|
213
|
+
└── spread_estimator_results.png
|
214
|
+
```
|
215
|
+
|
216
|
+
## Examples and Visualizations
|
217
|
+
|
218
|
+
The package includes comprehensive examples with beautiful visualizations:
|
219
|
+
|
220
|
+
### Basic Data Analysis
|
221
|
+

|
191
222
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
223
|
+
### Crypto Spread Comparison
|
224
|
+

|
225
|
+
|
226
|
+
### Spread Estimation Results
|
227
|
+

|
228
|
+
|
229
|
+
### Running Examples
|
230
|
+
|
231
|
+
After installing via pip, examples are included in the package:
|
232
|
+
|
233
|
+
```python
|
234
|
+
import quantjourney_bidask
|
235
|
+
from pathlib import Path
|
198
236
|
|
199
|
-
|
237
|
+
# Find package location
|
238
|
+
pkg_path = Path(quantjourney_bidask.__file__).parent
|
239
|
+
examples_path = pkg_path.parent / 'examples'
|
240
|
+
print(f"Examples located at: {examples_path}")
|
241
|
+
|
242
|
+
# List available examples
|
243
|
+
for example in examples_path.glob('*.py'):
|
244
|
+
print(f"📄 {example.name}")
|
245
|
+
```
|
246
|
+
|
247
|
+
Or clone the repository for full access to examples and tests:
|
200
248
|
|
201
249
|
```bash
|
250
|
+
git clone https://github.com/QuantJourneyOrg/qj_bidask
|
251
|
+
cd qj_bidask
|
252
|
+
python examples/simple_data_example.py
|
202
253
|
python examples/spread_estimator.py
|
203
|
-
python examples/
|
254
|
+
python examples/crypto_spread_comparison.py
|
204
255
|
```
|
205
256
|
|
257
|
+
### Available Examples
|
258
|
+
|
259
|
+
- **`simple_data_example.py`** - Basic usage with stock and crypto data
|
260
|
+
- **`spread_estimator.py`** - Core spread estimation functionality
|
261
|
+
- **`animated_spread_monitor.py`** - Real-time animated visualizations
|
262
|
+
- **`crypto_spread_comparison.py`** - Multi-asset crypto analysis
|
263
|
+
- **`liquidity_risk_monitor.py`** - Risk monitoring and alerts
|
264
|
+
- **`realtime_spread_monitor.py`** - Live websocket monitoring dashboard
|
265
|
+
- **`stock_liquidity_risk.py`** - Stock-specific liquidity analysis
|
266
|
+
|
267
|
+
## Testing and Development
|
268
|
+
|
269
|
+
### Unit Tests
|
270
|
+
The package includes comprehensive unit tests (available in the GitHub repository):
|
271
|
+
|
272
|
+
- **`test_edge.py`** - Core EDGE estimator tests with known values from the academic paper
|
273
|
+
- **`test_edge_rolling.py`** - Rolling window estimation tests
|
274
|
+
- **`test_edge_expanding.py`** - Expanding window estimation tests
|
275
|
+
- **`test_data_fetcher.py`** - Data fetching functionality tests
|
276
|
+
- **`test_estimators.py`** - Integration tests for all estimators
|
277
|
+
|
278
|
+
Tests verify accuracy against the original paper's test cases and handle edge cases like missing data, non-positive prices, and various market conditions.
|
279
|
+
|
280
|
+
### Development and Testing
|
281
|
+
For full development access including tests:
|
282
|
+
|
283
|
+
```bash
|
284
|
+
# Clone the repository
|
285
|
+
git clone https://github.com/QuantJourneyOrg/qj_bidask
|
286
|
+
cd qj_bidask
|
287
|
+
|
288
|
+
# Install in development mode
|
289
|
+
pip install -e .
|
290
|
+
|
291
|
+
# Run tests
|
292
|
+
python -m pytest tests/ -v
|
293
|
+
|
294
|
+
# Run specific test files
|
295
|
+
python -m pytest tests/test_edge.py -v
|
296
|
+
python -m pytest tests/test_data_fetcher.py -v
|
297
|
+
|
298
|
+
# Run examples
|
299
|
+
python examples/simple_data_example.py
|
300
|
+
python examples/spread_estimator.py
|
301
|
+
```
|
302
|
+
|
303
|
+
### Package vs Repository
|
304
|
+
- **PyPI Package** (`pip install quantjourney-bidask`): Includes core library, examples, and documentation
|
305
|
+
- **GitHub Repository**: Full development environment with tests, development tools, and additional documentation
|
306
|
+
|
206
307
|
## API Reference
|
207
308
|
|
208
309
|
### Core Functions
|
@@ -213,11 +314,13 @@ python examples/realtime_spread_monitor.py
|
|
213
314
|
|
214
315
|
### Data Fetching (`data/fetch.py`)
|
215
316
|
|
216
|
-
- `
|
217
|
-
- `
|
218
|
-
- `
|
219
|
-
- `
|
220
|
-
- `
|
317
|
+
- `DataFetcher()`: Main data fetcher class
|
318
|
+
- `get_stock_data(ticker, period, interval)`: Fetch stock data from Yahoo Finance
|
319
|
+
- `get_crypto_data(symbol, exchange, timeframe, limit)`: Fetch crypto data via CCXT (async)
|
320
|
+
- `stream_btc_data(duration_seconds)`: Stream BTC data via websocket (async)
|
321
|
+
- `DataFetcher.get_btc_1m_websocket()`: Stream BTC 1-minute data
|
322
|
+
- `DataFetcher.get_historical_crypto_data()`: Get historical crypto OHLCV data
|
323
|
+
- `DataFetcher.save_data()` / `DataFetcher.load_data()`: Save/load data to CSV
|
221
324
|
|
222
325
|
### Real-Time Classes
|
223
326
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
quantjourney_bidask/__init__.py,sha256=vumoRDEDOTclYapknfSwKpCZi9IdfJbukdp7S1-kphA,409
|
2
|
-
quantjourney_bidask/_version.py,sha256=
|
2
|
+
quantjourney_bidask/_version.py,sha256=PNfYxivWH2RCzGECwhMnGzRhNhiDg7KULZppaKoLiAI,220
|
3
3
|
quantjourney_bidask/data_fetcher.py,sha256=GMVf4wRVwIE2JJ2sYAR_CCo56JQnReNhTWTSrZc0-L0,4931
|
4
4
|
quantjourney_bidask/edge.py,sha256=z-uRUH3Rot6Zw-dPa2pNlQu0hY1YJu6d0c18IyqbiNs,6105
|
5
5
|
quantjourney_bidask/edge_expanding.py,sha256=bN6lBetJdqC2xSdRc1RTjHfSI1XXVKegl0GQaD8eanY,2047
|
6
6
|
quantjourney_bidask/edge_rolling.py,sha256=CAZW_wBF7G6mGLenoEwlq4yB_1x1-PsQ4TgwL-zdM7w,8910
|
7
7
|
quantjourney_bidask/websocket_fetcher.py,sha256=xMS_qLbSW9hCS3RbNKvkn5HTK0XGmAO4wpaAl4_Mxb4,10895
|
8
|
-
quantjourney_bidask-0.
|
9
|
-
quantjourney_bidask-0.
|
10
|
-
quantjourney_bidask-0.
|
11
|
-
quantjourney_bidask-0.
|
12
|
-
quantjourney_bidask-0.
|
8
|
+
quantjourney_bidask-0.9.0.dist-info/licenses/LICENSE,sha256=m8MEOGnpSBtS6m9z4M9m1JksWWPzu1OK3UgY1wuHf04,1081
|
9
|
+
quantjourney_bidask-0.9.0.dist-info/METADATA,sha256=BIMxqvn5Nijih6S43QCAo6RM_Ik1Df5NRV1X8Q-VkWg,13313
|
10
|
+
quantjourney_bidask-0.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
quantjourney_bidask-0.9.0.dist-info/top_level.txt,sha256=rOBM4GxA87iQv-mR8-WZdu3-Yj5ESyggRICpUhJ-4Dg,20
|
12
|
+
quantjourney_bidask-0.9.0.dist-info/RECORD,,
|
{quantjourney_bidask-0.6.0.dist-info → quantjourney_bidask-0.9.0.dist-info}/licenses/LICENSE
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2025 Jakub Polec, QuantJourney
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
File without changes
|
File without changes
|