Releases: brndnmtthws/thetagang
Release list
v2.0.2
ThetaGang v2.0.2
This patch release tightens regime rebalance behavior and cleans up Docker-based IB Gateway startup logging. It also updates the bundled Docker IBC release to 3.23.0.
Full Changelog: v2.0.1...v2.0.2
Breaking Changes
regime_rebalance.ratio_gate.var_minhas been removed. Useregime_rebalance.ratio_gate.vol_mininstead. Configurations that still setvar_minnow fail fast with migration guidance.
Highlights Since v2.0.1
Regime Rebalancing
- Flow-driven rebalances now respect the same regime, cooldown, and ratio gates used by soft-band rebalances, while hard-band breaches can still force partial rebalances when needed.
- Ratio gating now uses annualized ratio volatility through
vol_min, making thresholds and logs easier to interpret than raw daily variance values. - Positive residual regime cash-flow capital is reserved from post-run cash management so staged regime buys are not immediately swept into the configured cash fund.
Docker and IB Gateway
- Docker images now apply IB Gateway/TWS Log4j options through the actual IBC Java launch path instead of relying on ignored
*.vmoptionssystem properties. - Additional Log4j StatusLogger and default status-level options suppress noisy IB Gateway startup and shutdown status logs while preserving real Java errors.
- The bundled IBC Linux release is updated from 3.20.0 to 3.23.0, with the pinned checksum refreshed and
ibc-config.iniupdated for the newIncludeStackTraceForExceptionsoption.
Documentation
- Removed stale README links to deleted Reddit posts and adjusted the surrounding strategy description.
Migration Guide
1) Update ratio gate configuration
Replace:
[regime_rebalance.ratio_gate]
var_min = 0.00001With:
[regime_rebalance.ratio_gate]
vol_min = 0.05vol_min is annualized ratio volatility. To convert an old daily variance threshold, use:
vol_min = sqrt(var_min * 252)
2) Validate before live trading
uv run thetagang --config thetagang.toml --dry-runFor Docker users, rebuild or pull the updated image so the IBC 3.23.0 and Log4j launcher changes are present.
Pull Requests by Category
Bug Fixes
- Reserve regime flow cash from cash management (#666)
- Configure IB Gateway Java logging in Docker (#667)
- Apply IBC Java logging options at launch (#668)
- Gate ratios on annualized volatility (#672)
- Gate flow rebalances (#673)
- Suppress IB Gateway status logging (#674)
- Suppress remaining IB Gateway status logs (#676)
Documentation
- Remove broken Reddit links (#670)
Misc
v2.0.1
ThetaGang v2.0.1
This release adds optional volatility-weighted regime targets and tightens several runtime details around regime history, target reporting, and TWS/Gateway startup. It also reduces container log noise from IBKR Java startup paths and includes routine dependency maintenance.
Full Changelog: v2.0.0...v2.0.1
Highlights Since v2.0.0
Regime Rebalancing
- Added optional
portfolio.symbols.<symbol>.volatility_weightconfiguration so selected regime symbols can scale effective target weights from realized volatility, with configurable lookback, target volatility, min/max weight, rebalance band, and smoothing controls. - Effective volatility-adjusted weights are now used in regime target value and share calculations for symbols that opt in, while symbols without the new configuration continue to use static configured weights.
- Ratio-gate history is fetched independently from proxy-symbol history, which fixes edge cases where non-anchor symbols could be evaluated against the wrong history set.
- Startup and runtime output now show volatility-weight configuration and calculation details more clearly, including raw, clamped, previous, smoothing, and effective weights.
TWS and Gateway Runtime
- Updated the pinned TWS/IBC startup version from 1037 to 1045 and aligned Docker image paths with the installed TWS tree.
- Suppressed noisy Log4j status output and a known useless Gateway appender lifecycle message while preserving normal Java, IBC, and bot error output.
Upgrade Notes
- Existing v2.0.0 configs continue to work without changes. Volatility-weighted targets are opt-in per symbol through
portfolio.symbols.<symbol>.volatility_weight. - Container users should pull/rebuild the latest image so the TWS 1045 paths and Gateway log-suppression settings are present.
- Validate config and behavior with a dry run before enabling live trading:
uv run thetagang --config thetagang.toml --dry-runPull Requests by Category
Features
- feat(regime): add volatility weighted targets (#660)
Bug Fixes
- fix(regime): decouple ratio gate from proxy history (#659)
- fix(tws): bump pinned version to 1045 (#661)
- fix(regime): clarify volatility weight output (#663)
- fix(tws): suppress log4j status output (#662)
- fix(tws): suppress noisy gateway logs (#664)
Misc
- chore: bump version (#650)
- chore(deps): bump the deps group across 1 directory with 2 updates (#658)
- chore(deps): bump docker/setup-qemu-action from 3 to 4 (#655)
- chore(deps): bump docker/setup-buildx-action from 3 to 4 (#654)
- chore(deps): bump docker/metadata-action from 5 to 6 (#651)
- chore(deps): bump docker/build-push-action from 6 to 7 (#652)
- chore(deps): bump docker/login-action from 3 to 4 (#653)
v2.0.0
ThetaGang v2.0.0
v2.0.0 is a major release that introduces the new config schema (v2), strategy/stage runtime refactors, a persistent state database, and major upgrades to regime-aware rebalancing.
Full Changelog: v1.16.3...v2.0.0
Breaking Changes
- Config schema v2 is now required (
meta.schema_version = 2). - Legacy v1 top-level sections are no longer valid in v2 configs (for example:
account,target,roll_when,symbols,infrastructure,overrides). runnow requires exactly one of:run.strategies(recommended)run.stages(advanced)
wheelandregime_rebalancecannot both be enabled inrun.strategies.
Highlights Since v1.16.3
Config and Runtime
- Added a new typed v2 config model and startup migration flow.
- Added CLI migration controls:
--migrate-configto migrate and exit--yesfor non-interactive migration approval
- Added stronger validation around strategy/stage plans and dependency ordering.
- Refactored orchestration into strategy engines and stage runners for clearer execution boundaries.
Regime-Aware Rebalancing
- Added flow/deficit rails and proxy weighting improvements.
- Added optional ratio-gate for soft rebalance decisions.
- Updated rebalance base handling to exclude options (and cash fund handling updates), improving sizing consistency.
- Switched cash rails to percentage thresholds and improved summary/telemetry output.
State, Persistence, and Observability
- Added SQLite/Alembic-backed state store and runtime telemetry tables.
- Added persistent order intent tracking and richer execution history.
- Added untracked position reporting/persistence.
Reliability and Operational Fixes
- Improved order completion timeout handling.
- Fixed watchdog execution to run inside the event loop task.
- Fixed exchange-hours out-of-bounds calendar checks.
- Improved market data contract qualification for IBKR.
- Reduced noisy third-party logging by default.
Config Migration Guide (v1 -> v2)
1) Run the built-in migration
thetagang --config thetagang.toml --migrate-configFor non-interactive environments (CI/containers):
thetagang --config thetagang.toml --migrate-config --yesThe migrator writes your updated v2 config in-place and creates a backup as:
thetagang.toml.old- or
thetagang.toml.old.Nif a backup already exists
2) Key section moves in v2
account,option_chains,exchange_hours,orders,database,ib_async,ibc,watchdog->runtime.*symbols->portfolio.symbolstarget,write_when,roll_when,constants->strategies.wheel.defaults.*regime_rebalance,vix_call_hedge,cash_management->strategies.*
3) Rebalance override migration details
Legacy per-symbol buy/sell-only knobs are migrated to:
strategies.wheel.equity_rebalance.symbol_overrides.<SYMBOL>
Legacy per-symbol call-write-only overrides are migrated to:
strategies.wheel.symbol_overrides.<SYMBOL>
4) Verify and dry-run
After migration, verify:
meta.schema_version = 2run.strategies(or advancedrun.stages) is present- your runtime/portfolio/strategy sections are nested under the new v2 hierarchy
Then run a dry-run before live trading:
uv run thetagang --config thetagang.toml --dry-runPull Requests by Category
Features
- Regime aware rebalancing, db (#629)
- feat(db): track order intents (#631)
- feat(regime): add flow/deficit rails and proxy weights (#636)
- feat(regime): add ratio gate for soft rebalances (#637)
- feat(portfolio): show and persist untracked positions (#638)
- feat(regime): base on net liq excluding options and cash fund (#642)
- feat(regime): exclude options from rebalance base (#643)
- feat(regime): switch cash rails to percentage thresholds (#644)
- feat(config): introduce v2 schema and startup migration (#647)
Bug Fixes
- fix(watchdog): run watchdog inside event loop task (#632)
- fix: silence third-party logging by default (#633)
- fix(exchange-hours): avoid out-of-bounds calendar checks (#635)
- fix(ibkr): qualify contracts for market data (#640)
- fix(execution): handle order completion timeouts gracefully (#645)
- fix(migration): enforce v2 strategy semantics (#648)
Misc
v1.16.3
What's Changed
- Bump version by @brndnmtthws in #623
- fix(rebalance): price sell-only sells at midpoint by @brndnmtthws in #624
Full Changelog: v1.16.2...v1.16.3
v1.16.2
What's Changed
- Bump version by @brndnmtthws in #610
- Update ruff requirement from <0.14.0,>=0.9.1 to >=0.9.1,<0.15.0 in the deps group by @dependabot[bot] in #612
- Bump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in #613
- Use tradingClass for extra filtering of option chain by @scott-coates in #614
- Fix previous commit incomplete trading class matching filter logic by @scott-coates in #616
- fix: better portfolio data loading by @brndnmtthws in #615
- fix: tolerate account update timeouts by @brndnmtthws in #617
- Update pytest requirement from <9,>=8.0.0 to >=8.0.0,<10 in the deps group by @dependabot[bot] in #618
- test(ibkr): cover account snapshot readiness by @brndnmtthws in #619
- Bump the deps group with 2 updates by @dependabot[bot] in #620
- Bump actions/checkout from 5 to 6 by @dependabot[bot] in #621
New Contributors
- @scott-coates made their first contribution in #614
Full Changelog: v1.16.1...v1.16.2
v1.16.1
What's Changed
- bump version by @brndnmtthws in #590
- refactor: move tests to separate tests directory by @brndnmtthws in #591
- feat: add percentage-based minimum threshold for buy-only rebalancing by @brndnmtthws in #592
- feat: add buy_only_min_threshold_percent_relative for relative threshold based rebalancing by @brndnmtthws in #593
- fix: resolve all pyright type errors and add type checking to CI by @brndnmtthws in #594
- feat: add call writing thresholds to limit writing calls on small/near-target positions by @brndnmtthws in #595
- feat: add sell-only rebalancing for gradual position reduction by @brndnmtthws in #596
- feat: add portfolio weight information to positions summary table by @brndnmtthws in #598
- Bump the deps group with 2 updates by @dependabot[bot] in #600
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #599
- chore: bump TWS to 1039 by @brndnmtthws in #601
- fix: tws version (hopefully correct) by @brndnmtthws in #602
- fix: correct weight info column placement in positions summary table by @brndnmtthws in #603
- Bump actions/stale from 9 to 10 by @dependabot[bot] in #604
- Bump the deps group with 2 updates by @dependabot[bot] in #605
- refactor: base weights on buying power by @brndnmtthws in #607
- chore: use AGENTS.md instead of CLAUDE.md by @brndnmtthws in #608
- perf: optimize call checking with async task execution by @linben in #606
New Contributors
Full Changelog: v1.16.0...v1.16.1
v1.16.0
What's Changed
- Python 3.13 by @brndnmtthws in #585
- feat: add buy-only rebalancing mode for direct stock purchases by @brndnmtthws in #586
- docs: update README for accuracy and document hidden features by @brndnmtthws in #587
- bump version by @brndnmtthws in #588
Full Changelog: v1.15.1...v1.16.0
v1.15.1
What's Changed
- Bump version by @brndnmtthws in #566
- Update rich requirement from <14,>=13.7.0 to >=13.7.0,<15 in the deps group by @dependabot in #569
- Fix VIX min tick handling by @brndnmtthws in #570
- Fix publish token by @brndnmtthws in #571
- Bump astral-sh/setup-uv from 5 to 6 by @dependabot in #573
- fix: improve timeout handling in IBKR API interactions by @brndnmtthws in #574
- feat: upgrade ib-async from v1.0.3 to v2.0.1 by @brndnmtthws in #576
- fix: resolve event loop conflict with ib-async v2.0.1 by @brndnmtthws in #577
- fix: handle None contracts from ib_async v2.0.1 qualifyContractsAsync by @brndnmtthws in #578
- Bump version by @brndnmtthws in #580
- Bump version by @brndnmtthws in #582
- fix cosign by @brndnmtthws in #583
Full Changelog: v1.14.1...v1.15.1
v1.14.1
What's Changed
- Bump version by @brndnmtthws in #559
- Print exchange hours in table by @brndnmtthws in #560
- Update IBC to 3.20.0 by @brndnmtthws in #561
- Rollback qemu image by @brndnmtthws in #564
- Can't use algo on combos by @brndnmtthws in #563
Full Changelog: v1.14.0...v1.14.1
v1.14.0
What's Changed
- Bump version by @brndnmtthws in #514
- strike_limit option prevent searching for PUT options by @junyuanz1 in #517
- Bump the deps group with 2 updates by @dependabot in #520
- Bump minor version by @brndnmtthws in #519
- using async/await to improve throughput by @junyuanz1 in #518
- We need to await on call_is_itm() by @brndnmtthws in #522
- Don't blow up if fields are missing by @brndnmtthws in #523
- Permit closing if we can't roll the contract. by @brndnmtthws in #524
- Continue when there's no market price for position by @brndnmtthws in #525
- Handle this failure gracefully by @brndnmtthws in #527
- Handle this failure gracefully by @brndnmtthws in #528
- This is not necessary anymore by @brndnmtthws in #529
- Standardizing Logging and Removing Redundant Dependencies by @junyuanz1 in #521
- Better logging by @brndnmtthws in #531
- Fix a few more log lines (with
symbol:prefix) by @brndnmtthws in #534 - Style nitpick: use = not : for consistency by @brndnmtthws in #535
- introduce
--dry-runmode by @junyuanz1 in #533 - Fix dockerhub username by @brndnmtthws in #537
- Bump the deps group with 2 updates by @dependabot in #538
- Bump ruff from 0.8.2 to 0.8.3 in the deps group by @dependabot in #539
- We shouldn't fail if there are no bids when closing by @brndnmtthws in #540
- Check if value is none first by @brndnmtthws in #541
- switch to use class modal for configurations by @junyuanz1 in #536
- Bump the deps group with 4 updates by @dependabot in #542
- Fix per-symbol config output, refactor by @brndnmtthws in #543
- Refactor config accessors by @brndnmtthws in #544
- Add more detail about the second account trick by @brndnmtthws in #546
- Bump ruff from 0.8.4 to 0.8.6 in the deps group by @dependabot in #548
- Bump abatilo/actions-poetry from 3 to 4 by @dependabot in #547
- Don't cancel market data (fixed typo too) by @brndnmtthws in #549
- Bump the deps group with 2 updates by @dependabot in #550
- Migrate poetry -> uv by @brndnmtthws in #551
- Check this config param is not None by @brndnmtthws in #552
- Log version info by @brndnmtthws in #554
- Fix typo by @brndnmtthws in #555
- Add exchange hours handling by @brndnmtthws in #556
- Correctly convert np float to Python float by @brndnmtthws in #557
Full Changelog: v1.13.2...v1.14.0