quantjourney-bidask 0.6.0__tar.gz → 0.9.1__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.
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/CHANGELOG.md +1 -1
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/LICENSE +1 -1
- quantjourney_bidask-0.9.1/MANIFEST.in +19 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/PKG-INFO +121 -18
- quantjourney_bidask-0.6.0/quantjourney_bidask.egg-info/PKG-INFO → quantjourney_bidask-0.9.1/README.md +120 -58
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/data/fetch.py +2 -2
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/pyproject.toml +5 -5
- quantjourney_bidask-0.9.1/quantjourney_bidask/_version.py +7 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask.egg-info/SOURCES.txt +1 -13
- quantjourney_bidask-0.6.0/.gitignore +0 -233
- quantjourney_bidask-0.6.0/MANIFEST.in +0 -10
- quantjourney_bidask-0.6.0/README.md +0 -251
- quantjourney_bidask-0.6.0/__init__.py +0 -14
- quantjourney_bidask-0.6.0/quantjourney_bidask/_version.py +0 -7
- quantjourney_bidask-0.6.0/quantjourney_bidask.egg-info/dependency_links.txt +0 -1
- quantjourney_bidask-0.6.0/quantjourney_bidask.egg-info/requires.txt +0 -21
- quantjourney_bidask-0.6.0/quantjourney_bidask.egg-info/top_level.txt +0 -1
- quantjourney_bidask-0.6.0/tests/test_data_fetcher.py +0 -106
- quantjourney_bidask-0.6.0/tests/test_edge.py +0 -49
- quantjourney_bidask-0.6.0/tests/test_edge_expanding.py +0 -39
- quantjourney_bidask-0.6.0/tests/test_edge_rolling.py +0 -41
- quantjourney_bidask-0.6.0/tests/test_estimators.py +0 -78
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/docs/usage_examples.ipynb +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/animated_spread_monitor.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/crypto_spread_comparison.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/ff.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/liquidity_risk_monitor.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/realtime_spread_monitor.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/simple_data_example.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/spread_estimator.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/spread_monitor.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/stock_liquidity_risk.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/examples/visualization.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/__init__.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/data_fetcher.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/edge.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/edge_expanding.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/edge_rolling.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask/websocket_fetcher.py +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/requirements.txt +0 -0
- {quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/setup.cfg +0 -0
@@ -5,7 +5,7 @@ All notable changes to the quantjourney-bidask project will be documented in thi
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
## [0.
|
8
|
+
## [0.9.0] - 2024-06-24
|
9
9
|
|
10
10
|
### Added
|
11
11
|
- Initial release of quantjourney-bidask package
|
@@ -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
|
@@ -0,0 +1,19 @@
|
|
1
|
+
include LICENSE
|
2
|
+
include README.md
|
3
|
+
include pyproject.toml
|
4
|
+
include CHANGELOG.md
|
5
|
+
include requirements.txt
|
6
|
+
|
7
|
+
# Documentation and examples for users
|
8
|
+
include docs/usage_examples.ipynb
|
9
|
+
include examples/*.py
|
10
|
+
include data/*.py
|
11
|
+
|
12
|
+
# Main package code
|
13
|
+
recursive-include quantjourney_bidask *.py
|
14
|
+
|
15
|
+
# Exclude development-only files
|
16
|
+
exclude tests/*.py
|
17
|
+
exclude *.egg-info/*
|
18
|
+
exclude build/*
|
19
|
+
exclude dist/*
|
@@ -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.1
|
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,45 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: quantjourney-bidask
|
3
|
-
Version: 0.6.0
|
4
|
-
Summary: Efficient bid-ask spread estimator from OHLC prices with simplified data fetching for stocks and crypto
|
5
|
-
Author-email: Jakub Polec <jakub@quantjourney.pro>
|
6
|
-
License-Expression: 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
|
10
|
-
Keywords: finance,bid-ask,spread,trading,quantitative,OHLC
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
12
|
-
Classifier: Intended Audience :: Financial and Insurance Industry
|
13
|
-
Classifier: Operating System :: OS Independent
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
16
|
-
Classifier: Programming Language :: Python :: 3.12
|
17
|
-
Classifier: Topic :: Office/Business :: Financial :: Investment
|
18
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
19
|
-
Requires-Python: <3.15,>=3.11
|
20
|
-
Description-Content-Type: text/markdown
|
21
|
-
License-File: LICENSE
|
22
|
-
Requires-Dist: numpy>=1.20
|
23
|
-
Requires-Dist: pandas>=1.5
|
24
|
-
Requires-Dist: requests>=2.28
|
25
|
-
Requires-Dist: yfinance>=0.2
|
26
|
-
Requires-Dist: matplotlib>=3.5
|
27
|
-
Requires-Dist: plotly>=5.0
|
28
|
-
Requires-Dist: websocket-client>=1.0
|
29
|
-
Requires-Dist: ccxt>=4.0
|
30
|
-
Provides-Extra: dev
|
31
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
32
|
-
Requires-Dist: pytest-mock>=3.10; extra == "dev"
|
33
|
-
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
34
|
-
Requires-Dist: ruff>=0.1; extra == "dev"
|
35
|
-
Requires-Dist: mypy>=1.0; extra == "dev"
|
36
|
-
Requires-Dist: black>=22.0; extra == "dev"
|
37
|
-
Requires-Dist: isort>=5.0; extra == "dev"
|
38
|
-
Provides-Extra: examples
|
39
|
-
Requires-Dist: jupyter>=1.0; extra == "examples"
|
40
|
-
Requires-Dist: ipywidgets>=7.0; extra == "examples"
|
41
|
-
Dynamic: license-file
|
42
|
-
|
43
1
|
# QuantJourney Bid-Ask Spread Estimator
|
44
2
|
|
45
3
|

|
@@ -185,24 +143,126 @@ python examples/realtime_spread_monitor.py --mode dashboard
|
|
185
143
|
python examples/realtime_spread_monitor.py --mode console
|
186
144
|
```
|
187
145
|
|
188
|
-
##
|
146
|
+
## Project Structure
|
147
|
+
|
148
|
+
```
|
149
|
+
quantjourney_bidask/
|
150
|
+
├── quantjourney_bidask/ # Main library code
|
151
|
+
│ ├── __init__.py
|
152
|
+
│ ├── edge.py # Core EDGE estimator
|
153
|
+
│ ├── edge_rolling.py # Rolling window estimation
|
154
|
+
│ └── edge_expanding.py # Expanding window estimation
|
155
|
+
├── data/
|
156
|
+
│ └── fetch.py # Simplified data fetcher for examples
|
157
|
+
├── examples/ # Comprehensive usage examples
|
158
|
+
│ ├── simple_data_example.py # Basic usage demonstration
|
159
|
+
│ ├── spread_estimator.py # Spread estimation examples
|
160
|
+
│ ├── animated_spread_monitor.py # Animated visualizations
|
161
|
+
│ ├── crypto_spread_comparison.py # Crypto spread analysis
|
162
|
+
│ ├── liquidity_risk_monitor.py # Risk monitoring
|
163
|
+
│ ├── realtime_spread_monitor.py # Live monitoring dashboard
|
164
|
+
│ └── stock_liquidity_risk.py # Stock liquidity analysis
|
165
|
+
├── tests/ # Unit tests (GitHub only)
|
166
|
+
│ ├── test_edge.py
|
167
|
+
│ ├── test_edge_rolling.py
|
168
|
+
│ └── test_data_fetcher.py
|
169
|
+
└── _output/ # Example output images
|
170
|
+
├── simple_data_example.png
|
171
|
+
├── crypto_spread_comparison.png
|
172
|
+
└── spread_estimator_results.png
|
173
|
+
```
|
174
|
+
|
175
|
+
## Examples and Visualizations
|
189
176
|
|
190
|
-
The
|
177
|
+
The package includes comprehensive examples with beautiful visualizations:
|
191
178
|
|
192
|
-
|
193
|
-
|
194
|
-
- `realtime_spread_monitor.py` - Live websocket monitoring with animation
|
195
|
-
- `crypto_spread_comparison.py` - Multi-asset spread comparison
|
196
|
-
- `liquidity_risk_monitor.py` - Liquidity risk monitoring
|
197
|
-
- `stock_liquidity_risk.py` - Stock-specific liquidity analysis
|
179
|
+
### Basic Data Analysis
|
180
|
+

|
198
181
|
|
199
|
-
|
182
|
+
### Crypto Spread Comparison
|
183
|
+

|
184
|
+
|
185
|
+
### Spread Estimation Results
|
186
|
+

|
187
|
+
|
188
|
+
### Running Examples
|
189
|
+
|
190
|
+
After installing via pip, examples are included in the package:
|
191
|
+
|
192
|
+
```python
|
193
|
+
import quantjourney_bidask
|
194
|
+
from pathlib import Path
|
195
|
+
|
196
|
+
# Find package location
|
197
|
+
pkg_path = Path(quantjourney_bidask.__file__).parent
|
198
|
+
examples_path = pkg_path.parent / 'examples'
|
199
|
+
print(f"Examples located at: {examples_path}")
|
200
|
+
|
201
|
+
# List available examples
|
202
|
+
for example in examples_path.glob('*.py'):
|
203
|
+
print(f"📄 {example.name}")
|
204
|
+
```
|
205
|
+
|
206
|
+
Or clone the repository for full access to examples and tests:
|
200
207
|
|
201
208
|
```bash
|
209
|
+
git clone https://github.com/QuantJourneyOrg/qj_bidask
|
210
|
+
cd qj_bidask
|
211
|
+
python examples/simple_data_example.py
|
212
|
+
python examples/spread_estimator.py
|
213
|
+
python examples/crypto_spread_comparison.py
|
214
|
+
```
|
215
|
+
|
216
|
+
### Available Examples
|
217
|
+
|
218
|
+
- **`simple_data_example.py`** - Basic usage with stock and crypto data
|
219
|
+
- **`spread_estimator.py`** - Core spread estimation functionality
|
220
|
+
- **`animated_spread_monitor.py`** - Real-time animated visualizations
|
221
|
+
- **`crypto_spread_comparison.py`** - Multi-asset crypto analysis
|
222
|
+
- **`liquidity_risk_monitor.py`** - Risk monitoring and alerts
|
223
|
+
- **`realtime_spread_monitor.py`** - Live websocket monitoring dashboard
|
224
|
+
- **`stock_liquidity_risk.py`** - Stock-specific liquidity analysis
|
225
|
+
|
226
|
+
## Testing and Development
|
227
|
+
|
228
|
+
### Unit Tests
|
229
|
+
The package includes comprehensive unit tests (available in the GitHub repository):
|
230
|
+
|
231
|
+
- **`test_edge.py`** - Core EDGE estimator tests with known values from the academic paper
|
232
|
+
- **`test_edge_rolling.py`** - Rolling window estimation tests
|
233
|
+
- **`test_edge_expanding.py`** - Expanding window estimation tests
|
234
|
+
- **`test_data_fetcher.py`** - Data fetching functionality tests
|
235
|
+
- **`test_estimators.py`** - Integration tests for all estimators
|
236
|
+
|
237
|
+
Tests verify accuracy against the original paper's test cases and handle edge cases like missing data, non-positive prices, and various market conditions.
|
238
|
+
|
239
|
+
### Development and Testing
|
240
|
+
For full development access including tests:
|
241
|
+
|
242
|
+
```bash
|
243
|
+
# Clone the repository
|
244
|
+
git clone https://github.com/QuantJourneyOrg/qj_bidask
|
245
|
+
cd qj_bidask
|
246
|
+
|
247
|
+
# Install in development mode
|
248
|
+
pip install -e .
|
249
|
+
|
250
|
+
# Run tests
|
251
|
+
python -m pytest tests/ -v
|
252
|
+
|
253
|
+
# Run specific test files
|
254
|
+
python -m pytest tests/test_edge.py -v
|
255
|
+
python -m pytest tests/test_data_fetcher.py -v
|
256
|
+
|
257
|
+
# Run examples
|
258
|
+
python examples/simple_data_example.py
|
202
259
|
python examples/spread_estimator.py
|
203
|
-
python examples/realtime_spread_monitor.py
|
204
260
|
```
|
205
261
|
|
262
|
+
### Package vs Repository
|
263
|
+
- **PyPI Package** (`pip install quantjourney-bidask`): Includes core library, examples, and documentation
|
264
|
+
- **GitHub Repository**: Full development environment with tests, development tools, and additional documentation
|
265
|
+
|
206
266
|
## API Reference
|
207
267
|
|
208
268
|
### Core Functions
|
@@ -213,11 +273,13 @@ python examples/realtime_spread_monitor.py
|
|
213
273
|
|
214
274
|
### Data Fetching (`data/fetch.py`)
|
215
275
|
|
216
|
-
- `
|
217
|
-
- `
|
218
|
-
- `
|
219
|
-
- `
|
220
|
-
- `
|
276
|
+
- `DataFetcher()`: Main data fetcher class
|
277
|
+
- `get_stock_data(ticker, period, interval)`: Fetch stock data from Yahoo Finance
|
278
|
+
- `get_crypto_data(symbol, exchange, timeframe, limit)`: Fetch crypto data via CCXT (async)
|
279
|
+
- `stream_btc_data(duration_seconds)`: Stream BTC data via websocket (async)
|
280
|
+
- `DataFetcher.get_btc_1m_websocket()`: Stream BTC 1-minute data
|
281
|
+
- `DataFetcher.get_historical_crypto_data()`: Get historical crypto OHLCV data
|
282
|
+
- `DataFetcher.save_data()` / `DataFetcher.load_data()`: Save/load data to CSV
|
221
283
|
|
222
284
|
### Real-Time Classes
|
223
285
|
|
@@ -290,4 +352,4 @@ python examples/realtime_spread_monitor.py
|
|
290
352
|
|
291
353
|
- **Documentation**: [GitHub Repository](https://github.com/QuantJourneyOrg/qj_bidask)
|
292
354
|
- **Issues**: [Bug Tracker](https://github.com/QuantJourneyOrg/qj_bidask/issues)
|
293
|
-
- **Contact**: jakub@quantjourney.pro
|
355
|
+
- **Contact**: jakub@quantjourney.pro
|
@@ -222,10 +222,10 @@ async def get_crypto_data(symbol: str = "BTC/USDT", exchange: str = "binance", t
|
|
222
222
|
fetcher = DataFetcher()
|
223
223
|
return await fetcher.get_historical_crypto_data(symbol, exchange, timeframe, limit)
|
224
224
|
|
225
|
-
def get_stock_data(ticker: str, period: str = "1mo"):
|
225
|
+
def get_stock_data(ticker: str, period: str = "1mo", interval: str = "1d"):
|
226
226
|
"""Quick function to get stock data."""
|
227
227
|
fetcher = DataFetcher()
|
228
|
-
return fetcher.get_stock_data(ticker, period)
|
228
|
+
return fetcher.get_stock_data(ticker, period, interval)
|
229
229
|
|
230
230
|
async def stream_btc_data(duration_seconds: int = 60):
|
231
231
|
"""Quick function to stream BTC data."""
|
@@ -5,12 +5,13 @@ build-backend = "setuptools.build_meta"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "quantjourney-bidask"
|
8
|
-
version = "0.
|
8
|
+
version = "0.9.1"
|
9
9
|
license = "MIT"
|
10
|
+
|
10
11
|
authors = [
|
11
12
|
{ name = "Jakub Polec", email = "jakub@quantjourney.pro" },
|
12
13
|
]
|
13
|
-
description = "Efficient bid-ask spread estimator from OHLC prices
|
14
|
+
description = "Efficient bid-ask spread estimator from OHLC prices"
|
14
15
|
readme = "README.md"
|
15
16
|
requires-python = ">=3.11,<3.15"
|
16
17
|
keywords = ["finance", "bid-ask", "spread", "trading", "quantitative", "OHLC"]
|
@@ -31,8 +32,7 @@ dependencies = [
|
|
31
32
|
"yfinance>=0.2",
|
32
33
|
"matplotlib>=3.5",
|
33
34
|
"plotly>=5.0",
|
34
|
-
"websocket-client>=1.0"
|
35
|
-
"ccxt>=4.0"
|
35
|
+
"websocket-client>=1.0"
|
36
36
|
]
|
37
37
|
|
38
38
|
[project.optional-dependencies]
|
@@ -81,4 +81,4 @@ testpaths = ["tests"]
|
|
81
81
|
python_files = ["test_*.py"]
|
82
82
|
python_classes = ["Test*"]
|
83
83
|
# Corrected: Removed extraneous text that caused a TOML parsing error
|
84
|
-
python_functions = ["test_*"]
|
84
|
+
python_functions = ["test_*"]
|
{quantjourney_bidask-0.6.0 → quantjourney_bidask-0.9.1}/quantjourney_bidask.egg-info/SOURCES.txt
RENAMED
@@ -1,9 +1,7 @@
|
|
1
|
-
.gitignore
|
2
1
|
CHANGELOG.md
|
3
2
|
LICENSE
|
4
3
|
MANIFEST.in
|
5
4
|
README.md
|
6
|
-
__init__.py
|
7
5
|
pyproject.toml
|
8
6
|
requirements.txt
|
9
7
|
data/fetch.py
|
@@ -24,14 +22,4 @@ quantjourney_bidask/data_fetcher.py
|
|
24
22
|
quantjourney_bidask/edge.py
|
25
23
|
quantjourney_bidask/edge_expanding.py
|
26
24
|
quantjourney_bidask/edge_rolling.py
|
27
|
-
quantjourney_bidask/websocket_fetcher.py
|
28
|
-
quantjourney_bidask.egg-info/PKG-INFO
|
29
|
-
quantjourney_bidask.egg-info/SOURCES.txt
|
30
|
-
quantjourney_bidask.egg-info/dependency_links.txt
|
31
|
-
quantjourney_bidask.egg-info/requires.txt
|
32
|
-
quantjourney_bidask.egg-info/top_level.txt
|
33
|
-
tests/test_data_fetcher.py
|
34
|
-
tests/test_edge.py
|
35
|
-
tests/test_edge_expanding.py
|
36
|
-
tests/test_edge_rolling.py
|
37
|
-
tests/test_estimators.py
|
25
|
+
quantjourney_bidask/websocket_fetcher.py
|