ButterflyBot
A specialised desktop app that ties together trading logic, risk control, order state and the operator's working interface.

Context / task
A multi-leg options strategy is not a single 'buy' button.
You need to decompose the combination, verify contracts, track partial fills and cancels, not lose state on connection problems and stop automation in time when limits are breached.
What was done
The app is built around individual strategies managed from a PyQt6 interface.
An async layer maintains the connection to Interactive Brokers; a parser turns the textual combination into a set of contracts; a controller syncs the UI, positions and background tasks.
Separate modules handle risk, state persistence, event handling and clean shutdown.
Key capabilities
- Interactive Brokers connection via ib_async
- tabs per underlying asset
- decomposition and diagnostics of multi-leg combinations
- registering and starting individual strategies
- managing opening and closing orders
- handling cancels, partial fills and race conditions
- automatic price and size parameter adjustment
- open-position limit and a global safety halt
- connection monitoring and graceful disconnect
- saving strategies and restoring working state
- test scenarios for automation, commissions, limits and reconciliation
Technical side
A local desktop tool for managing options strategies.
Public presentation is deliberately limited: no account, orders, real positions, P&L, logs or connection settings are shown.
The system is not marketed as a source of income and does not guarantee execution.
Project materials

Next case
art2.si
Similar task