feat: 741 Pure Macro Matrix — regime gate on all BUY orders#203
Merged
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.com/timothy-waltons-projects?upgradeToPro=build-rate-limit |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- New blueprint: core/api/macro_bp.py • Computes EMAs [30,60,90,120,741] on 791 daily bars from Tradier • Classifies PERFECT_BULLISH_REGIME / PERFECT_BEARISH_REGIME / CONSOLIDATION_CHOP • 1-hour per-symbol cache (daily EMAs are intraday-stable) • GET /api/macro and GET /api/macro/<symbol> - Registered in core/app.py at /api prefix - iam_executor.py: _get_macro_regime() + gate before Tradier/Discord execution • PERFECT_BEARISH_REGIME blocks BUY; SELL/exits always proceed • UNKNOWN / INSUFFICIENT_DATA fail open (never block on data unavailability) - tools/robinhood_executor_sml.py v3.3 • _get_macro_regime() + 1-hour local cache • Macro gate in _execute() after god_stacked check, BUY side only • Version bump v3.2 → v3.3 Data source: Tradier daily OHLCV — DEVELOPER_MANIFESTO §3 compliant (no yfinance) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019CTP9AwncFUZQvZxpXb6Np
iam_scanner.py:
- _MANDATORY_ANCHORS = {AMC, GME, IWM} always prepended to every scan pass
- 100% FETCH preserved — anchors are deduplicated, never duplicated from live universe
- Anchors come first so they're never dropped by the TOP_N cap
iam_executor.py:
- Remove hardcoded ("IWM","SPY","QQQ") filter from auto options routing
- auto mode now tries options (calls/puts) on ANY symbol from the live universe
- Options chain availability is the natural gate — no chain → logged error, no crash
- BUY signal → calls, SELL signal → puts, extended hours → equity fallback unchanged
tools/robinhood_executor_sml.py v3.4:
- _MANDATORY_ANCHORS = {AMC, GME, IWM} — always injected into oracle poll
- After batch + history scan, fetch /api/oracle/{sym} for each missing anchor
- Wide open dynamic universe + guaranteed AMC/GME/IWM coverage every cycle
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019CTP9AwncFUZQvZxpXb6Np
66bcd85 to
7952e19
Compare
/api/741macro is the paid pitch-deck product (x402, 0.04 RLUSD). /api/macro was accidentally public — now secret-gated. core/api/macro_bp.py: - Kill public batch route (/api/macro) entirely - /api/macro/<symbol> now requires X-Macro-Secret header → 403 without it - MACRO_GATE_SECRET env var controls the secret iam_executor.py: - Drop HTTP call entirely — import _compute_regime() directly (same process) - Zero network exposure, uses server-side 1-hour cache tools/robinhood_executor_sml.py: - _get_macro_regime() now sends X-Macro-Secret header from MACRO_GATE_SECRET env var - No secret configured → fails open (UNKNOWN), never blocks trades Add MACRO_GATE_SECRET to Render env + executor.env to activate the gate. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019CTP9AwncFUZQvZxpXb6Np
|
Deployment failed with the following error: Learn More: https://vercel.com/timothy-waltons-projects?upgradeToPro=build-rate-limit |
- Stack config moved to MACRO_STACK_CSV env var (Render secret) — no periods in code - Response layers renamed L1-L5 (short→long) — opaque, no period values exposed - Internal variable names cleaned up — no period references visible in source - _REQUIRED_BARS computed from env config, not hardcoded - Fails gracefully with NOT_CONFIGURED if MACRO_STACK_CSV not set /api/741macro remains the paid public product. /api/macro/<symbol> is secret-gated internal only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019CTP9AwncFUZQvZxpXb6Np
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New internal module
core/api/macro_bp.py— 741 Pure Macro Matrix enginePERFECT_BULLISH_REGIME/PERFECT_BEARISH_REGIME/CONSOLIDATION_CHOPX-Macro-Secretheader — not a public endpointcore/app.py— registers internal macro blueprint alongside existingmacro741_bpiam_executor.py— regime gate before any BUY executionPERFECT_BEARISH_REGIMEblocks BUY; SELL/exits always proceedUNKNOWN/INSUFFICIENT_DATAfail openiam_scanner.py— mandatory anchors always resolved every passtools/robinhood_executor_sml.pyv3.4MACRO_GATE_SECRETenv var in executor.envDynamic options routing —
automode routes any symbol to calls/puts; chain availability is the natural gateTest plan
PERFECT_BEARISH_REGIMEsymbol: BUY blocked, SELL proceedsUNKNOWN/ data fetch failure: BUY is NOT blocked (fail-open)/api/macro/<symbol>withoutX-Macro-Secret→ 403/api/macro/<symbol>with correct secret → regime responseautoinstrument mode: BUY → calls, SELL → puts on any symbol🤖 Generated with Claude Code
https://claude.ai/code/session_019CTP9AwncFUZQvZxpXb6Np