A PyQt6 trading application for Interactive Brokers with scale-in functionality.
- Python 3.10 or higher
- Interactive Brokers TWS or IB Gateway running
- Active IB account with API enabled
- Install Python dependencies:
pip3 install -r requirements.txt- Make sure Interactive Brokers TWS is running and API connections are enabled:
- Open TWS
- Go to File → Global Configuration → API → Settings
- Enable "Enable ActiveX and Socket Clients"
- Add port 7497 to "Socket Port"
python3 ui.py- Initial trade with stop loss
- Scale-in with automatic stop adjustment
- Move stop to breakeven option
- Real-time max loss calculation
- Position monitoring
- Enter ticker symbol
- Set initial quantity and stop loss
- Click "Start" to place initial trade
- Click "Add" to scale in remaining shares
- Stop automatically adjusts based on your settings