[ QUANT RESEARCH // 02 ]•SYSTEMATIC BACKTESTING•BASELINE-HURDLE ALERTS

trend-pullback: Quantitative Research & Baseline-Hurdled Alert Engine

A zero-delusion trading research engine built in Rust. Setups must prove statistical expectancy across multiple historical epochs and defeat randomized baseline benchmarks with fee slippage before publishing a single alert.

BY VINICIUS PONTUAL — QUANT SYSTEMS ARCHITECT
DEPLOYED: NOV 2026 // RUST 1.98+ WORKSPACE // TELEGRAM + NEXT.JS
[ SYSTEMATIC VALIDATION & ALERT STATE MACHINE ]DUAL-EPOCH EDGE
STAGE 01SINAL (SIGNAL)

Trigger price, 2R target, stop loss, and strict expiration deadline.

STAGE 02ENTROU (FILL)

Trigger crossed. Position allocated into virtual paper book (2% risk cap).

STAGE 03SAIU (EXIT)

Target hit, stop triggered, or max duration reached (30d daily, 12w weekly).

STAGE 04VENCEU (EXPIRED)

Trigger unreached within deadline. Clean cancellation without risk.

FIG 1.0: DETERMINISTIC SIGNAL LIFECYCLE WITH STRICT EXECUTION EXPIRATION[ RESEARCH & EXECUTION ENGINE ]
Trading Universe84 US Equities
Dual-Epoch FilterOut-of-Sample
Weekly Expectancy+0.27R / +0.19R
Execution Model100% Paper Only

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 UniverseSetup PatternPerformance (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 TrapsExceeded baseline (sample size limited)EM OBSERVAÇÃO
BR Equities (62 assets)All Tested Variations0 setups beat baseline after transaction feesREJECTED (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:

01 / tp-core: Mathematical indicators, Stormer trap algorithms, Smart Money pattern recognition, and trend filters shared across backtests and live monitoring.
02 / tp-data: Public data ingestion engines streaming Yahoo Finance equity feeds (15-min delayed) and Binance crypto archives, with Telegram publishing.
03 / tp-backtest & tp-report: Day-by-day deterministic portfolio simulation and HTML performance report generator.
04 / web/ (Dashboard): Next.js web application deployed on Vercel backed by Upstash Redis, visualizing live setups, account equity curves, and alert feeds.

05. Toolchain Specifications & Build Commands

Prerequisites, build scripts, and study commands:

ComponentSpecification / Dependency
Compiler & RuntimeRust 1.98.1+ (Tokio, Serde, Rayon)
Daemon OrchestrationWSL Ubuntu / Windows Task Scheduler (Hourly & 21:15 BRT)
Data ProvidersYahoo Finance Public Charts + Binance Public Klines
Dashboard FrontendNext.js 15+ / Tailwind CSS / Upstash Redis (Vercel)
BUILD: cargo build --release
RUN BACKTEST STUDIES: cargo run --release -- market-study --universe
DRY-RUN ALERTS: ./target/release/tp alerts --dry-run
// ENGINEERING DOSSIERS

Explore More Projects

All Projects →