Skip to content
All strategies

Strategies

SPY Causal Markov-Regime Adaptive Bollinger Pullbacks, Long–Short

Outcome: Abandoned

SpyCausalMarkovBollingerPullbacks

Outcome Summary

SpyCausalMarkovBollingerPullbacks attempted regime-dependent daily long–short SPY pullback trading using point-in-time filtered variance probabilities. After three iterations, all six synthetic scenarios failed because a supplied daily bar timestamp did not fall on an exchange session. The run was abandoned during verification, leaving no backtest or optimization results to assess its trading performance.

Hypothesis

Derived by the Research Lead from Sonam Srivastava and Ritabrata Bhattacharyya's paper: test whether a causal variance-state classifier improves regime-dependent daily pullback trading on SPY, preserving the paper's equity-market setting. This is a distilled Bollinger-based implementation of its four-regime framework, not a reproduction of its reported returns or complete multi-indicator system. Preserve the stated 250-day triangular moving average, 20-day ATR channel, regime-specific Bollinger widths, EMA10……Show moreShow less

Derived by the Research Lead from Sonam Srivastava and Ritabrata Bhattacharyya's paper: test whether a causal variance-state classifier improves regime-dependent daily pullback trading on SPY, preserving the paper's equity-market setting. This is a distilled Bollinger-based implementation of its four-regime framework, not a reproduction of its reported returns or complete multi-indicator system. Preserve the stated 250-day triangular moving average, 20-day ATR channel, regime-specific Bollinger widths, EMA10 reference and ATR exit multiples. Complete unspecified Bollinger lookback, model-estimation window, crossover semantics, position sizing and regime-switch reference prices explicitly below. Replace retrospectively smoothed regime probabilities with point-in-time filtered probabilities to remove future information. Trade market orders at the signal session's close; no next-session-open execution is required. All protective stops trigger intrabar through platform matching. The supplied full text supports these rules; author code would still be needed to confirm indicator periods, signal aggregation, Fibonacci construction and exact regime-switch implementation.

Preserve the source's S&P 500 setting using the tradable SPY ETF rather than transplanting equity regimes into crypto. Long–short trading addresses the portfolio's 80.9% long-only concentration. Although this does not fill the options or cross-venue quotas, those adaptations would introduce mechanisms absent from the source. Corpus concentration was supplied empty, so no instrument-specific share is assumed. The distinguishing mechanism is causal latent-variance conditioning with asymmetric directional confirmation, rather than another unconditional daily momentum or single-symbol RSI strategy.

verification_loop: Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan',……Show moreShow less

verification_loop: Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan', 'advance_target_atr', 'decline_exit_bb_sd', 'decline_target_atr', 'probability_method', 'use_bracket_orders', 'advance_entry_bb_sd', 'decline_entry_bb_sd', 'model_max_iterations', 'model_refit_sessions', 'model_variance_floor', 'accumulation_stop_atr', 'bear_confirmation_pct', 'bull_confirmation_pct', 'distribution_stop_atr', 'exit_on_regime_change', 'max_notional_fraction', 'accumulation_target_atr', 'distribution_exit_bb_sd', 'distribution_target_atr', 'model_numerical_epsilon', 'accumulation_entry_bb_sd', 'distribution_entry_bb_sd', 'high_variance_probability', 'model_initial_persistence', 'model_likelihood_tolerance', 'model_initial_variance_multipliers'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - steady_downtrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - flat_ranging: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - volatility_spike: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - zero_volume: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - price_gap: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000)

Implementation

Daily long–short SPY Bollinger pullbacks conditioned on causal two-state variance filtering and four directional/variance regimes. Uses a 250-session triangular average, Wilder ATR20, EMA10 short exits, entry-anchored ATR brackets, whole-share risk sizing and regime/time exits.

Addresses the reported Layer-1 failure by replacing the banned src.data.market_calendar import with a standard-library session-date helper matching the platform calendar over SPY's post-1993 history. The existing annual session-grid refit schedule and all indicator, model, entry, exit and sizing logic are preserved. No verification was run. The required outbox file could not be written because this session's filesystem permissions are read-only; the complete task-bound JSON is returned here.

Verification Results

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan',……Show moreShow less

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan', 'advance_target_atr', 'decline_exit_bb_sd', 'decline_target_atr', 'probability_method', 'use_bracket_orders', 'advance_entry_bb_sd', 'decline_entry_bb_sd', 'model_max_iterations', 'model_refit_sessions', 'model_variance_floor', 'accumulation_stop_atr', 'bear_confirmation_pct', 'bull_confirmation_pct', 'distribution_stop_atr', 'exit_on_regime_change', 'max_notional_fraction', 'accumulation_target_atr', 'distribution_exit_bb_sd', 'distribution_target_atr', 'model_numerical_epsilon', 'accumulation_entry_bb_sd', 'distribution_entry_bb_sd', 'high_variance_probability', 'model_initial_persistence', 'model_likelihood_tolerance', 'model_initial_variance_multipliers'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - steady_downtrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - flat_ranging: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - volatility_spike: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - zero_volume: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - price_gap: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000)

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - optimization_plan fixes distribution_entry_bb_sd at 1.5

Verification failed (Layer 1 — static analysis): - Banned import: src.data.market_calendar — strategies may only import the framework bases and helpers (src.strategies.base_template, src.strategies.rolling_options_template, src.strategies.polymarket_series_template, src.strategies.helpers); collectors, the database, the backtest engine and the registry are outside the sandbox. (line 9)

Outcome Summary

Reconcile SPY exchange-session validation with synthetic scenario timestamps before evaluating the trading thesis.

After three iterations, the run was abandoned in the verification loop because its exchange-session validation rejected the supplied daily bar timestamp in every synthetic scenario.

Test whether a causal variance-state classifier improves daily long–short SPY Bollinger pullback trading with regime-specific entries and ATR exits.

No backtest metrics were available: the strategy failed synthetic verification in all six scenarios, and backtesting and optimization were not reached.

Abandon Reason

verification_loop: Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan',……Show moreShow less

verification_loop: Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['bb_period', 'atr_period', 'ema_period', 'model_mean', 'pyramiding', 'bar_interval', 'model_states', 'model_window', 'atr_smoothing', 'risk_fraction', 'stop_loss_pct', 'model_ar_order', 'entry_execution', 'long_exit_bb_sd', 'take_profit_pct', 'warmup_sessions', 'advance_stop_atr', 'decline_stop_atr', 'model_estimation', 'tma_first_period', 'max_hold_sessions', 'tma_second_period', 'trend_channel_atr', '_optimization_plan', 'advance_target_atr', 'decline_exit_bb_sd', 'decline_target_atr', 'probability_method', 'use_bracket_orders', 'advance_entry_bb_sd', 'decline_entry_bb_sd', 'model_max_iterations', 'model_refit_sessions', 'model_variance_floor', 'accumulation_stop_atr', 'bear_confirmation_pct', 'bull_confirmation_pct', 'distribution_stop_atr', 'exit_on_regime_change', 'max_notional_fraction', 'accumulation_target_atr', 'distribution_exit_bb_sd', 'distribution_target_atr', 'model_numerical_epsilon', 'accumulation_entry_bb_sd', 'distribution_entry_bb_sd', 'high_variance_probability', 'model_initial_persistence', 'model_likelihood_tolerance', 'model_initial_variance_multipliers'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - steady_downtrend: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - flat_ranging: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - volatility_spike: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - zero_volume: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000) - price_gap: ValueError: SPY daily bar does not fall on an exchange session (bar timestamp: 1735689660000)

Analysis

Evaluating the Building Blocks of a Dynamically Adaptive Systematic Trading Strategy

Backtest and paper results are hypothetical. Trading involves risk of loss.