Local changes: Updated model training, removed debug instrumentation, and configuration improvements

This commit is contained in:
kfox
2025-12-26 01:15:43 -05:00
commit cc60da49e7
388 changed files with 57127 additions and 0 deletions

158
test_output.txt Normal file
View File

@@ -0,0 +1,158 @@
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0 -- /var/home/kfox/AI Coding/crypto_trader/venv/bin/python3
cachedir: .pytest_cache
rootdir: /var/home/kfox/AI Coding/crypto_trader
configfile: pytest.ini
plugins: anyio-4.12.0, asyncio-1.3.0, cov-7.0.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... 2025-12-22 01:43:22 [INFO] src.exchanges.factory: Registered exchange adapter: coinbase
2025-12-22 01:43:22 [INFO] src.exchanges.factory: Registered exchange adapter: binance public
2025-12-22 01:43:22 [INFO] src.exchanges.factory: Registered exchange adapter: public data
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: rsi
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: macd
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: moving_average
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: confirmed
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: divergence
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: bollinger_mean_reversion
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: dca
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: grid
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: momentum
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: consensus
2025-12-22 01:43:22 [INFO] src.strategies.base: Registered strategy: pairs_trading
collected 2 items
tests/unit/strategies/test_pairs_trading.py::test_pairs_trading_short_spread_signal 2025-12-22 01:43:22 [INFO] strategy.test_pairs: Pairs SOL/USD/AVAX/USD: Spread=4.8000, Z-Score=1.79
FAILED
tests/unit/strategies/test_pairs_trading.py::test_pairs_trading_long_spread_signal 2025-12-22 01:43:22 [INFO] strategy.test_pairs: Pairs SOL/USD/AVAX/USD: Spread=3.2000, Z-Score=-1.79
FAILED/var/home/kfox/AI Coding/crypto_trader/venv/lib/python3.12/site-packages/coverage/report_core.py:107: CoverageWarning: Couldn't parse Python file '/var/home/kfox/AI Coding/crypto_trader/src/rebalancing/engine.py' (couldnt-parse); see https://coverage.readthedocs.io/en/7.13.0/messages.html#warning-couldnt-parse
coverage._warn(msg, slug="couldnt-parse")
ERROR: Coverage failure: total of 21.09 is less than fail-under=95.00
=================================== FAILURES ===================================
____________________ test_pairs_trading_short_spread_signal ____________________
tests/unit/strategies/test_pairs_trading.py:62: in test_pairs_trading_short_spread_signal
assert signal is not None
E assert None is not None
------------------------------ Captured log call -------------------------------
INFO strategy.test_pairs:pairs_trading.py:92 Pairs SOL/USD/AVAX/USD: Spread=4.8000, Z-Score=1.79
____________________ test_pairs_trading_long_spread_signal _____________________
tests/unit/strategies/test_pairs_trading.py:86: in test_pairs_trading_long_spread_signal
assert signal is not None
E assert None is not None
------------------------------ Captured log call -------------------------------
INFO strategy.test_pairs:pairs_trading.py:92 Pairs SOL/USD/AVAX/USD: Spread=3.2000, Z-Score=-1.79
=============================== warnings summary ===============================
src/core/database.py:16
/var/home/kfox/AI Coding/crypto_trader/src/core/database.py:16: MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
Base = declarative_base()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.12.3-final-0 ________________
Name Stmts Miss Cover Missing
-------------------------------------------------------------------------------------
src/__init__.py 0 0 100.00%
src/alerts/__init__.py 0 0 100.00%
src/alerts/channels.py 10 10 0.00% 3-25
src/alerts/engine.py 71 71 0.00% 3-138
src/alerts/manager.py 35 35 0.00% 3-82
src/autopilot/__init__.py 8 1 87.50% 48
src/autopilot/intelligent_autopilot.py 246 211 14.23% 43-93, 97-134, 138-154, 162-163, 167-188, 193-266, 291-317, 336-346, 367-397, 425-446, 461-543, 558-580, 584-587, 591-592, 605, 640-650, 655-658
src/autopilot/market_analyzer.py 267 233 12.73% 42, 56-57, 75-91, 108-361, 372-402, 418-472, 482-484
src/autopilot/models.py 221 187 15.38% 35-37, 42-44, 55-71, 79-136, 158-290, 312-343, 357-396, 404-419, 430-450, 461-482, 490-496, 512-515
src/autopilot/performance_tracker.py 114 96 15.79% 22-23, 41-84, 102-164, 180-232, 246-289, 299-301
src/autopilot/strategy_selector.py 184 163 11.41% 20-38, 42-49, 53-54, 71-101, 118-144, 158-205, 219-233, 246-247, 268-415, 427-446, 456-458
src/backtesting/__init__.py 0 0 100.00%
src/backtesting/data_provider.py 15 15 0.00% 3-50
src/backtesting/engine.py 76 76 0.00% 3-206
src/backtesting/metrics.py 21 21 0.00% 3-84
src/backtesting/slippage.py 53 53 0.00% 3-174
src/core/__init__.py 0 0 100.00%
src/core/config.py 86 18 79.07% 32, 36, 150-151, 155, 157, 161, 179-181, 191-197, 201-202
src/core/database.py 270 10 96.30% 370, 374, 377, 381-382, 386, 390, 400-402
src/core/logger.py 58 11 81.03% 73-78, 99-102, 127
src/core/repositories.py 44 26 40.91% 15, 22-25, 29-32, 36-39, 49-61, 65-71, 75-79, 86-89, 93-99
src/data/__init__.py 6 0 100.00%
src/data/cache_manager.py 87 66 24.14% 22-26, 34, 38-39, 47, 71-82, 94-112, 130-148, 159-162, 166-167, 171-176, 180-183, 191-200, 216-221
src/data/collector.py 53 37 30.19% 20-24, 39-57, 74-106, 126, 136-138
src/data/health_monitor.py 135 94 30.37% 42-49, 53-72, 80-82, 93-104, 108, 141-146, 155-159, 167-171, 183-209, 220-223, 234, 242, 256-291, 299-303, 311-317
src/data/indicators.py 251 217 13.55% 11-15, 20-21, 33, 39-41, 45-47, 51-55, 59-62, 66-71, 77-86, 96-118, 133-153, 163-174, 184-194, 205-224, 238-251, 262-267, 277-295, 305-311, 325-340, 356-375, 406-487, 510-556, 566-568
src/data/news_collector.py 176 136 22.73% 106-124, 137-146, 157-204, 215-266, 282-316, 320-353, 373-383, 394-403, 411, 425-427, 444-447
src/data/pricing_service.py 180 153 15.00% 29-51, 56-102, 111-129, 140-147, 164-211, 223-244, 266-290, 302-329, 338-357, 365, 376-382, 390, 404-406
src/data/providers/__init__.py 4 0 100.00%
src/data/providers/base_provider.py 26 14 46.15% 22-24, 113-121, 133, 141, 150
src/data/providers/ccxt_provider.py 165 146 11.52% 30-41, 77-131, 136-150, 154-174, 184-207, 214-272, 276-289, 293-321, 325-333
src/data/providers/coingecko_provider.py 165 143 13.33% 58-63, 81-107, 112-129, 140-155, 159-228, 242-302, 306-354, 358-371, 376
src/data/quality.py 39 26 33.33% 18-20, 42-68, 80-82, 93-95, 103-115
src/data/storage.py 23 13 43.48% 18-19, 46-74
src/exchanges/__init__.py 8 0 100.00%
src/exchanges/base.py 57 43 24.56% 24-29, 44-49, 230-246, 258, 267, 284-308
src/exchanges/coinbase.py 190 160 15.79% 26-43, 47-62, 67-79, 83-99, 103-117, 121-129, 133-170, 174-179, 183-204, 208-229, 233-251, 261-273, 277-298, 302-312, 316-326, 330-338, 343, 349, 365-391
src/exchanges/factory.py 10 1 90.00% 164
src/exchanges/public_data.py 202 176 12.87% 49-64, 75-125, 129-138, 146-147, 151-165, 169-177, 185-186, 193-194, 201-202, 209-210, 217-218, 232-252, 259-291, 295-320, 324-355, 365-403, 408-420, 428-433
src/optimization/__init__.py 0 0 100.00%
src/optimization/bayesian.py 32 32 0.00% 3-75
src/optimization/genetic.py 52 52 0.00% 3-110
src/optimization/grid_search.py 23 23 0.00% 3-53
src/portfolio/__init__.py 0 0 100.00%
src/portfolio/analytics.py 89 89 0.00% 3-264
src/portfolio/tracker.py 58 58 0.00% 3-143
src/rebalancing/__init__.py 0 0 100.00%
src/rebalancing/strategies.py 13 13 0.00% 3-35
src/reporting/__init__.py 0 0 100.00%
src/reporting/csv_exporter.py 52 52 0.00% 3-119
src/reporting/pdf_generator.py 38 38 0.00% 3-110
src/reporting/tax_reporter.py 47 47 0.00% 3-126
src/resilience/__init__.py 0 0 100.00%
src/resilience/health_monitor.py 39 39 0.00% 3-99
src/resilience/recovery.py 49 49 0.00% 3-102
src/resilience/state_manager.py 47 47 0.00% 3-89
src/risk/__init__.py 0 0 100.00%
src/risk/limits.py 95 78 17.89% 19-21, 25-41, 45-55, 60-72, 76-104, 108-135, 139-153, 161
src/risk/manager.py 38 20 47.37% 22-27, 40-57, 64, 73, 88-90
src/risk/position_sizing.py 42 31 26.19% 17-18, 40-65, 83-88, 110-143
src/risk/stop_loss.py 100 88 12.00% 17-19, 44-86, 106-165, 187-218, 226-228
src/security/__init__.py 0 0 100.00%
src/security/audit.py 35 35 0.00% 3-93
src/security/encryption.py 58 42 27.59% 20-22, 27-62, 73-76, 87-95, 105-107
src/security/key_manager.py 96 80 16.67% 17-18, 29-62, 66-81, 98-121, 125-137, 141-144, 148-160, 170-172
src/strategies/__init__.py 25 0 100.00%
src/strategies/base.py 147 97 34.01% 45-51, 123-145, 156-164, 185-228, 253-315, 323, 331, 339, 352-354, 374, 397-408, 419, 427, 435-437
src/strategies/dca/__init__.py 0 0 100.00%
src/strategies/dca/dca_strategy.py 38 26 31.58% 23-30, 34-41, 45-58, 73, 85-90
src/strategies/ensemble/__init__.py 2 0 100.00%
src/strategies/ensemble/consensus_strategy.py 111 96 13.51% 35-53, 57-83, 87-107, 127-142, 156-206, 226-239, 243
src/strategies/grid/__init__.py 0 0 100.00%
src/strategies/grid/grid_strategy.py 44 34 22.73% 23-32, 36-54, 58-98, 102-109
src/strategies/momentum/__init__.py 0 0 100.00%
src/strategies/momentum/momentum_strategy.py 59 46 22.03% 25-35, 46-56, 67-74, 79-130, 134-138
src/strategies/scheduler.py 130 130 0.00% 3-297
src/strategies/technical/__init__.py 0 0 100.00%
src/strategies/technical/bollinger_mean_reversion.py 92 79 14.13% 37-49, 60-75, 89-104, 109-218, 222-226
src/strategies/technical/confirmed_strategy.py 111 97 12.61% 42-66, 77-91, 102-122, 133-158, 163-224, 245
src/strategies/technical/divergence_strategy.py 62 50 19.35% 40-53, 64-75, 80-133, 153
src/strategies/technical/macd_strategy.py 32 23 28.12% 20-25, 32-67, 71
src/strategies/technical/moving_avg_strategy.py 36 27 25.00% 20-25, 32-74, 78
src/strategies/technical/pairs_trading.py 61 17 72.13% 35, 40, 63, 88, 108-110, 114-116, 122-141, 147
src/strategies/technical/rsi_strategy.py 29 20 31.03% 20-25, 31-62, 66
src/strategies/timeframe_manager.py 39 39 0.00% 3-102
src/trading/__init__.py 0 0 100.00%
src/trading/advanced_orders.py 142 142 0.00% 3-408
src/trading/engine.py 119 99 16.81% 23-28, 39-49, 63-173, 177-212, 216-223, 243-245
src/trading/fee_calculator.py 81 61 24.69% 18-19, 41-61, 80-83, 103-104, 122-126, 139, 154-176, 191-202, 222-243, 259-261, 275-277
src/trading/futures.py 30 30 0.00% 3-121
src/trading/order_manager.py 81 60 25.93% 94, 126-152, 176-200, 211-214, 232-249, 260, 280-292, 302-304
src/trading/paper_trading.py 162 138 14.81% 25-33, 38, 42-67, 78, 86-90, 103-222, 230-250, 258-272, 280, 288-298, 316-364, 374-376
src/utils/__init__.py 0 0 100.00%
-------------------------------------------------------------------------------------
TOTAL 6192 4886 21.09%
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml
FAIL Required test coverage of 95% not reached. Total coverage: 21.09%
=========================== short test summary info ============================
FAILED tests/unit/strategies/test_pairs_trading.py::test_pairs_trading_short_spread_signal
FAILED tests/unit/strategies/test_pairs_trading.py::test_pairs_trading_long_spread_signal
========================= 2 failed, 1 warning in 4.81s =========================