Back to articles
DocumentationSource: backend/agents/notes/trading_concepts_and_definitions.md

AUTHOR: Tony Mudau

Trading Concepts and Definitions Guide

This document explains the core trading concepts used by the Agent Force 1 pipeline, how they are applied in this codebase, and how they affect entry and exit decisions.


1) End-to-End Trading Flow (Conceptual)

The system follows a layered decision path:

  1. Symbol evaluation (orchestration + technical + market)
  2. Entry quality gating (RR, EV, range/chasing, confidence, volatility regime)
  3. Cross-symbol ranking (score + diversification penalty)
  4. Portfolio/risk shaping (lot sizing, correlation, exposure, hard caps)
  5. Execution guard checks (stale bars, spread, slippage, volatility spikes)
  6. Order execution or scheduling
  7. Exit management (time-stop, lifecycle, technical/market exit logic, optional hard TP)
  8. Learning/adaptation (session/symbol/pattern feedback loops)

Each layer is intentionally defensive. A trade must survive all relevant layers.


2) Core Strategy Concepts

2.1 Directional Context

  • Trend: broad directional state inferred from indicators (e.g., bullish/bearish/neutral).
  • Momentum (MACD signal): confirms whether direction has momentum support.
  • RSI state: helps detect exhaustion or stretch (e.g., overbought/oversold).

Direction is not purely one-indicator driven. The system combines these to avoid weak signals.

2.2 Multi-Timeframe (MTF) Alignment

  • Entry timeframe context is cross-checked against higher timeframes (H1/D1).
  • Alignment is scored, not only blocked.
  • Misalignment can reduce confidence and ranking quality.

This reduces trades that look good on one timeframe but conflict with broader structure.

2.3 Volatility Regimes

  • Compression: low-volatility/squeezed environment.
  • Normal: typical environment.
  • Expansion: high-volatility regime.

Regime affects strategy validity:

  • Trend momentum trades are usually poor in compression.
  • Expansion can increase noise/slippage risk if not handled carefully.

2.4 Strategy Mode

The technical layer can classify setups as:

  • trend
  • htf_pullback
  • mean_reversion

Modes are filtered by session, volatility regime, and context quality.


3) Entry Quality Concepts

3.1 Risk-Reward Ratio (RR)

RR = reward / risk, where:

  • risk = distance from entry to stop-loss
  • reward = distance from entry to take-profit

Higher RR improves expectancy, but only if win rate remains viable.

3.2 Expected Value (EV) in R Units

The system approximates expectancy as:

EV_per_R = w * RR - (1 - w)

Where:

  • w = estimated win rate from pattern memory
  • RR = reward-to-risk ratio

Interpretation:

  • EV > 0: favorable on average
  • EV < 0: unfavorable on average

EV is used both as a hard gate and as a scoring/penalty input.

3.3 Confidence (Raw vs Effective)

  • Raw confidence: initial signal confidence from technical synthesis.
  • Effective confidence: raw confidence adjusted by:
    • MTF conflict penalties
    • reversal/exhaustion signals
    • EV blending
    • dynamic confidence floors (session adaptation)

Effective confidence is the more realistic confidence used in stricter gating.

3.4 Entry Microstructure Filters

Before execution, entries are validated against:

  • minimum RR
  • too close to resistance/support
  • chasing near range extremes
  • excessive deviation from current price

These filters remove common bad entries caused by late chasing or stale proposals.


4) Execution Quality Concepts

Execution guards are final “last-mile” quality checks:

  • Stale bars: reject if market context is too old for timeframe.
  • Technical disagreement: optional micro-trend mismatch rejection.
  • Excessive slippage vs proposal entry: reject if execution drift is too high.
  • Spread too wide: reject poor liquidity moments.
  • Volatility spike: reject abnormal single-bar extension conditions.

Even good ideas can become bad executions if this layer is ignored.


5) Symbol-Specific Profiles

Global thresholds are often wrong across instruments (e.g., EURUSD vs XAUUSD). To address that, the system supports symbol-specific trade profiles with fallback to DEFAULT.

Supported fields:

  • entry_min_rr
  • entry_max_deviation_pct
  • ev_min_per_r
  • exec_max_slippage_pct
  • exec_max_spread_ratio

Conceptually:

  • FX majors: tighter slippage/deviation and tighter spreads.
  • Metals/volatile symbols: wider execution tolerances but often stricter EV/RR requirements.

6) Diversification and Concentration Control

6.1 Concentration Bias Problem

A pure “highest score wins” selector can over-focus one symbol/theme repeatedly.

6.2 Diversified Ranking

The selector now adjusts candidate score by a concentration penalty based on:

  • same symbol already open
  • shared currency legs with existing open positions
  • recent repetition in trade history

This reduces over-clustering while still favoring high-quality setups.


7) Risk Management Concepts

7.1 Per-Trade Risk Budget

Position size is derived from:

  • account equity
  • max risk % per trade
  • stop-loss distance in account-currency terms

7.2 Risk per Lot Estimation

Primary method:

  • broker-native profit/risk calculation (order_calc_profit)

Fallback method:

  • symbol metadata aware estimate (tick value/size, point/contract size)

This avoids major sizing errors on non-FX products.

7.3 Correlation and Exposure Scaling

Lot size is scaled down when:

  • correlated same-theme positions accumulate
  • book concentration in relevant currencies is high

This helps prevent hidden portfolio-level risk stacking.


8) Exit Management Concepts

The system does not only optimize entries; it manages exits intentionally:

  • Time-stop logic: closes stale/underperforming positions after age thresholds.
  • Lifecycle actions: breakeven and trailing logic as position evolves.
  • Hard take-profit (optional): force-close when account-currency profit threshold is hit.
  • LLM/technical/market exit context: additional close guidance.

Good exits are essential for realized expectancy, not just theoretical setup quality.


9) Adaptation and Learning Concepts

Post-trade learning updates behavior over time:

  • Symbol adaptation: pause/scale down weak symbols.
  • Pattern cooldown: stop repeating failing pattern fingerprints for a cooldown period.
  • Session confidence floor: raise required confidence when a session underperforms.

This creates a closed-loop system that reacts to recent regime/performance changes.


10) Key Definitions (Quick Reference)

  • SL (Stop-Loss): predefined invalidation price to cap downside.
  • TP (Take-Profit): predefined target price to realize gains.
  • R: one unit of risk (distance from entry to SL).
  • RR: reward-to-risk ratio in price terms.
  • EV per R: expected return measured in risk units.
  • MTF alignment: agreement between entry and higher timeframe directions.
  • Compression: low-volatility regime; often poor for momentum continuation.
  • Expansion: elevated-volatility regime; can increase opportunity and execution risk.
  • Slippage: difference between intended and actual executable price.
  • Spread ratio: spread relative to instrument mid-price (liquidity quality proxy).
  • Concentration bias: repeated overexposure to one symbol/theme.
  • Diversification penalty: score reduction to avoid clustered exposure.
  • Execution guard: final pre-order safety filters.

11) Practical Configuration Principles

  1. Keep DEFAULT conservative and broadly safe.
  2. Override only symbols with materially different behavior.
  3. Tighten thresholds first for frequent slippage/spread offenders.
  4. Raise EV/RR thresholds for noisy or whipsaw-prone symbols.
  5. Reassess profiles after every meaningful sample window (e.g., 50-100 closed trades per symbol).

12) What “Good Trade Quality” Means in This System

A high-quality trade in this architecture is one that:

  • has valid directional and MTF context,
  • passes EV and RR constraints,
  • is not a chase near local extremes,
  • is executable under acceptable spread/slippage conditions,
  • does not overly concentrate the current book,
  • is sized to a controlled risk budget,
  • and has a managed exit path.

This is the operational definition of disciplined, intentional trading used here.