Multi-Core Strategy Engine — „First Come, First Served”

2. Multi-Core Strategy Engine — „First Come, First Served”

This is the system’s most important architectural innovation. Despite the name suggesting a single strategy, AHS is a strategy engine with interchangeable cores, where each strategy can simultaneously fulfil two roles:

RoleParameterDescription
Trigger_As_Strategy = trueThe strategy GENERATES the trade signal
Validator_As_Filter = trueThe strategy CONFIRMS signals from other strategies

The „First Come, First Served” Rule

Strategies are evaluated sequentially in a fixed order:

EvaluateStrategies()
  1. Smart DI (if As_Strategy=true)       → signal? → filters → order → RETURN
  2. MTF Point System (if As_Strategy=true) → signal? → filters → order → RETURN
  3. 3 Consecutive Candles (if As_Strategy=true) → signal? → filters → order → RETURN

Critical implication: When strategy #1 (Smart DI) generates a valid signal and passes all filters, the system immediately opens an order and exits the function (return). Strategies 2 and 3 are never evaluated on that tick. There is no voting, averaging or consensus — the first valid signal wins.

Each strategy is checked only once per new bar (on its own timeframe), which eliminates multiple signals within the same candle.

Configuration Possibilities

  • SmartDI as trigger, MTF + 3Candles as filters — SmartDI fires the signal, but it must be confirmed by both other systems
  • All three as triggers — three independent strategies compete to open a trade
  • MTF as trigger, SmartDI as filter — MTF generates, SmartDI confirms
  • Any combination — each strategy can be independently enabled/disabled in either role

A Validator Does Not Validate Itself

Smart logic: strategy X acting as a filter does NOT validate its own signals. Example: if SmartDI is the trigger, the SmartDI filter is skipped (it does not check itself) — only MTF and 3Candles filters are checked.

// Validator skips its own source
if (Inp_SmartDI_As_Filter && trigger_source != "SmartDI") {
    if (!CheckSmartDI_Condition(is_buy)) return false;
}

Architecture & Module Connections

1. Architecture & Module Connections

The system is composed of five header files included into the compiled main file _AHS_Main.ex5:

_AHS_Main.ex5
  ├── AHS_Inputs.mqh      → All input parameters, enumerations, global state variables
  ├── AHS_Filters.mqh     → Market filters (The Shield): Macro Matrix, Impulse, Channel, ADX/MA, SmartDI, MTF, 3Candles
  ├── AHS_Strategy.mqh    → Multi-Core Engine: position sizing, order execution
  ├── AHS_Management.mqh  → Position management: TSL BB, Hard BE, Neg BE, Dynamic TP, EOD Terminator
  └── AHS_Panel.mqh       → Graphical information panel: status, MTF dashboard, positions list

OnTick() Flow — Step by Step

Every incoming tick passes through a strictly defined sequence in the main loop:

OnTick()
  1.  License check (CLicenseManager.IsExpired)
  2.  Session schedule check (IsScheduleAllowed)
  3.  EOD Terminator (CheckForEODClose) → emergency close all positions
  4.  Daily P/L update and daily reset
  5.  Account Protection checks:
        → DailyLossReached?    → block new orders
        → DrawdownFreeze?      → block new orders
        → DailyTargetReached?  → block new orders
  6.  Equity Trailing Lock (master equity trailing SL)
  7.  Institutional Impulse Detection (CheckInstitutionalImpulse)
  8.  Dynamic Channel Update (UpdateDynamicChannel) every X hours
  9.  News Filter → freeze before/after news events
 10.  ManageAllPositions() → manage all open positions
 11.  Cooldown check + position count limit check
 12.  EvaluateStrategies() → Multi-Core Engine searches for a signal
 13.  Information panel update

All stages are independent — position management (step 10) runs regardless of whether new signals are being sought (step 12). Even when new orders are blocked, open positions are always managed.

Podsumowanie filozofii systemu

Podsumowanie filozofii systemu

AHS nie jest prostym EA z jedną strategią. Jest to platforma hybrydowego zarządzania ryzykiem z wymiennym rdzeniem strategii, gdzie:

  1. Każda strategia może być Triggerem LUB Filtrem — ta sama logika służy zarówno do generowania sygnałów jak i ich weryfikacji
  2. Macro Risk Matrix patrzy na szerszy obraz rynku zanim pozwoli wejść w pozycję — 19 globalnych aktywów głosuje na każde zlecenie
  3. System reaguje na impulsy — gdy wykrywa gwałtowne ruchy, radykalnie zmienia swoje parametry, stając się bardziej selektywny i kierunkowy
  4. Ochrona wielowarstwowa — od poziomu pojedynczej pozycji (Virtual SL, Hard BE, TSL BB, Profit Lock, NegBE) przez poziom dzienny (Daily Loss, Daily Target) po poziom całego konta (Equity TSL)
  5. Click & Forget — trader może handlować manualnie, a EA automatycznie przejmuje zarządzanie ryzykiem każdej otwartej pozycji

Full Technical Documentation

AHS — Adaptive Hybrid System v78.00

Full Technical Documentation

Multi-Core Strategy Engine for MetaTrader 5 (MQL5)

Project built from July 10th, 12+ hours a day, often seven days a week — through April 21st.


TABLE OF CONTENTS

  1. Architecture & Module Connections
  2. Multi-Core Strategy Engine — “First Come, First Served”
  3. Strategies — Detailed Algorithm Descriptions
  4. Macro Risk Matrix — Dynamic Institutional Scoring
  5. Institutional Impulse + Muzzle Mode — Behavior Change During Impulse
  6. Dynamic Channel (Box Trading) — Price Tunnel
  7. Position Management — Protection Layers
  8. Account Protection — System Level
  9. Manual Trade Management (Click & Forget)
  10. Trading Schedule & EOD Terminator
  11. News Filter
  12. Weekly Filter & Fibonacci (Anti-Crash)
  13. Capital Management & Position Sizing
  14. Pyramiding (Position Scaling)
  15. Information Panel
  16. License & Updates
  17. Full Input Parameter Reference

1:500

Adaptive Hybrid System - Multi-Core Strategy Engine -US100
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.