Conversation
Update AI Strategy Branch with current commits
Wire ai_strategy preset card, thin forex-only builder with guidance/lookback params, promote API + list phase chips, and StrategyParams ai/signal types. Co-authored-by: anomaddev <anomaddev@gmail.com>
Add ai_strategy preset with fail-closed stub evaluator, params.ai schema persistence, isolated shadow intent/lot tables, ET warm-up lifecycle with promote API, LLM budget reserve/settle at analyze_with_model, research guidance materialization, and priority policy so warming AI cannot starve live strategies. Co-authored-by: anomaddev <anomaddev@gmail.com>
…sions Replace the fail-closed stub with an async ModelSignalRuntime that resolves model_id, injects research guidance as bias-only context, calls analyze_with_model behind the spend gate, and maps structured Decision JSON to StrategyResult. run_strategy_analysis is now async and awaits evaluate_async when present. Co-authored-by: anomaddev <anomaddev@gmail.com>
Add strategy_memory_digests + learning_jobs, queue/run learning jobs from trade outcomes (wins and losses, never per-close LLM), hook shadow close to enqueue when learn_enabled/threshold met, inject digests into ModelSignalRuntime, and fill load_weekly_bot_results from summarize_week. Co-authored-by: anomaddev <anomaddev@gmail.com>
Register a deterministic compiled_playbook signal, queue ET-cadenced daily backtests from strategy memory digests, and fork Auto AI feedback to append learning notes instead of EMA builder suggestions. Co-authored-by: anomaddev <anomaddev@gmail.com>
Add docs/strategies/ai-strategy.md and refresh README, params schema, architecture notes, and config.env.example for warm-up/shadow/promote, daily compiled backtests, and BROKERAI_LLM_KILL_SWITCH. Co-authored-by: anomaddev <anomaddev@gmail.com>
Co-authored-by: anomaddev <anomaddev@gmail.com>
Fix gates.py SyntaxError that blocked all broker execution. Wire warm-up advancement on realtime analysis, shadow intents that lose live priority, idempotent shadow lots, learning job drain, LLM call caps, budget row locks, and stable cache keys. Unlock builder model/LLM/learn controls and default learn_enabled so daily improve can run. Co-authored-by: anomaddev <anomaddev@gmail.com>
List provider catalog models with model_name persistence, add control tooltips, step lookback by 5, and stop wiping the DB on every dev.sh run. Co-authored-by: Cursor <cursoragent@cursor.com>
Detect mismatched Settings → Reports toggles, offer to turn them on with defaults, and point users to configure run times. Co-authored-by: Cursor <cursoragent@cursor.com>
Enqueue a durable job that waits for required reports, seeds a research digest, runs configurable improve loops, and expose Settings → AI Strategies plus list status. Co-authored-by: Cursor <cursoragent@cursor.com>
First improve loop explores patterns without fills; later loops trade live-parity and learn only from prior digests. Reclaim secretary-orphaned running backtests so startup no longer sticks at 0%, and add cancel/progress polish on the Log page. Co-authored-by: Cursor <cursoragent@cursor.com>
Conditional stand-aside anti-rules no longer kill-switch the whole book, and API/secretary drain is idempotent so a 3-loop startup queues one explore plus two trades—not six parallel backtests. Co-authored-by: Cursor <cursoragent@cursor.com>
Claim feedback once per run, wait instead of skipping when a reservation is open, skip auto-analyze for startup origin, and reclaim expired LLM holds before new calls. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Exclusive worker leases plus unique action sequences stop overlapping writers; digest merges and playbook compile now honor lessons so trade loops stop cloning identical P/L. Co-authored-by: Cursor <cursoragent@cursor.com>
ON CONFLICT ON CONSTRAINT failed on existing DBs that only have the unique index from ensure_indexes(). Co-authored-by: Cursor <cursoragent@cursor.com>
HTF bias extras like H4 were winning shared close-time ties and labeling bot status as 4H even when strategies analyze M15. Co-authored-by: Cursor <cursoragent@cursor.com>
Also make instrument exposure upserts race-safe so concurrent syncs no longer take Secretary into UniqueViolation errors. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Implements the AI Strategy master plan across four slices on
ai-strategy-build, plus a post-implementation hardening pass before spin-up.Slice 1 — Foundations + shadow warm-up
ai_strategypreset (forex-only) with fail-closed evaluatorparams.aischema persistence + docsshadow_intents/shadow_lots/trade_outcome_records/strategy_guidancePOST /api/strategies/{id}/promoteBROKERAI_LLM_KILL_SWITCH)Slice 2 — Model runtime
ModelSignalRuntimewith throttled LLM decisions (llm_mode, interval, spend gate)run_strategy_analysisSlice 3 — Outcome learning
learning_jobs→strategy_memory_digestsSlice 4 — Daily compiled backtests
compiled_playbooksignal (no LLM in BT bar loop)Hardening pass
gates.pySyntaxError that blocked broker import/executionFOR UPDATE; stable LLM cache keysai_strategy(no live LLM spend)learn_enableddefaults true; re-enable resets warm-up episodeDocumentation
docs/strategies/ai-strategy.mdconfig.env.exampleTests
tests/test_ai_strategy_slice{1,2,3,4}.py— 30 passed.Deferred / next phases
trade_outcome_records