Caicai Long and Short Pair Trading
- エキスパート
- Thiago Lopes
- バージョン: 8.0
- アップデート済み: 21 4月 2026
- アクティベーション: 20
CaicaiLS Pro is an institutional-grade quantitative Expert Advisor designed for Long & Short (Pair Trading) operations using Statistical Arbitrage. Developed for demanding traders, it tracks correlation and cointegration anomalies across multiple asset pairs simultaneously, seeking profit in both mean reversion and momentum breakouts.
Its architecture has evolved to be even more versatile, now featuring hybrid execution (real + virtual) and adaptive per-leg intelligence. It operates with excellence in Stocks, ETFs, and Futures, as well as Forex, Cryptocurrencies, and Global Indices (USA30, USA500). The EA features a multi-tab interactive on-chart dashboard (Overview + Telemetry) that offers full control and real-time analytical visibility of your entire portfolio.
🔥 What's New in Version 8.0 Pro? (Smart Execution + Telemetry)
- 🧠 "Smart Single Leg" Mode (Continuous Self-Learning): Trade only the most profitable leg of the pair (Y or X) in the real market, while the other is simulated internally. Through a self-learning logic based on historical trade data, the EA automatically identifies which asset has the best financial performance (Net P/L) and shifts its focus solely to it. This drastically reduces allocated capital and brokerage costs, and eliminates the risk of imperfect hedging, actively adapting to what is working best at the moment.
- 📊 Comprehensive Per-Leg Telemetry + Dynamic MAE/MFE: Separate statistics for each asset in the pair (wins/losses, gross win/loss, net P/L). Live tracking of MAE (Maximum Adverse Excursion) and MFE (Maximum Favorable Excursion) for each leg and the pair, with a circular buffer of the last N trades. Now you know exactly which leg is driving your profits.
- ⏱️ Exits Based on Historical MAE/MFE: The EA no longer relies solely on fixed stops or financial targets. It compares the current adverse/favorable excursion against the historical average (configurable window) and decides to close the trade when the deviation exceeds an adjustable percentage—a true "statistical take profit and stop loss" system.
- 🔄 Automatic Futures Rollover: Extracts the asset root (e.g., WINM26 → WIN) and merges the history between expirations, ensuring operational continuity even during contract swaps. The pair's magic number is generated from the root, preserving statistics and virtual positions.
- 💾 State Persistence and Full Recovery: Virtual positions and all telemetry are saved in binary files. In the event of a MetaTrader restart, the EA instantly recovers the state of simulated legs and historical metrics, with zero data loss.
🌟 Main Highlights and Features (Version 8.0)
- 📈 Advanced Mathematical Models: Choose between the Logarithmic OLS (Ordinary Least Squares) or Ratio with Bollinger Bands models to calculate the Z-Score and pair dispersion.
- 🧠 Elite Quantitative Filters: Native integration with the Augmented Dickey-Fuller (ADF) test to validate true stationarity, and the Hurst Exponent to confirm the market regime, avoiding false breakouts. Also includes Volatility (ATR), Exhaustion (RSI on spread), and Multi-Timeframe (MTF) analysis.
- 🛡️ Institutional Risk Management: Multi-layered capital protection: Stop Loss by financial value, account percentage, or Emergency Z-Score Limit. Auto-close by time (Day Trade) and daily Global Gain/Loss targets.
- ⚖️ Smart Position Sizing: Configurable leg balancing in Cash Neutral (equal financial exposure) or Beta Neutral (volatility/Beta weighted) modes.
- 🔄 Auto-Hedge Scaling: Exclusive automatic lot scaling system to correct broker rounding errors (Tick Size / Lot Step) and ensure a perfect hedge—or, in Single Leg mode, this logic is bypassed, eliminating the problem at its root.
- 📊 Smart Grid and Scaling In: Up to 3 dynamic reentry levels per pair, with progressive Z-Score triggers, protected by a Minimum Grid Distance filter (in money, account %, or exposure %).
- ⚙️ Execution and Market Filters: Yield% filter (real variation, now automatic by history), Auction Check block, maximum spread, and controlled slippage in real Points, Pips, or Ticks, plus strict directional control (allowed short/longs).
- 🖥️ Professional Interactive Dashboard (New Telemetry Tab): Complete panel with a High-Tech design, now featuring two tabs:
• Overview: Z-Score (with peaks), Yield%, Correlation, ADF, Hurst, P/L, Profit Factor, RSI, and status of each pair.
• Telemetry: Trades (W/L) and Net P/L per leg (Y and X), average MAE/MFE of each asset and the pair, dominance indicator, and Smart Single Leg status.
Additionally, it maintains an automatic ranking of the Top 3 Best/Worst Pairs (Net P/L) and Profit Factor, a daily target progress bar, and pagination for large portfolios.
📌 Usage Recommendations and Markets
- 🌍 Asset Universality: The math behind statistical arbitrage is universal. Run it in any market with liquidity and cointegration:
• Brazil (B3): Stocks, FIIs, and Futures (WDO, WIN, DI1). The new auto-rollover function ensures continuous operation.
• Crypto: BTCUSD, ETHUSD, SOLUSD, and dozens of other pairs.
• Forex: EURUSD, GBPUSD, USDJPY, USDCAD, AUDUSD, EURGBP, CHFJPY, etc.
• Global Indices: USA30 (Dow), USA500 (S&P 500), NAS100 (Nasdaq), DAX40, UK100, etc. - 🪙 Ideal for Cent (Micro) Accounts and Real Accounts with Optimized Capital: The Smart Single Leg mode significantly reduces required margin, allowing Pair Trading even in smaller accounts. Works perfectly on Cent accounts (common for Forex and Indices), acting as a strategic gateway for real-world validation with reduced risk before scaling up.
- ⏱️ Timeframe: Adaptable to any timeframe, provided it is validated by prior cointegration tests.
⚠️ Warning: This EA is an advanced tool. A solid understanding of cointegration and testing on a Demo or Cent account is highly recommended before allocating significant capital. New features (Single Leg, MAE/MFE exits) should be tested in a simulated environment to fine-tune parameters.

