Statistica Engine
- Experts
- Version: 1.0
- Activations: 10
Statistica Engine is a comprehensive, institutional-grade automated trading algorithm designed specifically for the MetaTrader 5 platform. The core philosophy of the system is rooted in the mathematical concept of linear regression and mean reversion.
Financial markets exhibit distinct statistical patterns over extended periods. Price action tends to revert to a historical mean after deviating significantly from its established trend. Statistica Engine capitalizes on these deviations by continuously calculating dynamic regression channels and standard deviation bands in real time, executing trades at statistical extremes with high mathematical probability.
The system offers a calm, systematic, and highly configurable approach to market analysis, replacing emotional decision-making with cold, calculated execution.
Core Features and Architecture
Linear Regression and Statistical Bands
The algorithm continuously recalculates channel boundaries based on the line of best fit. Accompanying the central regression line are dynamic standard deviation bands. When price pierces the outer boundaries of these bands, it indicates a statistical anomaly—an extreme overbought or oversold condition. The algorithm identifies this structural exhaustion and enters the market, anticipating a reversion to the mean.
Market Regime Filter
Statistica Engine features a proprietary Market Regime Filter that analyzes volatility, directional momentum, and structural highs/lows. By categorizing the current market state as either trending or ranging, the regime filter dynamically adjusts the internal trading logic to ensure resilience across various market cycles.
Modular Framework
- Grid Module: Manages trades by strategically distributing risk across multiple price levels using Dynamic ATR Spacing. As volatility increases, the distance between grid levels dynamically widens to protect margin.
- Recovery Module: Automatically manages drawdowns by placing highly calculated secondary trades at structural support/resistance levels to shift the break-even price closer to the current market price.
- Scalp Module: Focuses on rapid, high-frequency execution during short-term volatility, exploiting micro-fluctuations inside the standard deviation bands.
- Alligator Module: Uses fractal geometry and moving average convergence to ensure structural trend alignment before executing a trade, filtering out false signals.
Strict Risk Management
The absolute priority of Statistica Engine is the preservation of capital.
- Portfolio Heat Limit: The ultimate fail-safe mechanism. The user defines the absolute maximum cumulative margin allowed. Once reached, the system will completely cease opening new positions to prevent over-leveraging.
- Asset Safety Filters: Built-in safety filters detect the underlying asset class, automatically restricting aggressive mean-reversion settings on highly volatile assets like metals to maintain a stable trading environment.
Comprehensive Input Parameters
General Settings
- Magic Number: A unique identifier for the expert advisor, required when running multiple instances on the same account.
- Base Lot: The starting volume size for the very first trade in a sequence.
- Risk Percent: The percentage of the total account balance to risk on a trade setup for dynamic lot sizing.
- Portfolio Heat Limit: The maximum allowed cumulative margin percentage for all open positions.
Strategy Modules and Toggles
- Use Dynamic ATR Spacing: Toggles volatility-based spacing for grid and recovery trades instead of fixed distances.
- Enable Grid Module: Toggles the scale-in linear regression logic.
- Enable Recovery Module: Toggles mathematical recovery on trades that move into drawdown.
- Enable Scalp Module: Toggles short-term, micro-fluctuation trading logic.
- Enable Alligator Module: Toggles the requirement for structural trend alignment before entry.
Performance Optimization Settings
- ATR Period: The number of historical bars used to calculate the Average True Range.
- Linear Regression Period: The number of data points used to calculate the core macro channel.
- Standard Deviation Multiplier: Determines how wide the statistical bands are drawn away from the central regression line (e.g., 2.0 covers approx 95% of normal price action).
Broker Requirements
We highly recommend utilizing an ECN or STP broker offering raw spreads and fast execution speeds. High latency or excessively wide spreads fundamentally distort statistical calculations and drastically reduce the profitability of mean-reversion trades. A dedicated Virtual Private Server (VPS) is strongly recommended.
Support and Feedback
All technical support, bug reports, and questions regarding parameter configurations are handled exclusively through the MQL5 comments section and the MQL5 personal messaging system. Please ensure you test the system thoroughly in the Strategy Tester on "Every tick based on real ticks" before deploying to a live environment.
