01. The Quantitative Reality: The Baseline Hurdle Invariant
Most retail trading strategies rely on overfitting past curves—adjusting technical parameters until historical charts look profitable. In live execution, these models collapse because they fail to account for transaction friction and lack genuine mathematical edge.
trend-pullback rejects curve-fitting by enforcing the Baseline Hurdle Invariant:
- The Randomized Hurdle: A strategy is benchmarked against entering on any arbitrary candle using identical stop-loss and profit-target geometry. If the setup does not statistically beat random entries, it is rejected.
- Dual-Epoch Validation: Performance is split into two disjoint timeframes: Development (up to Oct 2024) and Out-of-Sample Validation (Nov 2024 to present). A setup must be net positive in both.
- Zero Execution Illusion: No exchange API keys exist in the system. The platform maintains isolated virtual paper books ($2,200 starting capital per book, 2% risk ceiling) to verify execution slippage in real market conditions.
02. What Survived the Tests: Statistical Findings
Hundreds of setup variations across 146 equities, ETFs, and major cryptocurrencies were evaluated. Only setups demonstrating robust statistical significance were promoted to alert status:
| Asset Universe | Setup Pattern | Performance (Dev / Out-of-Sample) | Status |
|---|---|---|---|
| US Equities (84 assets) | Daily Trap + Trend (8 & 80 EMA) | +0.15R / +0.15R (Base: +0.07R / -0.06R) | ACTIVE ALERTS |
| US Equities (84 assets) | Weekly Trap (Multi-Week Pullback) | +0.27R / +0.19R (Base: +0.24R / +0.12R) | ACTIVE ALERTS |
| Crypto (BTC, ETH, SOL) | Daily & Weekly Traps | Exceeded baseline (sample size limited) | EM OBSERVAÇÃO |
| BR Equities (62 assets) | All Tested Variations | 0 setups beat baseline after transaction fees | REJECTED (DASH ONLY) |
“Intraday day-trade setups (15m, 1h), mechanical SMC setups, and Brazilian equities were systematically dropped because none beat the randomized entry baseline. We only follow what math proves.”— Vinicius Pontual, Systematic Research Notes
03. Four-Stage Lifecycle & Portfolio Risk Allocation
Alerts dispatched via Telegram conform to an atomic four-phase state machine that prevents duplicate notifications and enforces precise risk limits:
// 01: SINAL (Signal Generation)Dispatched immediately when technical triggers align. Sets entry price, target (2R minimum), stop loss, and execution window (16:00 NY close for US equities).
// 02: ENTROU (Position Allocation)Triggers when price crosses the entry threshold. Evaluates paper book capacity: 2% risk of current balance, maximum of 3 concurrent positions, and maximum 1 new trade per day.
// 03: SAIU (Position Liquidation)Closes the trade when target or stop is reached, or when the time ceiling elapses (30 sessions for daily setups, 12 weeks for weekly setups). Transaction costs are deducted.
// 04: VENCEU (Time Expiration)Trigger was not reached within the specified trading session. The setup is cleanly discarded with zero capital risk.
04. Multi-Crate Architecture & Automated Cron Daemon
The engine is architected as an industrial Cargo workspace managed under Linux/WSL via scheduled automated daemons:
05. Toolchain Specifications & Build Commands
Prerequisites, build scripts, and study commands:
| Component | Specification / Dependency |
|---|---|
| Compiler & Runtime | Rust 1.98.1+ (Tokio, Serde, Rayon) |
| Daemon Orchestration | WSL Ubuntu / Windows Task Scheduler (Hourly & 21:15 BRT) |
| Data Providers | Yahoo Finance Public Charts + Binance Public Klines |
| Dashboard Frontend | Next.js 15+ / Tailwind CSS / Upstash Redis (Vercel) |
cargo build --releasecargo run --release -- market-study --universe./target/release/tp alerts --dry-run