Cryptocurrency trading platform with Blockly-based strategy builder
Go to file
rob d3bbb36dc2 Fix live trade P/L bugs, improve UI refresh, add balance toggle
Key fixes:
- Add price validation to detect/correct doubled filled_price from broker
- Emit position_closed socket event to refresh UI after closing positions
- Fix statistics not updating when positions are closed
- Filter out zero-size positions from display
- Add USD/USDT toggle for balance display (click to switch)

Trade system improvements:
- Refactor Trade class P/L calculation with realized/unrealized tracking
- Add settle() method for proper position closing
- Improve trade_filled() to use current filled qty for averaging
- Add fallback to exchange balances when broker balance unavailable

Paper broker enhancements:
- Add exchange-qualified price storage for multi-exchange support
- Add price_source tracking for positions
- Improve state persistence

Tests:
- Add comprehensive tests for trade P/L calculations
- Add tests for paper broker price source tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-12 12:15:56 -03:00
.github/workflows Implement execution loop, paper persistence, and CI pipeline 2026-02-28 19:48:50 -04:00
UML
__pycache__
archived_code The test are running but not without errors. 2024-11-11 17:22:06 -04:00
config
markdown The test seem to run without errors but are still process blocking. 2024-11-15 18:08:32 -04:00
src Fix live trade P/L bugs, improve UI refresh, add balance toggle 2026-03-12 12:15:56 -03:00
tests Fix live trade P/L bugs, improve UI refresh, add balance toggle 2026-03-12 12:15:56 -03:00
.claudeignore Fix chart loading and stabilize local runtime 2026-02-28 15:15:56 -04:00
.gitignore Add chart analysis feature with candlestick pattern detection 2026-03-11 15:26:49 -03:00
AGENTS.md Add chart analysis feature with candlestick pattern detection 2026-03-11 15:26:49 -03:00
CLAUDE.md Document ExternalSources and ExternalIndicators modules 2026-03-09 21:35:33 -03:00
FORMATIONS_PLAN.md Address second round of Codex review feedback on formations plan 2026-03-10 16:03:33 -03:00
pytest.ini Add Bitcoin wallet system with configurable strategy fees 2026-03-09 12:45:25 -03:00
requirements.txt Add external data sources and indicators for backtesting 2026-03-09 21:25:36 -03:00
test_live_manual.py Live trading infrastructure functional on testnet 2026-03-01 15:23:34 -04:00