Skip to content

Examples

Real analysis output from an EMA regression mean-reversion strategy on EURGBP hourly data (3,500+ trades).

Strategy Description

The test strategy:

  • Predicts EMA using linear regression on historical EMA values
  • Trades residuals (actual - predicted) normalized by ATR
  • Goes long when residual > 0, short when residual < 0
  • This is a mean-reversion strategy that captures small, frequent moves

Section A: Geometry Overview

Scatter Plot: MFE vs MAE

Scatter Plot

Shows the 2D distribution of Max Favorable Excursion (profit) vs Max Adverse Excursion (drawdown). Each point represents one trade. The shape reveals the trade geometry - wedge shapes indicate good asymmetry, tight clusters show consistent behavior.

Marginal Distributions

Marginal Distributions

Histograms and KDE curves showing the distribution of MFE and MAE separately. Reveals whether profits come from many small wins or few large winners, and shows the tail risk in drawdowns.


Section B: Frontiers

Risk/Reward Frontiers

Frontiers

Top: Risk-constrained frontier showing maximum achievable MFE for given drawdown limits.
Bottom: Opportunity-constrained frontier showing required drawdown to achieve profit targets.
Red stars: Knee points (optimal stop sizes).


Section C: Ordering

Time Sequencing Analysis

Ordering

Scatter plot colored by ordering:
- Green = MFE-first (profit before pain)
- Red = MAE-first (pain before profit)

Reveals whether the strategy needs room to breathe or if trailing stops are suitable.


Section D: TP/SL Feasibility

Probability Heatmap

Probability Heatmap

Path-dependent probability of hitting Take Profit before Stop Loss for various TP/SL combinations. Warmer colors indicate higher success probability. Black contour lines show 30%, 50%, 70% probability levels.

Expected Value Heatmap

Expected Value Heatmap

Expected value (EV) for each TP/SL combination accounting for probabilities and costs. Green zones are profitable, red zones are unprofitable. Black contour shows break-even line (EV=0).


Section E: Volatility Normalization

Vol-Normalized Comparison (Long)

Vol Comparison

Side-by-side comparison of trade geometry in percentage space (left) vs volatility-adjusted space (right). Shows whether the edge is regime-dependent or stable across volatility conditions.

Volatility Regime Analysis (Long)

Regime Analysis

Trade geometry split by volatility regimes (low/mid/high). Reveals whether different exit rules are needed for different market conditions.


Section F: Trade Clusters

Trade Clusters (Long)

Clusters

Unsupervised clustering reveals distinct trade archetypes. Different colors represent different patterns (fast winners, needs room, noise, etc.). Helps identify which trades carry the edge.

Cluster Statistics (Long)

Cluster Stats

Detailed statistics for each trade cluster including size, median MFE/MAE, win rate, and ordering proportions. Bottom panel suggests appropriate exit strategies per cluster type.


Reproduce These Examples

You can regenerate all these plots using the included generate_examples.py script:

cd signal_analyzer
poetry run python generate_examples.py

This will:

  1. Load EURGBP data (or generate synthetic data)
  2. Calculate the EMA regression strategy
  3. Run full analysis (all sections)
  4. Save all 14 plots to examples/ folder
  5. Generate this documentation

See generate_examples.py and test_strat/test.py for the complete implementation.