
From Discretion to Determinism: A Scientific Examination of Manual Trading, Rule-Based EAs, and AI-Driven Execution

A scientific article on how discretionary trading compares with software controllers in markets with microstructure frictions, and why AI proposals must be governed by deterministic risk engines.
Abstract
This article formalizes three trading modalities as control systems acting on partially observed, non-stationary markets: (1) discretionary (“manual”) trading, (2) traditional rule-based Expert Advisors (EAs), and (3) AI-assisted EAs. Manual trading is modeled as a high-variance human controller with policy drift. Rule-based EAs are deterministic policies with bounded epistemic scope but strong identifiability and reproducibility. AI-assisted EAs separate an adaptive proposal layer from a deterministic permission layer that enforces risk budgets and microstructure constraints. Practical implications are derived for latency, governance, and evaluation. A canonical Trend-and-Momentum controller for XAUUSD provides a transparent baseline; an applied implementation, Ratio X AI Trading Professional (link), illustrates two-key AI design with deterministic fallback.
1. Introduction
Trading decisions must be made under latency constraints, regulatory auditability, and explicit risk budgets. Manual trading leverages human contextual reasoning but suffers from execution variance and policy instability. Software controllers standardize execution and enable scientific evaluation, but fixed rules may extrapolate poorly when regimes change. Modern systems increasingly decouple “what to do” from “what is allowed,” letting a learned component propose actions while a deterministic risk engine authorizes or blocks them.
We define a trading policy as a mapping from observed state to action under constraints imposed by market microstructure (commission, spread, minimum stop distances, freeze levels), capital (margin and leverage), and governance (drawdown budgets and exposure caps). Objectives therefore include expected return, variance control of execution quality, falsifiability of claims, and reproducibility across environments.
2. Background and Related Work
Optimal execution research formalizes the trade-off between impact and timing risk. Market microstructure literature explains spread behavior, order-book dynamics, and liquidity regimes. Empirical finance warns against overfitting and data-snooping, motivating out-of-sample validation, walk-forward testing, and selection-bias-adjusted performance metrics. Robust control provides a vocabulary for circuit breakers, drawdown gates, and conservative priors in uncertain regimes. These strands unify in practical EA engineering: realistic frictions in backtests, regime coverage, and risk-first design.
3. Modeling Manual Trading
A discretionary trader samples a multi-modal flow (charts, indicators, news, tape), forms beliefs about state variables (trend, volatility regime, order-flow imbalance), and acts. Two structural limitations dominate outcomes.
Latency and variance of execution. Human reaction time plus GUI and platform round-trip introduce random slippage, with variance that expands during liquidity micro-bursts. This widens the distribution of realized fill prices relative to deterministic execution.
Policy drift. The mapping from state to action changes with emotion, attention, incentives, and fatigue. Even with a written playbook, the applied policy is non-stationary. As a result, realized P&L entangles edge, noise, and policy drift; attribution of skill versus luck is fragile without standardized logs and rules.
4. Rule-Based Expert Advisors as Deterministic Controllers
A rule-based EA specifies a fixed, inspectable mapping from state to action. Once deployed, its parameters are invariant. This yields three scientific benefits: (i) identifiability of causal drivers because the decision rule is stable; (ii) reproducibility of results across backtest, paper, and live; (iii) latency control bound by platform and broker rather than human reaction.
Risk as a first-class constraint. Position size and trading permission are explicit functions of budgets and constraints. A canonical identity is:
Lots = (Risk% × Equity) / (SL in price units × PipValue)
Permission is also conditioned on margin sufficiency, exposure caps, and rolling drawdown gates. Circuit breakers convert adverse serial correlation into deterministic pauses that can be audited.
Evaluation protocol. Scientific evaluation requires: out-of-sample validation via rolling or walk-forward windows; microstructure realism (commission, stochastic spread profiles, minimum stop distances, freeze levels, latency-dependent slippage); regime coverage (trending, ranging, high/low volatility epochs); and distribution-aware metrics (Sharpe, Sortino, Calmar, Omega, and CVaR/Expected Shortfall).
Epistemic limits. Deterministic EAs are only as expressive as the features they observe. A controller that relies on EMA/RSI/MACD embodies a narrow inductive bias; when markets exit that manifold, extrapolation risk rises.
5. AI-Assisted EAs: Separation of Proposal and Permission
AI does not replace governance; it widens the hypothesis space. A reliable architecture separates an adaptive proposal layer from a deterministic permission layer. The proposal layer consumes structured market state and emits a recommended action with a calibrated confidence. The permission layer enforces Value-at-Risk and drawdown tiers, margin checks, maximum concurrent exposure, spread/latency guards, and broker constraints. Execution occurs only when both layers agree.
Failure modes and mitigations. AI introduces new surfaces: API availability, distribution shift, and miscalibration. Practical mitigations include out-of-sample tuned confidence thresholds; conservative priors when regime uncertainty is high; deterministic fallback when the AI is unreachable or underconfident; and live diagnostics such as feature stability indices and calibration curves linking confidence to realized win rate.
6. A Canonical Trend–Momentum Baseline (Gold)
For XAUUSD on H1/H4, a transparent baseline uses directional bias from EMA(50) versus EMA(200), strength from RSI(14) around the 50 threshold, and a momentum trigger from MACD line versus signal. A long is opened when bias is positive, RSI exceeds 50, and MACD confirms; a short is symmetric. Execution uses SL = 30 pips, TP = 60 pips, trailing after +20 pips, and a one-trade-per-trend invariant to reduce clustering risk. This policy is intentionally simple to permit auditability and regime testing.
Backtests must incorporate realistic friction: commission and time-of-day spread distributions; broker minimum stop and freeze levels; and slippage models that scale with volatility. Trailing-stop modifications must respect buffers to avoid “too close to market” errors at the trade server.
7. Case Application: Ratio X AI Trading Professional
Product page: https://www.mql5.com/en/market/product/148836
Design thesis. Ratio X is a two-key system: the AI proposes; a rule-based risk governor grants or denies permission. No single component can authorize risk alone.
State representation and analytics. The proposal layer ingests multi-timeframe indicators (RSI, EMA 9/21/50, MACD, ATR), regime tags (trend, range, volatile, crisis), account health, and the last 30 OHLC candles per timeframe, and returns a recommendation with a confidence score and human-readable rationale. Live analytics include Sharpe, Sortino, Calmar, Recovery Factor, Profit Factor, Omega, and CVaR with built-in stress testing.
Risk governor and execution engineering. The governor enforces confidence thresholds, VaR monitoring, drawdown tiers at 5%, 10%, and 15%, maximum open positions, margin sufficiency, and spread/latency guards. Execution supports market with spread control, limit with time-in-force, and TWAP fragmentation for smoother liquidity footprints. Position sizing modes include bounded Kelly, volatility budgets, and fixed lots.
Deterministic fallback (“Dumb Mode”). If the AI API is unavailable or underconfident, Ratio X reverts to deterministic playbooks: entries by EMA crosses and RSI thresholds, SL/TP via fixed distances or ATR multiples, with all risk gates remaining active. Continuity and auditability are preserved.
Operational envelope. Short-term (M1–H1) and long-term (H4–W1) horizons; any MT5 symbol supported by the broker with spread/latency monitoring; recommended leverage ≥ 1:30; indicative starting capital ≈ $200; MT5 WebRequest to https://api.openai.com and a valid OpenAI API key.
8. Experimental Protocol for Practitioners
Use tick data when available and partition into training, validation, and out-of-sample sets via rolling or walk-forward procedures. Avoid reporting optimization-set results as performance. Simulate stochastic spreads and latency-dependent slippage. Segment results by realized volatility quantiles and trend proxies to assess regime robustness. Report Sharpe and Sortino with selection-bias deflation (PSR/DSR), maximum drawdown with confidence bands, and CVaR at multiple tail levels. Perform governance tests to prove circuit breakers and exposure caps are non-bypassable. Induce synthetic stress (spread spikes, API outages) to verify fallback and pause behavior.
9. Discussion
Discretionary trading leverages human context modeling but exhibits high execution variance and policy drift. Rule-based EAs maximize reproducibility and throughput, yet their inductive bias is narrow. AI-assisted EAs, designed with separation of powers between proposal and permission, offer a principled middle ground: adaptive proposals constrained by hard budgets and deterministic microstructure rules. The engineering problem is not to let AI trade freely; it is to ensure AI cannot trade without permission.
10. Conclusion
A scientific trading stack requires observability, falsifiability, regime-aware validation, and risk primacy. Deterministic EAs provide the baseline for measurement and governance. AI-assisted architectures enhance contextual awareness without sacrificing control when the risk governor is sovereign. Ratio X AI Trading Professional exemplifies this approach: context-aware proposals, auditable analytics, deterministic fallback, and enforceable risk gates.
References
[1] Optimal Execution of Portfolio Transactions. Robert Almgren, Neil Chriss. 2001. https://doi.org/10.1111/1467-9965.00068
[2] Algorithmic and High-Frequency Trading. Álvaro Cartea, Sebastian Jaimungal, José Penalva. 2015. https://global.oup.com/academic/product/algorithmic-and-high-frequency-trading-9781107091146
[3] Market Microstructure Theory. Maureen O’Hara. 1995. https://global.oup.com/academic/product/market-microstructure-theory-9781557860611
[4] Cross-Section of Expected Returns: Fads, Fashions, and P-Hacking. Campbell R. Harvey, Yan Liu, Heqing Zhu. 2016. https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2694998
[5] Does Academic Research Destroy Stock Return Predictability? David McLean, Jeffrey Pontiff. 2016. https://doi.org/10.1111/jofi.12365
[6] The Probability of Backtest Overfitting. David H. Bailey, Jonathan Borwein, Marcos López de Prado, Qiji Jim Zhu. 2014. https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2326253
[7] The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality. Marcos López de Prado. 2018. https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2460551
[8] Robustness. Lars Peter Hansen, Thomas J. Sargent. 2008. https://press.princeton.edu/books/hardcover/9780691134731/robustness
[9] The Econometrics of High-Frequency Data. Nikolaus Hautsch. 2012. https://link.springer.com/book/10.1007/978-3-642-21981-6