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;
}

Multi-Core Strategy Engine — „kto pierwszy ten lepszy”

2. Multi-Core Strategy Engine — „kto pierwszy ten lepszy”

Jest to najważniejsza innowacja systemu. Wbrew nazwie sugerującej jedną strategię, AHS to silnik z wymiennymi rdzeniami strategii, gdzie każda strategia może jednocześnie pełnić dwie role:

RolaParametrOpis
Trigger (wyzwalacz)_As_Strategy = trueStrategia GENERUJE sygnał transakcyjny
Validator (walidator)_As_Filter = trueStrategia POTWIERDZA sygnały innych

Zasada „kto pierwszy ten lepszy” (First-Come-First-Served)

Strategie są ewaluowane sekwencyjnie w stałej kolejności:

EvaluateStrategies()
  1. Smart DI (jeśli As_Strategy=true)  → sygnał? → filtry → zlecenie → RETURN
  2. MTF Point System (jeśli As_Strategy=true) → sygnał? → filtry → zlecenie → RETURN
  3. 3 Consecutive Candles (jeśli As_Strategy=true) → sygnał? → filtry → zlecenie → RETURN

Kluczowe znaczenie: Gdy strategia nr 1 (Smart DI) wygeneruje sygnał i przejdzie przez wszystkie filtry, system natychmiast otwiera zlecenie i wychodzi z funkcji (return). Strategie 2 i 3 nie są już w tym ticku sprawdzane. Nie ma głosowania, uśredniania ani konsensusu — pierwszy ważny sygnał wygrywa.

Każda strategia sprawdzana jest tylko raz na nowy bar (na własnym timeframie), co eliminuje wielokrotne sygnały wewnątrz tej samej świecy.

Możliwe konfiguracje

  • SmartDI jako trigger, MTF+3Candles jako filtry — SmartDI daje sygnał, ale muszą go potwierdzić oba pozostałe systemy
  • Wszystko jako trigger — trzy niezależne strategie rywalizują o otwarcie zlecenia
  • MTF jako trigger, SmartDI jako filter — MTF generuje, SmartDI potwierdza
  • Dowolna kombinacja — każda strategia może być włączona/wyłączona niezależnie w obu rolach

Walidator nie weryfikuje samego siebie

Inteligentna logika: strategia X działając jako filtr NIE waliduje sygnałów własnych. Przykład: jeśli SmartDI jest wyzwalaczem, filtr SmartDI jest pomijany (nie sprawdza sam siebie) — sprawdzane są tylko filtry MTF i 3Candles.

// Walidator pomija własne źródło
if (Inp_SmartDI_As_Filter && trigger_source != "SmartDI") {
    if (!CheckSmartDI_Condition(is_buy)) return false;
}