MachGold — Multi-Asset Algorithmic Trading System
Aug 2026 – Aug 2026What Was Built
MachGold is an automated, multi-asset algorithmic trading bot developed in C# utilizing the cTrader/cAlgo API, designed to execute quantitative trading strategies across forex pairs and global indices without manual intervention. The platform features a multi-layer signal confirmation engine that combines exponential moving average (EMA) trend detection, Stochastic Oscillator momentum, Relative Strength Index (RSI) confirmation, and Average True Range (ATR) volatility filtering. It implements an independent per-asset direction locking mechanism along with virtual stop-loss and take-profit calculations based on dynamic ATR multiples to maintain disciplined risk management. To facilitate strategy iteration, the project includes cross-platform implementations in Pine Script for TradingView visual analysis and MQL5 for MetaTrader 5 backtesting. The final cBot is deployed on cTrader cloud instances to ensure continuous, low-latency tick processing and execution across 14 financial instruments simultaneously.
Why Was It Built
Manual trading is inherently vulnerable to emotional bias, execution delays, and inconsistent risk application, particularly when attempting to monitor multiple financial instruments concurrently. MachGold was built to eliminate human discretionary errors by creating a fully automated, rule-based execution model capable of maintaining strict trade discipline across volatile market regimes. The project was designed to systematically isolate high-probability setups by validating indicator combinations against historical price data before allocating live capital. Additionally, it served as an engineering platform to test and refine quantitative strategies, isolate performance drivers, and manage live capital on funded proprietary trading accounts under strict risk constraints.
How It Works
The system operates directly on live tick data ingested through cTrader cloud instances. On every price update, the cBot evaluates the trend direction across configured charts using dynamic EMA thresholds. Before generating an execution order, the signal must pass through a strict, multi-tiered confirmation pipeline: the Stochastic Oscillator confirms underlying momentum alignment, the RSI verifies that the asset is neither overbought nor oversold beyond acceptable limits, and ATR filters measure current volatility to prevent entering trades during flat or illiquid periods. Each instrument maintains its own tunable parameters, allowing confirmation strictness to be adjusted per asset class. Once a valid signal is confirmed, the cBot calculates position sizing, applies per-asset direction locking to prevent conflicting positions, and projects virtual stop-loss and take-profit levels directly onto the trade payload before routing the order for automated cloud execution.
What Broke and How Did I Fix It
During development and live cloud deployment, several technical and risk-management challenges emerged. Early multi-asset backtests revealed that a single global set of confirmation parameters caused severe over-trading on volatile indices while missing valid entries on major forex pairs. This was fixed by refactoring the codebase to support independently tunable indicator thresholds and ATR multipliers mapped to specific asset classes. In live testing on a funded prop trading account, sudden geopolitical volatility (such as US–Iran tensions) caused elevated drawdown when market gaps bypassed standard entry filters. This was addressed by implementing an automated news and volatility guardrail that tightens entry criteria or pauses new order generation during high-impact economic events. Finally, multi-chart execution on cTrader cloud instances initially encountered tick-processing race conditions across 14 simultaneously monitored assets, which was resolved by optimizing event-handling loops and implementing explicit thread safety for state synchronization across chart objects.