brighter-trading/tests
rob 2ae087a099 Add stop loss, take profit, and time-in-force support for manual trading
Phase 4: Advanced Order Management

- Add stop_loss and take_profit fields to Trade class with DB persistence
- Add SL/TP form fields in new trade popup with validation
- Implement SL/TP evaluation in PaperBroker.update()
- Auto-close positions when SL/TP thresholds are crossed
- Emit sltp_triggered events to frontend with notifications
- Add Time-in-Force dropdown (GTC, IOC, FOK) to trade form
- Add persistence for position_sltp tracking across state save/load
- Add unit tests for SL/TP functionality (5 new tests)
- Add Trade class SL/TP field tests (2 new tests)

Also includes Phase 3 manual trading broker hardening:
- Fix broker UI not wired on startup
- Fix cancelled orders vanishing from history
- Fix positions not live-updating P/L
- Fix paper pricing exchange-ambiguity
- Simplify paper trades to single synthetic market

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 19:35:52 -03:00
..
__pycache__ Updated project structure and staged modified files 2024-07-25 08:21:15 -03:00
BrighterTrading.db Updated project structure and staged modified files 2024-07-25 08:21:15 -03:00
Brng.db Updated project structure and staged modified files 2024-07-25 08:21:15 -03:00
__init__.py Classes implemented in python and javascript. UML class diagram. Rough sequence uml. TODO: local file getting dirty from refresh. Signals implemented. Strategies implemented. Trades implemented but still needs some testing. 2023-02-17 22:47:13 -04:00
config.yml Many improvements. 2023-05-14 17:33:13 -03:00
conftest.py Phase 0: Stabilize baseline 2026-02-28 16:44:11 -04:00
test_BrighterTrades.py Add exchange validation, fix indicators bug, and improve balance display 2026-03-08 19:41:41 -03:00
test_DataCache.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_Exchange.py Fix KuCoin balance fetching and add balance refresh functionality 2026-03-06 06:10:31 -04:00
test_Users.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_app.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_backtest_determinism.py Fix high-severity issues identified by Codex 2026-02-28 17:23:58 -04:00
test_brokers.py Add stop loss, take profit, and time-in-force support for manual trading 2026-03-11 19:35:52 -03:00
test_candles.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_database.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_edm_client.py Integrate EDM for candle data and improve UI dialogs 2026-03-04 11:42:06 -04:00
test_exchange_validation.py Add exchange validation, fix indicators bug, and improve balance display 2026-03-08 19:41:41 -03:00
test_exchangeinterface.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_execution_loop.py Implement execution loop, paper persistence, and CI pipeline 2026-02-28 19:48:50 -04:00
test_indicators.py Phase 0: Stabilize baseline 2026-02-28 16:44:11 -04:00
test_live_broker.py Live trading infrastructure functional on testnet 2026-03-01 15:23:34 -04:00
test_live_exchange_integration.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_live_integration.py Live trading infrastructure functional on testnet 2026-03-01 15:23:34 -04:00
test_live_strategy_instance.py Live trading infrastructure functional on testnet 2026-03-01 15:23:34 -04:00
test_paper_persistence.py Implement execution loop, paper persistence, and CI pipeline 2026-02-28 19:48:50 -04:00
test_paper_trading.py Phase 4: Paper trading implementation 2026-02-28 17:07:34 -04:00
test_shared_utilities.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_strategy_execution.py Add Bitcoin wallet system with configurable strategy fees 2026-03-09 12:45:25 -03:00
test_strategy_generation.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_trade.py Add stop loss, take profit, and time-in-force support for manual trading 2026-03-11 19:35:52 -03:00
test_trade2.py Fix backtest data source and chart view detection bugs 2026-03-06 00:05:31 -04:00
test_wallet.py Add Bitcoin wallet system with configurable strategy fees 2026-03-09 12:45:25 -03:00