Cryptocurrency trading platform with Blockly-based strategy builder
Go to file
rob b555f6e004 Fix high-severity issues identified by Codex
1. Paper equity calculation (High):
   - get_balance() now correctly includes position value (size * current_price)
   - Previously only added unrealized_pnl, missing position principal

2. Buy affordability checks (High):
   - place_order() now uses execution price including slippage for market orders
   - Uses limit price for limit orders instead of current price
   - Prevents orders that would drive cash negative

3. ExchangeInterface price stubs (High):
   - get_trade_executed_price() now handles order_price=0.0 (market orders)
   - Falls back to current price or entry price when order_price is zero

4. Determinism hash strengthening (Medium):
   - Hash now includes full trade sequence with individual trade details
   - Added test for different trade sequences with same totals

5. Live mode consistency (Medium):
   - Factory now falls back to paper trading with warning instead of raising
   - Consistent behavior between factory.py and Strategies.py

Added test: test_paper_broker_equity_calculation to verify fix #1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-28 17:23:58 -04:00
UML Updated project structure and staged modified files 2024-07-25 08:21:15 -03:00
__pycache__ Updated project structure and staged modified files 2024-07-25 08:21:15 -03:00
archived_code The test are running but not without errors. 2024-11-11 17:22:06 -04:00
config Moved .db and .yml files to appropriate directories 2024-07-25 08:46:12 -03:00
markdown The test seem to run without errors but are still process blocking. 2024-11-15 18:08:32 -04:00
src Fix high-severity issues identified by Codex 2026-02-28 17:23:58 -04:00
tests Fix high-severity issues identified by Codex 2026-02-28 17:23:58 -04:00
.claudeignore Fix chart loading and stabilize local runtime 2026-02-28 15:15:56 -04:00
.gitignore Fix chart loading and stabilize local runtime 2026-02-28 15:15:56 -04:00
BrighterTrading.db Fixed issue with fetching historical data and added missing imports. 2024-07-26 03:52:24 -03:00
CLAUDE.md Phase 0: Stabilize baseline 2026-02-28 16:44:11 -04:00
pytest.ini Phase 0: Stabilize baseline 2026-02-28 16:44:11 -04:00
requirements.txt Python generators is fully implemented but not tested yet. 2024-11-07 10:43:51 -04:00