-
Notifications
You must be signed in to change notification settings - Fork 0
Consume unified technical DCA signals #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,7 +243,12 @@ def _evaluate_global_etf_rotation_with_manifest(ctx: StrategyContext, *, manifes | |
| config["canary_assets"] = list(config.get("canary_assets", ())) | ||
| config.pop("signal_effective_after_trading_days", None) | ||
| pop_execution_only_config(config) | ||
| market_history = require_market_data(ctx, "market_history") | ||
| market_history = ctx.market_data.get("market_history") | ||
| if market_history is None: | ||
| def _empty_market_history(_client, _symbol): | ||
| return () | ||
|
|
||
| market_history = _empty_market_history | ||
| translator = config.pop("translator", default_translator) | ||
| config.pop("signal_text_fn", None) | ||
| weights, signal_desc, is_emergency, canary_str = legacy_global_etf_rotation.compute_signals( | ||
|
|
@@ -995,7 +1000,16 @@ def evaluate_nasdaq_sp500_smart_dca(ctx: StrategyContext) -> StrategyDecision: | |
| config.pop("pacing_sec", None) | ||
| reserved_cash_policy = pop_reserved_cash_policy_config(config) | ||
| pop_execution_only_config(config) | ||
| market_history = require_market_data(ctx, "market_history") | ||
| market_history = ctx.market_data.get("market_history") | ||
| if market_history is None: | ||
| def _empty_market_history(_client, _symbol): | ||
| return () | ||
|
|
||
| market_history = _empty_market_history | ||
| technical_indicator_snapshot = ( | ||
| ctx.market_data.get("technical_indicator_snapshot") | ||
| or ctx.market_data.get("derived_indicators") | ||
| ) | ||
|
Comment on lines
+1009
to
+1012
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new Useful? React with 👍 / 👎. |
||
| portfolio = require_portfolio(ctx) | ||
| apply_reserved_cash_policy_to_usd_config( | ||
| config, | ||
|
|
@@ -1006,6 +1020,7 @@ def evaluate_nasdaq_sp500_smart_dca(ctx: StrategyContext) -> StrategyDecision: | |
| market_history, | ||
| portfolio, | ||
| as_of=ctx.as_of, | ||
| technical_indicator_snapshot=technical_indicator_snapshot, | ||
| broker_client=ctx.capabilities.get("broker_client"), | ||
| translator=translator, | ||
| **config, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
global_etf_rotationis invoked withoutmarket_history, this fallback feeds an empty series for every ticker intocompute_signals; with the default four canaries andcanary_bad_threshold=4, that path returns a 100% safe-haven emergency allocation instead of surfacing the missing required input. Since the catalog/manifest still declaremarket_historyas required for this strategy, a platform wiring issue would now silently produce an actionable defensive trade rather than fail fast.Useful? React with 👍 / 👎.