Skip to content

Expose combo dual-leg regime env overrides#102

Merged
Pigbibi merged 3 commits into
mainfrom
feature/dual-leg-regime-cash-cap
Jul 4, 2026
Merged

Expose combo dual-leg regime env overrides#102
Pigbibi merged 3 commits into
mainfrom
feature/dual-leg-regime-cash-cap

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose opt-in dual-leg combo regime env overrides in Runtime workflow
  • parse new combo regime variables in strategy runtime
  • include new variables in strategy switch env plan

Validation

  • PYTHONPATH=/Users/lisiyi/Projects/BinancePlatform:/Users/lisiyi/Projects/QuantPlatformKit/src:/Users/lisiyi/Projects/CryptoStrategies/src python3 -m unittest discover -s tests -p 'test*.py'
  • python3 -m ruff check .
  • git diff --check
  • actionlint .github/workflows/main.yml

Note: this PR relies on the same-named CryptoStrategies branch for CI, then requirements will be pinned after CryptoStrategies PR #59 merges.

Co-Authored-By: Codex <noreply@openai.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Co-Authored-By: Codex <noreply@openai.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79e771453b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

BTC_WEIGHT: ${{ vars.BTC_WEIGHT }}
TREND_WEIGHT: ${{ vars.TREND_WEIGHT }}
DYNAMIC_MODE: ${{ vars.DYNAMIC_MODE }}
DYNAMIC_REGIME_MODE: ${{ vars.DYNAMIC_REGIME_MODE }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pin the strategy package before exposing overrides

In the Runtime workflow context I checked, step 3 always installs requirements-lock.txt when it exists, and that file still pins crypto-strategies to 6fe378a, which predates the dual-leg combo parameters; in that pinned strategy these new keys are only swallowed by **kwargs and ignored. As a result, setting DYNAMIC_REGIME_MODE or the hard/soft leg weights in GitHub variables will silently leave live trading on the old regime logic unless the lock file is updated to a CryptoStrategies revision that consumes them.

Useful? React with 👍 / 👎.

Co-Authored-By: Codex <noreply@openai.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Pigbibi Pigbibi merged commit 03f93dc into main Jul 4, 2026
2 checks passed
@Pigbibi Pigbibi deleted the feature/dual-leg-regime-cash-cap branch July 4, 2026 06:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0866730be4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread strategy_runtime.py
Comment on lines +38 to +41
("DYNAMIC_HARD_BTC_WEIGHT", "dynamic_hard_btc_weight", "ratio"),
("DYNAMIC_HARD_TREND_WEIGHT", "dynamic_hard_trend_weight", "ratio"),
("DYNAMIC_SOFT_BTC_WEIGHT", "dynamic_soft_btc_weight", "ratio"),
("DYNAMIC_SOFT_TREND_WEIGHT", "dynamic_soft_trend_weight", "ratio"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject dual-leg caps that exceed total exposure

When STRATEGY_PROFILE=crypto_equity_combo and an operator sets a pair such as DYNAMIC_HARD_BTC_WEIGHT=0.8 and DYNAMIC_HARD_TREND_WEIGHT=0.8, both new overrides pass because they are validated only as independent 0..1 ratios. The dual-leg strategy consumes these as effective leg weights for the hard/soft tiers, so a misconfigured pair over 100% silently defeats the intended cash-residual risk cap instead of being rejected; add cross-field validation for the hard and soft BTC+trend pairs before passing them through.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant