brighter-trading/tests
rob 5866319b5e Fix critical Phase 4 issues: wire SL/TP to broker, reconcile trades, fix schema
High priority fixes:
- Wire time_in_force, stop_loss, take_profit to broker.place_order()
  * Pass time_in_force from received_new_trade() to new_trade()
  * Pass SL/TP/TIF from new_trade() to broker.place_order()

- Reconcile Trade ledger when SL/TP triggers
  * Find all matching paper trades for symbol
  * Settle trades at trigger price
  * Move from active_trades to settled_trades
  * Save to database

- Fix fresh schema missing SL/TP columns
  * Add stop_loss and take_profit to CREATE TABLE statement
  * Ensures first-run trade persistence works

Medium priority fixes:
- Hide SL/TP fields for SELL orders (inventory-only model)
  * SL/TP only makes sense for BUY (opening positions)
  * SELL closes existing positions, no SL/TP needed
  * Added _updateSltpVisibility() method
  * Side change listener shows/hides SL/TP row
  * Removed SELL-side SL/TP validation

Tests:
- Added 2 integration tests for manual trading SL/TP path
- 353 tests pass (4 pre-existing failures unrelated)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-11 19:49:39 -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 Fix critical Phase 4 issues: wire SL/TP to broker, reconcile trades, fix schema 2026-03-11 19:49:39 -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