Adaptive Algorithmic Trading Architecture & Dynamic Risk Management
1. Executive Summary
CAPITAL VAULT is a hybrid technical analysis system engineered for MetaTrader 5 that synthesizes three distinct mathematical schools of thought to solve the fundamental problem of financial trading: regime detection (Trend vs. Range).
The system goes beyond generating entry signals; it provides a comprehensive structural map of the market and implements dynamic risk management logic that adjusts position sizing based on the real-time quality of the market environment.
The Three Core Engines
-
Adaptive Momentum (MAMA/FAMA): Phase-adaptive moving averages that accelerate during trends and remain stationary during consolidation phases, minimizing lag and whipsaws.
-
Fractal Filtering (Choppiness Index): Quantifies the market's "dimension" to distinguish between linear (efficient) movement and chaotic (inefficient) noise.
-
Geometric Structure (Murrey Math): Defines the physical boundaries of support and resistance (Floor and Ceiling) based on harmonic price intervals.
2. Visual Components & Indicators
2.1. Momentum Lines (Trend)
-
Crimson Line (MAMA): MESA Adaptive Moving Average. The fast-response line. It tracks price action closely with minimal lag by adjusting its alpha based on the rate of change of phase.
-
Blue Line (FAMA): Following Adaptive Moving Average. The slow-response line. It moves in synchronization with MAMA but with half the alpha, acting as the dynamic baseline.
-
Bullish Crossover: MAMA crosses above FAMA.
-
Bearish Crossover: MAMA crosses below FAMA.
2.2. Structural Lines (Murrey Math)
The system calculates a "Fractal Frame" over a configurable period (default 64) to determine the price's position relative to its historical range geometry.
-
Red Dots (Ceiling 8/8): Extreme Resistance. High probability of reversal. Optimal zone for profit-taking or counter-trend entries.
-
Gray Dots (Equilibrium 4/8): The market's Center of Gravity. Acts as a price magnet during mean reversion phases.
-
Green Dots (Floor 0/8): Extreme Support. Institutional accumulation zone. High probability of bullish reversal.
3. The Intelligent Dashboard (Control Panel)
The on-chart dashboard is the system's command center. It updates on every tick, providing real-time telemetry on market conditions and risk parameters.
A. State & Signal Section
-
State (CHOP):
-
TRENDING (Green): The market is moving directionally with high efficiency (Chop < 38.2).
-
RANGING (Orange): The market is lateral, choppy, or consolidating (Chop > 61.8).
-
NEUTRAL (Gray): Transition zone.
-
Visual Cue: The Dashboard border changes color (Green/Orange) to reflect this state instantly.
-
Signal:
-
BUY / SELL: Confirmed MAMA/FAMA crossover, filtered by market state logic.
-
WAIT: No clear setup detected.
-
RISK (HIGH/LOW): A crossover is detected, but price is compressed against an extreme structural line (Murrey 0/8 or 8/8). Caution is advised.
-
Struct Zone: Indicates the current Murrey Math octave (e.g., "PIVOT", "CEILING", "FLOOR").
-
Trend: General market bias based on the relative positioning of MAMA vs. FAMA.
B. Risk Management Section (Money Management)
This is the most advanced feature of Capital Vault. It calculates optimal position sizing based on your equity and the distance to the Structural Stop Loss.
-
Risk Adjustment (+ / -):
-
Interactive buttons to increase or decrease the risk percentage per trade in 0.5% increments.
-
Uncapped Range: From 0.1% to 100% (allowing full flexibility for experienced traders).
-
Central Display: Shows the currently selected Risk Percentage.
-
Lot Size: The precise lot size calculated to match your risk parameters.
-
Risk Amt ($): The exact monetary value (in account currency) at risk if the Stop Loss is hit.
-
Auto-Reduction Feature: If the Market State is RANGING, the system automatically halves the monetary risk to protect capital during lower-probability conditions, regardless of the selected percentage.
-
SL Struct: Suggested price for Stop Loss (derived from Murrey Math lines).
-
TP Struct: Suggested price for Take Profit (derived from Murrey Math equilibrium or opposing extremes).
C. Interface Controls
-
Drag & Drop: Click anywhere on the background to drag the panel to your preferred location.
-
Minimize: Click the top-right button to collapse the panel into a compact title bar, maximizing chart visibility.
4. Operational Strategy Guide
Scenario 1: Pure Trend
-
Dashboard: State TRENDING (Green Border).
-
Signal: BUY or SELL.
-
Action: Execute the trade with the recommended lot size.
-
Management: The system calculates full risk (100% of selected). Aim for the next major Murrey level or trail the stop using the Blue Line (FAMA).
Scenario 2: Range / Swing Operation
-
Dashboard: State RANGING (Orange Border).
-
Signal: MAMA/FAMA Crossover or Reversal at Extremes.
-
Action: Execute with caution.
-
Management: The system automatically reduces lot size (Risk x 0.5). Targets (TP) should be conservative, typically aiming for the Gray Line (Equilibrium 4/8).
Scenario 3: Structural Trap (Safety Filter)
-
Situation: MAMA crosses up (Buy Signal), but price is touching the Red Dots (Ceiling 8/8).
-
Dashboard: Displays RISK (HIGH) in Orange.
-
Action: DO NOT BUY. The probability of a breakout failure is high. Wait for a confirmed breakout or a reversal pattern to sell.
5. Input Parameters
Profile Configuration
-
InpPreset:
-
STANDARD: Balanced configuration (MAMA 0.5/0.05, CHOP 14, MML 64). Recommended for H1/H4 timeframes.
-
SCALPER: Faster reaction, tighter structure (MML 32). Optimized for M5/M15.
-
TREND: Slower, filtered logic (MML 128). Ideal for D1/W1 investing.
-
CUSTOM: Enables manual editing of the parameters below.
Risk Management Engine
-
InpCalcBase: Select the capital basis for risk calculation.
-
Balance: Closed equity (Conservative/Stable).
-
Equity: Floating equity (Real-time/Aggressive).
-
Free Margin: Available margin.
-
InpRiskStart: Initial risk percentage when the indicator loads.
-
InpRiskStep: Increment/Decrement step for the +/- buttons.
-
InpRiskMin/Max: Safety bounds for the risk selector.
Algorithmic Settings (Custom Mode)
-
InpFastLimit / InpSlowLimit: Controls the phase-adaptability sensitivity of the MAMA algorithm.
-
InpChopPeriod: Lookback period for the fractal efficiency index.
-
InpMMLPeriod: Size of the "Fractal Frame" for structural support/resistance.
Notifications
-
InpUsePush / InpUseAlert: Enable mobile push notifications or desktop sound alerts upon signal changes.
6. Installation
-
Drag and drop onto the chart.
-
Ensure that "Allow modification of Signals" is enabled in the dependency settings if required.
Risk Warning: Trading financial markets involves a significant risk of loss. Capital Vault is a decision-support tool and does not guarantee future performance. Always use a Stop Loss.


