Micro Bitcoin Futures Trading Bot — Regulatory Momentum Python Strategy (MBTM6 CME)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT YOU ARE GETTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You receive a single Python file (~895 lines) containing a complete, live-tested
algorithmic trading strategy written for CME Micro Bitcoin Futures (MBTM6).
The portable file has had all proprietary broker-connectivity code (Rithmic API,
Redis message bus, registry manager, dotenv) surgically removed and replaced with
clearly-marked placeholder comments (# BROKER INTEGRATION: ...). Every single
line of strategy logic — the regulatory catalyst scoring, momentum composite,
ATR-based risk sizing, partial scale-outs, circuit breakers, and execution
framework — is 100% intact.
A self-contained BaseTradingBot stub is injected at the top of the file, giving
you a complete, runnable class hierarchy that you can wire to any broker API,
paper-trading engine, or backtesting framework.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BOT CREATION DATE & CONTEXT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Created: September 8, 2026 · 5:24 PM CT
Run stamp: run_2026-09-08_172418
This bot was developed in the context of the U.S. CLARITY Act legislative
calendar — a crypto-market-structure bill that created recurring, predictable
periods of heightened directional momentum in Bitcoin futures as institutional
participants positioned ahead of scheduled Congressional votes. The strategy
captures that window using a composite momentum filter anchored by a time-decay
proximity signal relative to a known vote date.
The strategy was first run live on CME Micro Bitcoin (MBTM6) on September 8, 2026,
and has been preserved in the bar_historical archive of the QLN live-trading
research repository.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BACKTEST PERFORMANCE — HONEST DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANT: Read before purchasing.
This strategy is classified as "paper / Gen1" in our internal backtesting
pipeline. Our pipeline requires a minimum of 20 trades and 2+ profitable months
of live backtest data before a strategy is promoted to the "profitable bot
ranking" — this bot does not currently appear in that ranking.
WHY THE LOW TRADE COUNT?
This is an event-driven strategy tied to a specific legislative calendar event
(a regulatory vote proxy dated September 15). The strategy has a high-selectivity
entry filter — it only enters when:
1. 60-minute trend is aligned (fast MA > slow MA)
2. Composite momentum score exceeds a dynamic threshold
3. Catalyst proximity bias is elevated
4. No circuit breakers are active
5. Spread and staleness gates are passed
In practice this means the bot may generate only a handful of entries per month.
A low trade count is a design feature, not a defect — the strategy is built to
wait for high-probability setups rather than churn.
WHAT THE CODE DEMONSTRATES:
Even with a limited live-backtest trade sample, this strategy is valuable as a
study in:
• Regulatory catalyst signal construction
• Multi-layer momentum composite scoring (RSI + MACD + Donchian + Volume)
• Dynamic ATR-based stop calibration under crypto volatility regimes
• Partial scale-out architecture (3-tier: 1R, 2R, 3R)
• Professional-grade circuit breaker design
• Event-driven entry timing using time-decay proximity functions
ESTIMATED SHORT-TERM PROFIT POTENTIAL (from source code header):
$1,200 – $4,500 (developer estimate, not guaranteed, not backtested performance)
STARTING CAPITAL ASSUMED IN INTERNAL PIPELINE: $17,092
ACCOUNT CAPITAL DEFAULT IN BOT: $50,000
Past potential estimates are not guarantees of future performance.
Futures trading involves substantial risk of loss. See full risk disclaimer below.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
STRATEGY ARCHITECTURE DEEP-DIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. THE REGULATORY CATALYST ENGINE
The strategy's most distinctive feature is a time-decay proximity function
that generates a "catalyst bias" score based on how close the current date is
to a known legislative vote date (default: September 15).
days_to_vote = (vote_date - today).days
proximity = max(0.0, 1.0 - days_to_vote / 30.0) # ramps up to 1.0 at vote date
pre_vote_bias = 1.0 if days_to_vote >= 0 else -0.5 # bullish pre-vote, muted post
catalyst_bias = proximity x pre_vote_bias
This generates a continuous [0.0, 1.0] catalyst boost that is composited into
the final momentum score and used to dynamically adjust:
• Profit target percentage (3% + up to 2% bonus based on catalyst strength)
• Entry signal threshold sensitivity
This models the well-documented market behavior where Bitcoin and crypto assets
rally in anticipation of favorable regulatory outcomes — and gives the strategy
a time-aware edge over purely technical momentum approaches.
2. THE MOMENTUM COMPOSITE SCORE
On each 60-minute bar close, the bot computes a 0-100 composite score:
score = 50.0 (baseline)
+ 30.0 x tanh_approx(trend_strength) # SMA fast vs slow trend
+ 20.0 x tanh_approx(momentum_return) # recent return direction
+ (RSI - 50) x 0.4 # RSI deviation from neutral
+ +/-15.0 for MACD sign # MACD above/below zero
+ 10.0 if close >= Donchian high # channel breakout
+ 10.0 x tanh_approx(vol_ratio - 1.0) # volume surge
+ 10.0 x catalyst_bias # regulatory proximity
Entry fires when:
trend_aligned = True (fast SMA > slow SMA)
AND score >= dynamic_threshold (~50 +/- 10, adjusted for volatility regime)
The use of tanh-approximation normalizers (x / (|x| + epsilon)) prevents any
single component from dominating the score, making the signal robust across
different volatility environments.
3. DYNAMIC ATR-BASED RISK SIZING
Stop distance is calibrated dynamically:
ATR multiplier = 2.0-3.0 (based on VIX-proxy)
VIX-proxy <= 15 -> 2.0x (low vol regime: tighter stops)
VIX-proxy >= 35 -> 3.0x (high vol regime: wider stops)
Position size (contracts) =
(account_capital x risk_pct) / (stop_distance x contract_multiplier x point_value)
x VIX size adjustment (0.25-1.0)
x volatility adjustment (ATR baseline / ATR effective)
x momentum size scale
capped at max_contracts = 2
Risk percent = 1-2% of account (dynamically shrunk in high-vol environments)
VIX proxy size scaling:
> 35 VIX units -> 0.25x (quarter size — extreme vol caution)
> 25 VIX units -> 0.5x
>= 15 VIX units -> 0.75x
< 15 VIX units -> 1.0x
4. THREE-TIER PARTIAL SCALE-OUT ARCHITECTURE
When a position is entered, three exit levels are pre-computed:
Level 1 = entry + 1R (stop_distance x rr_ratio x 0.5) -> exit 50% of position
Level 2 = entry + 2R (stop_distance x rr_ratio x 0.75) -> exit 25% of remaining
Level 3 = entry + 3R (stop_distance x rr_ratio x 1.0) -> exit remainder
This architecture locks in partial profits at 1R while letting the remaining
position ride toward 2R and 3R targets — a professional-grade scale-out that
improves realized P&L stability versus all-or-nothing exits.
5. EXIT LOGIC HIERARCHY
The strategy uses a four-layer exit hierarchy applied on every execution bar:
Priority 1: Protective stop (hard stop price or trailing stop, whichever is
tighter) — enforced on every market tick, not just bar close
Priority 2: Three partial profit targets (1R / 2R / 3R) on each 5-minute
execution bar close
Priority 3: Time-based exit — if position held > dynamic max hold bars
(5-20 bars based on vol regime), exit to prevent overnight/
excessive-hold decay
Priority 4: Thesis invalidation — if fast MA crosses below slow MA AND MACD
goes negative AND RSI < 50 simultaneously, the original momentum
thesis is considered invalidated and position is closed
Priority 5: Session profit target — if daily realized P&L reaches 3-5% of
account capital (adjusted by catalyst bias), lock in the day's
gains by exiting all remaining position
6. CIRCUIT BREAKER & RISK CONTROL SYSTEM
Five independent circuit breakers gate new entries and protect capital:
CB1 — Daily loss limit:
Computed dynamically as -(ATR x contracts x point_value x session_risk_multiplier)
Stops new entries if daily P&L <= this threshold
CB2 — Weekly loss limit:
min(daily_loss_limit x 2, 10% of account capital)
Stops new entries if weekly P&L <= this threshold
CB3 — Consecutive losses:
Rejects new entries after 5 consecutive losing trades
Triggers cooldown mode (see CB5)
CB4 — CME maintenance window exclusion:
Mon-Thu 5:00-6:00 PM ET and Fri 4:00-5:00 PM ET are blocked
Prevents entering during exchange downtime / roll risk windows
CB5 — Cooldown period:
After 5 consecutive losses, the bot enters a cooldown period until
end-of-day (UTC), preventing revenge-trading
Additionally: spread gate (P95 spread vs dynamic limit) and stale-data gate
(feed age vs poll interval) provide execution-quality filters on every entry.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TECHNICAL SPECIFICATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Instrument : Micro Bitcoin Futures (MBTM6)
Exchange : CME (Chicago Mercantile Exchange)
Direction : LONG
Signal Timeframe : 60-minute bars
Execution Timeframe : 5-minute bars
Max Contracts : 2
Point Value : $0.10 per point (env-overridable)
Default Account Cap : $50,000 (env-overridable)
Base Risk Per Trade : 1% of account (env-overridable)
Max Risk Per Trade : 2% of account (env-overridable)
ATR Period : 14 bars
ATR Multiplier Range : 2.0x - 3.0x (dynamic, VIX-proxy based)
Holding Period : 5 - 20 execution bars (dynamic)
Profit Targets : 1R / 2R / 3R (3-tier partial scale-out)
Stop Type : Initial hard stop + trailing ATR stop
Warmup Bars Required : 20 signal bars
Consec. Loss Limit : 5 trades
Generation : Gen1 (pre-Gen2 AI probability enhancement)
Language : Python 3.10+
Lines of Code : ~895
Broker Dependencies : None (portable version — stub only)
Created : September 8, 2026
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
KEY FEATURES AT A GLANCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Regulatory Catalyst Engine — unique time-decay proximity function anchored
to known legislative vote dates gives this strategy a temporal edge
unavailable in purely technical approaches.
[+] 6-Component Momentum Score — SMA crossover + RSI + MACD + Donchian channel
breakout + Volume surge + Regulatory proximity all composited into a single
0-100 score with non-linear normalizers for crypto robustness.
[+] Regime-Adaptive Risk Sizing — VIX-proxy dynamically scales stop distances
and position sizes. In extreme volatility (VIX-proxy > 35), size cuts to
25% of normal — protecting capital during crypto flash crashes.
[+] Professional 3-Tier Scale-Out — partial exits at 1R, 2R, and 3R ensure
you never give back all your gains waiting for the final target.
[+] Five-Layer Circuit Breaker Stack — daily loss limit, weekly loss limit,
consecutive-loss cooldown, CME maintenance window exclusion, and
data-staleness gate — a complete institutional-grade risk management stack.
[+] Trailing Stop + Thesis Invalidation Exit — the bot tightens its stop as
the trade moves in your favor, and closes if the momentum thesis is
invalidated (MA flip + MACD negative + RSI < 50).
[+] Broker-Agnostic Portable Format — all Rithmic/Redis/dotenv dependencies
stripped, BaseTradingBot stub included, clearly marked integration points.
[+] Fully Documented & Readable Code — JSON-structured logging throughout
makes debugging and performance analysis straightforward.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHO THIS IS FOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[*] Python developers wanting a complete, well-structured crypto futures bot
as a learning reference or starting scaffold.
[*] Algo traders wanting a professionally designed event-driven momentum
framework adaptable to any regulatory or macro catalyst calendar.
[*] Students of quantitative finance studying composite momentum signals,
dynamic risk sizing, and multi-layer exit architectures.
[*] Researchers wanting to backtest a regulatory-event-driven Bitcoin futures
strategy using their own historical data pipeline.
[*] Developers integrating crypto futures strategies into IBKR, Alpaca, or
custom broker gateways who want a battle-tested reference implementation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GEN1 vs GEN2: UNDERSTANDING THE DIFFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This is a Gen1 strategy — built on pure technical + catalyst signal logic.
Gen2 bots (not included) add an AI-derived probability layer for +5-10%
improvement in entry selectivity.
Feature Gen1 (this) Gen2 (not included)
SMA/RSI/MACD composite signal YES YES
Regulatory proximity catalyst YES YES
ATR dynamic stops YES YES
3-tier partial scale-out YES YES
Circuit breaker stack YES YES
AI probability enhancement NO YES
Signal quality Baseline +5-10% improvement
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FREQUENTLY ASKED QUESTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Q: What broker or platform does this work with?
A: The portable file has all Rithmic/Redis broker code removed. It includes a
BaseTradingBot stub with clearly marked "# BROKER INTEGRATION:" comments
showing exactly where to plug in your broker's order submission, market data
feed, and fill callback. Compatible with any Python-accessible broker API:
Interactive Brokers (ib_insync), Alpaca, NinjaTrader, TradeStation, or custom.
Q: What account size do I need to trade MBTM6?
A: Micro Bitcoin (MBT) futures have lower margin requirements than full BTC
contracts. CME margin requirements change — check current SPAN margin with
your broker. The bot defaults to a $50,000 account capital assumption, which
can be changed via the MBT_ACCOUNT_CAPITAL environment variable. At 1-2%
risk per trade with max 2 contracts, the strategy is sized conservatively.
Q: Is this strategy fully automated or does it require manual decisions?
A: Designed for full automation. All entry, exit, sizing, and risk decisions are
made programmatically. You must handle order submission via your broker's API
at the marked "# BROKER INTEGRATION:" points.
Q: How many trades per month should I expect?
A: This is a high-selectivity strategy. Expect anywhere from 2-15 trades per
month depending on market conditions and how close the current date is to the
regulatory vote anchor (default: September 15).
Q: Can I change the vote date or use a different event?
A: Yes. The vote date is a single line in execute_strategy:
vote_date = datetime(year=now.year, month=9, day=15, tzinfo=timezone.utc)
Change month/day to match any scheduled event: Fed meeting, ETF approval
hearing, SEC deadline, earnings, etc.
Q: Can I backtest this strategy?
A: Yes. Replace the BaseTradingBot stub's on_bar_closed and on_market_data hooks
with your backtesting engine's event callbacks. The entire strategy logic lives
in those methods with no hidden state.
Q: What Python version is required?
A: Python 3.10 or later. Standard library only in the portable version — no
third-party packages required beyond what your broker integration needs.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INTEGRATION QUICK-START GUIDE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Install: pip install <your broker library>
Step 2 — Find integration points:
grep -n "BROKER INTEGRATION" bot_mbtc_regulatory_momentum_portable.py
Step 3 — Fill market data feed in on_market_data(data):
Pass a dict: {"price": float, "bid": float, "ask": float, "symbol": str}
Step 4 — Fill bar feed in on_bar_closed(tf_key, bar):
tf_key = "signal" (60m) or "execution" (5m)
bar = {"open": float, "high": float, "low": float, "close": float,
"volume": float, "spread_stats": {"mean": float}}
Step 5 — Fill order submission at # BROKER INTEGRATION: SUBMIT ORDER points:
Call your broker buy/sell API using self.sim_entry_price, self.sim_position,
and self.stop_price
Step 6 — Run:
bot = MicroBitcoinRegulatoryMomentumBot()
asyncio.run(bot.run())
Step 7 — Tune (optional) via env vars:
MBT_ACCOUNT_CAPITAL=50000
MBT_RISK_PCT=0.01
MBT_MAX_RISK_PCT=0.02
MBT_POINT_VALUE=0.1
MBT_TRADEABLE=true
MBT_MIN_STOP_TICKS=5
MBT_TICK_SIZE=1.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RISK DISCLAIMER — PLEASE READ BEFORE PURCHASING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This product is sold for EDUCATIONAL AND INFORMATIONAL PURPOSES ONLY.
Futures trading involves a substantial risk of loss and is not appropriate for
all investors. Trading cryptocurrency futures (including Micro Bitcoin/MBTM6)
involves additional risks due to extreme price volatility, 24-hour market
operation, liquidity gaps, and regulatory uncertainty.
The strategy code provided:
* Has NOT been independently verified or audited
* Is NOT a registered investment advisor product
* Does NOT constitute financial, investment, or trading advice
* Is NOT guaranteed to be profitable
* Has a limited live-trade backtest sample (see Backtest Disclosure above)
Past performance, simulated performance, or developer estimates are NOT
indicative of future results.
You are solely responsible for your own trading decisions, compliance with all
applicable laws, proper paper-trade testing before live deployment, understanding
leverage and margin requirements, and any losses incurred through use of this
software. Consult a licensed financial advisor before trading futures.
By purchasing this product you acknowledge and accept all risks described above.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT YOU ARE BUYING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You receive a single Python file (~895 lines) containing a complete, live-tested
algorithmic trading strategy written for CME Micro Bitcoin Futures (MBTM6).
The portable file has had all proprietary broker-connectivity code (Rithmic API,
Redis message bus, registry manager, dotenv) surgically removed and replaced with
clearly-marked placeholder comments (# BROKER INTEGRATION: ...). Every single
line of strategy logic — the regulatory catalyst scoring, momentum composite,
ATR-based risk sizing, partial scale-outs, circuit breakers, and execution
framework — is 100% intact.
A self-contained BaseTradingBot stub is injected at the top of the file, giving
you a complete, runnable class hierarchy that you can wire to any broker API,
paper-trading engine, or backtesting framework.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BOT CREATION DATE & CONTEXT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Created: September 8, 2026 · 5:24 PM CT
Run stamp: run_2026-09-08_172418
This bot was developed in the context of the U.S. CLARITY Act legislative
calendar — a crypto-market-structure bill that created recurring, predictable
periods of heightened directional momentum in Bitcoin futures as institutional
participants positioned ahead of scheduled Congressional votes. The strategy
captures that window using a composite momentum filter anchored by a time-decay
proximity signal relative to a known vote date.
The strategy was first run live on CME Micro Bitcoin (MBTM6) on September 8, 2026,
and has been preserved in the bar_historical archive of the QLN live-trading
research repository.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BACKTEST PERFORMANCE — HONEST DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANT: Read before purchasing.
This strategy is classified as "paper / Gen1" in our internal backtesting
pipeline. Our pipeline requires a minimum of 20 trades and 2+ profitable months
of live backtest data before a strategy is promoted to the "profitable bot
ranking" — this bot does not currently appear in that ranking.
WHY THE LOW TRADE COUNT?
This is an event-driven strategy tied to a specific legislative calendar event
(a regulatory vote proxy dated September 15). The strategy has a high-selectivity
entry filter — it only enters when:
1. 60-minute trend is aligned (fast MA > slow MA)
2. Composite momentum score exceeds a dynamic threshold
3. Catalyst proximity bias is elevated
4. No circuit breakers are active
5. Spread and staleness gates are passed
In practice this means the bot may generate only a handful of entries per month.
A low trade count is a design feature, not a defect — the strategy is built to
wait for high-probability setups rather than churn.
WHAT THE CODE DEMONSTRATES:
Even with a limited live-backtest trade sample, this strategy is valuable as a
study in:
• Regulatory catalyst signal construction
• Multi-layer momentum composite scoring (RSI + MACD + Donchian + Volume)
• Dynamic ATR-based stop calibration under crypto volatility regimes
• Partial scale-out architecture (3-tier: 1R, 2R, 3R)
• Professional-grade circuit breaker design
• Event-driven entry timing using time-decay proximity functions
ESTIMATED SHORT-TERM PROFIT POTENTIAL (from source code header):
$1,200 – $4,500 (developer estimate, not guaranteed, not backtested performance)
STARTING CAPITAL ASSUMED IN INTERNAL PIPELINE: $17,092
ACCOUNT CAPITAL DEFAULT IN BOT: $50,000
Past potential estimates are not guarantees of future performance.
Futures trading involves substantial risk of loss. See full risk disclaimer below.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
STRATEGY ARCHITECTURE DEEP-DIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. THE REGULATORY CATALYST ENGINE
The strategy's most distinctive feature is a time-decay proximity function
that generates a "catalyst bias" score based on how close the current date is
to a known legislative vote date (default: September 15).
days_to_vote = (vote_date - today).days
proximity = max(0.0, 1.0 - days_to_vote / 30.0) # ramps up to 1.0 at vote date
pre_vote_bias = 1.0 if days_to_vote >= 0 else -0.5 # bullish pre-vote, muted post
catalyst_bias = proximity x pre_vote_bias
This generates a continuous [0.0, 1.0] catalyst boost that is composited into
the final momentum score and used to dynamically adjust:
• Profit target percentage (3% + up to 2% bonus based on catalyst strength)
• Entry signal threshold sensitivity
This models the well-documented market behavior where Bitcoin and crypto assets
rally in anticipation of favorable regulatory outcomes — and gives the strategy
a time-aware edge over purely technical momentum approaches.
2. THE MOMENTUM COMPOSITE SCORE
On each 60-minute bar close, the bot computes a 0-100 composite score:
score = 50.0 (baseline)
+ 30.0 x tanh_approx(trend_strength) # SMA fast vs slow trend
+ 20.0 x tanh_approx(momentum_return) # recent return direction
+ (RSI - 50) x 0.4 # RSI deviation from neutral
+ +/-15.0 for MACD sign # MACD above/below zero
+ 10.0 if close >= Donchian high # channel breakout
+ 10.0 x tanh_approx(vol_ratio - 1.0) # volume surge
+ 10.0 x catalyst_bias # regulatory proximity
Entry fires when:
trend_aligned = True (fast SMA > slow SMA)
AND score >= dynamic_threshold (~50 +/- 10, adjusted for volatility regime)
The use of tanh-approximation normalizers (x / (|x| + epsilon)) prevents any
single component from dominating the score, making the signal robust across
different volatility environments.
3. DYNAMIC ATR-BASED RISK SIZING
Stop distance is calibrated dynamically:
ATR multiplier = 2.0-3.0 (based on VIX-proxy)
VIX-proxy <= 15 -> 2.0x (low vol regime: tighter stops)
VIX-proxy >= 35 -> 3.0x (high vol regime: wider stops)
Position size (contracts) =
(account_capital x risk_pct) / (stop_distance x contract_multiplier x point_value)
x VIX size adjustment (0.25-1.0)
x volatility adjustment (ATR baseline / ATR effective)
x momentum size scale
capped at max_contracts = 2
Risk percent = 1-2% of account (dynamically shrunk in high-vol environments)
VIX proxy size scaling:
> 35 VIX units -> 0.25x (quarter size — extreme vol caution)
> 25 VIX units -> 0.5x
>= 15 VIX units -> 0.75x
< 15 VIX units -> 1.0x
4. THREE-TIER PARTIAL SCALE-OUT ARCHITECTURE
When a position is entered, three exit levels are pre-computed:
Level 1 = entry + 1R (stop_distance x rr_ratio x 0.5) -> exit 50% of position
Level 2 = entry + 2R (stop_distance x rr_ratio x 0.75) -> exit 25% of remaining
Level 3 = entry + 3R (stop_distance x rr_ratio x 1.0) -> exit remainder
This architecture locks in partial profits at 1R while letting the remaining
position ride toward 2R and 3R targets — a professional-grade scale-out that
improves realized P&L stability versus all-or-nothing exits.
5. EXIT LOGIC HIERARCHY
The strategy uses a four-layer exit hierarchy applied on every execution bar:
Priority 1: Protective stop (hard stop price or trailing stop, whichever is
tighter) — enforced on every market tick, not just bar close
Priority 2: Three partial profit targets (1R / 2R / 3R) on each 5-minute
execution bar close
Priority 3: Time-based exit — if position held > dynamic max hold bars
(5-20 bars based on vol regime), exit to prevent overnight/
excessive-hold decay
Priority 4: Thesis invalidation — if fast MA crosses below slow MA AND MACD
goes negative AND RSI < 50 simultaneously, the original momentum
thesis is considered invalidated and position is closed
Priority 5: Session profit target — if daily realized P&L reaches 3-5% of
account capital (adjusted by catalyst bias), lock in the day's
gains by exiting all remaining position
6. CIRCUIT BREAKER & RISK CONTROL SYSTEM
Five independent circuit breakers gate new entries and protect capital:
CB1 — Daily loss limit:
Computed dynamically as -(ATR x contracts x point_value x session_risk_multiplier)
Stops new entries if daily P&L <= this threshold
CB2 — Weekly loss limit:
min(daily_loss_limit x 2, 10% of account capital)
Stops new entries if weekly P&L <= this threshold
CB3 — Consecutive losses:
Rejects new entries after 5 consecutive losing trades
Triggers cooldown mode (see CB5)
CB4 — CME maintenance window exclusion:
Mon-Thu 5:00-6:00 PM ET and Fri 4:00-5:00 PM ET are blocked
Prevents entering during exchange downtime / roll risk windows
CB5 — Cooldown period:
After 5 consecutive losses, the bot enters a cooldown period until
end-of-day (UTC), preventing revenge-trading
Additionally: spread gate (P95 spread vs dynamic limit) and stale-data gate
(feed age vs poll interval) provide execution-quality filters on every entry.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TECHNICAL SPECIFICATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Instrument : Micro Bitcoin Futures (MBTM6)
Exchange : CME (Chicago Mercantile Exchange)
Direction : LONG
Signal Timeframe : 60-minute bars
Execution Timeframe : 5-minute bars
Max Contracts : 2
Point Value : $0.10 per point (env-overridable)
Default Account Cap : $50,000 (env-overridable)
Base Risk Per Trade : 1% of account (env-overridable)
Max Risk Per Trade : 2% of account (env-overridable)
ATR Period : 14 bars
ATR Multiplier Range : 2.0x - 3.0x (dynamic, VIX-proxy based)
Holding Period : 5 - 20 execution bars (dynamic)
Profit Targets : 1R / 2R / 3R (3-tier partial scale-out)
Stop Type : Initial hard stop + trailing ATR stop
Warmup Bars Required : 20 signal bars
Consec. Loss Limit : 5 trades
Generation : Gen1 (pre-Gen2 AI probability enhancement)
Language : Python 3.10+
Lines of Code : ~895
Broker Dependencies : None (portable version — stub only)
Created : September 8, 2026
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
KEY FEATURES AT A GLANCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Regulatory Catalyst Engine — unique time-decay proximity function anchored
to known legislative vote dates gives this strategy a temporal edge
unavailable in purely technical approaches.
[+] 6-Component Momentum Score — SMA crossover + RSI + MACD + Donchian channel
breakout + Volume surge + Regulatory proximity all composited into a single
0-100 score with non-linear normalizers for crypto robustness.
[+] Regime-Adaptive Risk Sizing — VIX-proxy dynamically scales stop distances
and position sizes. In extreme volatility (VIX-proxy > 35), size cuts to
25% of normal — protecting capital during crypto flash crashes.
[+] Professional 3-Tier Scale-Out — partial exits at 1R, 2R, and 3R ensure
you never give back all your gains waiting for the final target.
[+] Five-Layer Circuit Breaker Stack — daily loss limit, weekly loss limit,
consecutive-loss cooldown, CME maintenance window exclusion, and
data-staleness gate — a complete institutional-grade risk management stack.
[+] Trailing Stop + Thesis Invalidation Exit — the bot tightens its stop as
the trade moves in your favor, and closes if the momentum thesis is
invalidated (MA flip + MACD negative + RSI < 50).
[+] Broker-Agnostic Portable Format — all Rithmic/Redis/dotenv dependencies
stripped, BaseTradingBot stub included, clearly marked integration points.
[+] Fully Documented & Readable Code — JSON-structured logging throughout
makes debugging and performance analysis straightforward.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHO THIS IS FOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[*] Python developers wanting a complete, well-structured crypto futures bot
as a learning reference or starting scaffold.
[*] Algo traders wanting a professionally designed event-driven momentum
framework adaptable to any regulatory or macro catalyst calendar.
[*] Students of quantitative finance studying composite momentum signals,
dynamic risk sizing, and multi-layer exit architectures.
[*] Researchers wanting to backtest a regulatory-event-driven Bitcoin futures
strategy using their own historical data pipeline.
[*] Developers integrating crypto futures strategies into IBKR, Alpaca, or
custom broker gateways who want a battle-tested reference implementation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GEN1 vs GEN2: UNDERSTANDING THE DIFFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This is a Gen1 strategy — built on pure technical + catalyst signal logic.
Gen2 bots (not included) add an AI-derived probability layer for +5-10%
improvement in entry selectivity.
Feature Gen1 (this) Gen2 (not included)
SMA/RSI/MACD composite signal YES YES
Regulatory proximity catalyst YES YES
ATR dynamic stops YES YES
3-tier partial scale-out YES YES
Circuit breaker stack YES YES
AI probability enhancement NO YES
Signal quality Baseline +5-10% improvement
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FREQUENTLY ASKED QUESTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Q: What broker or platform does this work with?
A: The portable file has all Rithmic/Redis broker code removed. It includes a
BaseTradingBot stub with clearly marked "# BROKER INTEGRATION:" comments
showing exactly where to plug in your broker's order submission, market data
feed, and fill callback. Compatible with any Python-accessible broker API:
Interactive Brokers (ib_insync), Alpaca, NinjaTrader, TradeStation, or custom.
Q: What account size do I need to trade MBTM6?
A: Micro Bitcoin (MBT) futures have lower margin requirements than full BTC
contracts. CME margin requirements change — check current SPAN margin with
your broker. The bot defaults to a $50,000 account capital assumption, which
can be changed via the MBT_ACCOUNT_CAPITAL environment variable. At 1-2%
risk per trade with max 2 contracts, the strategy is sized conservatively.
Q: Is this strategy fully automated or does it require manual decisions?
A: Designed for full automation. All entry, exit, sizing, and risk decisions are
made programmatically. You must handle order submission via your broker's API
at the marked "# BROKER INTEGRATION:" points.
Q: How many trades per month should I expect?
A: This is a high-selectivity strategy. Expect anywhere from 2-15 trades per
month depending on market conditions and how close the current date is to the
regulatory vote anchor (default: September 15).
Q: Can I change the vote date or use a different event?
A: Yes. The vote date is a single line in execute_strategy:
vote_date = datetime(year=now.year, month=9, day=15, tzinfo=timezone.utc)
Change month/day to match any scheduled event: Fed meeting, ETF approval
hearing, SEC deadline, earnings, etc.
Q: Can I backtest this strategy?
A: Yes. Replace the BaseTradingBot stub's on_bar_closed and on_market_data hooks
with your backtesting engine's event callbacks. The entire strategy logic lives
in those methods with no hidden state.
Q: What Python version is required?
A: Python 3.10 or later. Standard library only in the portable version — no
third-party packages required beyond what your broker integration needs.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INTEGRATION QUICK-START GUIDE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Install: pip install <your broker library>
Step 2 — Find integration points:
grep -n "BROKER INTEGRATION" bot_mbtc_regulatory_momentum_portable.py
Step 3 — Fill market data feed in on_market_data(data):
Pass a dict: {"price": float, "bid": float, "ask": float, "symbol": str}
Step 4 — Fill bar feed in on_bar_closed(tf_key, bar):
tf_key = "signal" (60m) or "execution" (5m)
bar = {"open": float, "high": float, "low": float, "close": float,
"volume": float, "spread_stats": {"mean": float}}
Step 5 — Fill order submission at # BROKER INTEGRATION: SUBMIT ORDER points:
Call your broker buy/sell API using self.sim_entry_price, self.sim_position,
and self.stop_price
Step 6 — Run:
bot = MicroBitcoinRegulatoryMomentumBot()
asyncio.run(bot.run())
Step 7 — Tune (optional) via env vars:
MBT_ACCOUNT_CAPITAL=50000
MBT_RISK_PCT=0.01
MBT_MAX_RISK_PCT=0.02
MBT_POINT_VALUE=0.1
MBT_TRADEABLE=true
MBT_MIN_STOP_TICKS=5
MBT_TICK_SIZE=1.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RISK DISCLAIMER — PLEASE READ BEFORE PURCHASING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This product is sold for EDUCATIONAL AND INFORMATIONAL PURPOSES ONLY.
Futures trading involves a substantial risk of loss and is not appropriate for
all investors. Trading cryptocurrency futures (including Micro Bitcoin/MBTM6)
involves additional risks due to extreme price volatility, 24-hour market
operation, liquidity gaps, and regulatory uncertainty.
The strategy code provided:
* Has NOT been independently verified or audited
* Is NOT a registered investment advisor product
* Does NOT constitute financial, investment, or trading advice
* Is NOT guaranteed to be profitable
* Has a limited live-trade backtest sample (see Backtest Disclosure above)
Past performance, simulated performance, or developer estimates are NOT
indicative of future results.
You are solely responsible for your own trading decisions, compliance with all
applicable laws, proper paper-trade testing before live deployment, understanding
leverage and margin requirements, and any losses incurred through use of this
software. Consult a licensed financial advisor before trading futures.
By downloading this product you acknowledge and accept all risks described above.