Category

Use Cases

Use Cases

Use Cases

Explore product applications demonstrated in whitepapers and case studies
Explore product applications demonstrated in whitepapers and case studies

Use Cases

Oct 23, 2025

Quanted Data Bridge: Filtering Strategy Signals with ML

In this notebook we showcase how Quanted Data Bridge uses historical trading
performance to identify and filter false‑positive signals from a rules‑based strategy.
The system leverages an extensive data lake to surface features with non-linear
relationships with subsequent trade outcomes, reducing false positives so capital is
allocated to higher‑quality opportunities. The model produces scores that we threshold
to retain strong signals. After the software completes its run, if a model meets
predefined performance thresholds, we automatically recommend the most impactful
features and specify exactly where to obtain them and the vendor they come from to
accelerate implementation.

What You Are Looking At

  • Baseline strategy: an RSI2 mean‑reversion model with a 200‑day trend filter, run
    over the analysis window.

  • Quanted ML filtered strategy: same core logic, but trades are taken only on
    timestamps where the model's score is above a data driven selected threshold.

  • Both runs use identical costs, the same time period (with warm‑up to avoid indicator starvation), and equity curves are plotted strictly within that window.

Why It Matters

  • Reduce false positives: concentrate capital on statistically stronger setups (primary
    objective).

  • Improve capital efficiency: fewer, higher‑quality trades; lower turnover and cost
    drag.

  • Operationally simple: plug your strategy’s signals and our scores; set a threshold
    to meet risk/throughput targets.

Comparing Results

We present equity curves and a side‑by‑side summary table of key performance
figures, including:

  • Total Return [%]

  • Sharpe, Sortino and Calmar ratios

  • Max Drawdown [%] and duration

  • Total Trades

  • Win Rate [%]

  • Profit Factor

Baseline Strategy Logic

  • Long entry: RSI(2) ≤ 10 AND price > SMA(200); exit when RSI(2) ≥ 70.

  • Short entry: RSI(2) ≥ 90 AND price < SMA(200); exit when RSI(2) ≤ 30.

  • Positioning: invest all allocated capital to the strategy per signal (no pyramiding or
    scaling out).

Threshold Selection

The figure below plots the number of signals retained after filtering and the number of
correct signals as a function of the model’s confidence threshold (τ). The dashed line
marks the precision–recall intersection at 0.6574. We choose τ ≈ 0.60 as a balanced
operating point:

  • To the left of τ≈0.60, volume increases but hit rate declines (more false positives,
    higher turnover).

  • To the right, hit rate improves but trade count drops (risk of under‑utilizing
    opportunities).

Selecting τ≈0.60 focuses capital on statistically stronger signals while maintaining
sufficient trade flow for robust performance measurement.

import os
import sys
import pandas as pd
import numpy as np
sys.path.append("/home/quant/Documents/Use-Cases")

from engine import Engine
from strategies.rsi2 import RSI2MeanReversion
from strategies.rsi2_final import RSI2MeanReversionFinal

# --- Create engine and load data ---
engine = Engine(init_cash=100_000, fees=0.0, fixed_fees=0.0, slippage=0.0000
close = engine.load_data_yf("QQQ", period="max", interval="1d", field="Close

# --- Apply PredictionDT window + warm-up + recompute fees (built into Engin
filter_csv = "/mnt/Share8TB/use_cases/Strategy2/Report_2025_10_21__15_39_40/
csv_start, csv_end = engine.apply_prediction_window_from_csv(
    csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    warmup_days=300,       
    per_share_fee=0.0035,  # sets engine.fees = per_share_fee / median(close
)

# --- BASELINE backtest ---
base = RSI2MeanReversion(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
)

signals_path_base = "/home/quant/Documents/Use-Cases/signals_csvs/baseline/s
plot_path_base = "/home/quant/Documents/Use-Cases/equity_curves/baseline/equ
os.makedirs(os.path.dirname(signals_path_base), exist_ok=True)
os.makedirs(os.path.dirname(plot_path_base), exist_ok=True)

# Start trading no earlier than first PredictionDT
pf_base = engine.run_backtest(base, export_csv_path=signals_path_base, start

# --- THRESHOLDED backtest ---
strat_thr = RSI2MeanReversionFinal(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
    prediction_csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    score_col="QuantedModelPredictions",
    score_threshold=0.6,
    force_exit_at_end=True,
)
                              
signals_path_thr = "/home/quant/Documents/Use-Cases/signals_csvs/filtered_co
os.makedirs(os.path.dirname(signals_path_thr), exist_ok=True)

pf_thr = engine.run_backtest(strat_thr, export_csv_path=signals_path_thr)

# --- Combined equity plot  --
combined_dir = "/home/quant/Documents/Use-Cases/equity_curves/combined"
os.makedirs(combined_dir, exist_ok=True)
combined_path = os.path.join(combined_dir, "equity_curve_strat2_combined.png
engine.plot_equities(
    [
        ("Baseline", pf_base),
        (f"Filtered (>= {strat_thr.score_threshold})", pf_thr),
    ],
    path=combined_path,
    show=True,
    title="Baseline vs Filtered - Equity Curves",
    normalize_to=100000.0,
)
                             
# --- Side-by-side comparison ---
print("Side-by-side Comparison")
stats_base = pf_base.stats()
stats_thr = pf_thr.stats()
thr = getattr(strat_thr, "score_threshold", None)

common = [
    "Total Return [%]", "Sharpe Ratio", "Calmar Ratio", "Sortino Ratio",
    "Max Drawdown [%]", "Max Drawdown Duration", "Win Rate [%]",
    "Total Trades", "Profit Factor"
]

comp = pd.DataFrame({
    "Baseline strategy": stats_base.reindex(common),
    f"Quanted ML filtered (>= {thr})": stats_thr.reindex(common),
}).round(2)

# Percent-change column (relative to baseline)
comp["Δ% (Filtered vs Baseline)"] = (
    (comp.iloc[:, 1] - comp.iloc[:, 0]) / comp.iloc[:, 0].replace(0, np.nan)
).round(2)

# Build a styled view
col_base = "Baseline strategy"
col_filt = f"Quanted ML filtered (>= {thr})"
rows_pct = ["Total Return [%]", "Max Drawdown [%]", "Win Rate [%]"]
rows_num = ["Sharpe Ratio", "Calmar Ratio", "Sortino Ratio", "Total Trades",
row_dur = ["Max Drawdown Duration"]

def fmt_timedelta(v):
    if pd.isna(v):
        return ""
    return f"{(v / pd.Timedelta(days=1)):.2f} days" if isinstance(v, pd.Time

styled = (
    comp.style
        .format("{:+.2f}%", subset=pd.IndexSlice[:, ["Δ% (Filtered vs Baseli
        .format("{:.2f}%", subset=pd.IndexSlice[rows_pct, [col_base, col_fil
        .format("{:.2f}", subset=pd.IndexSlice[rows_num, [col_base, col_filt
        .format(fmt_timedelta, subset=pd.IndexSlice[row_dur, [col_base, col_
)

Side by side comparison


Baseline
strategy

Quanted ML filtered
(>= 0.6)

Δ% (Filtered vs
Baseline)

Total Return [%] 

11.52% 

10.95% 

-4.90%

Sharpe Ratio

1.18 

1.47

+24.39%

Calmar Ratio 

2.14 

2.78 

+30.12%

Sortino Ratio 

1.73 

2.30 

+32.86%

Max Drawdown [%] 

4.76% 

3.48% 

-26.89%

Max Drawdown

Duration

32.00 days 

32.00 days 

+0.00%

Win Rate [%] 

65.22%

82.35%

+26.27%

Total Trades 

24.00 

17.00 

-29.17%

Profit Factor 

3.22 

5.72 

+77.43%

Feature importance (SHAP‑driven)

  • SpcChem_md_D_ev_ni (valuation momentum in cyclicals; slow): Top driver .

    Higher values tilt predictions positive (risk‑on); deterioration lowers long odds.

  • OGEP2_md_8H_ER (energy trend persistence): Strong ER pushes predictions

    negative; treat as an inflation/rates headwind filter.

  • Telecom2_md_1H_CkinVol (defensive vol expansion): Rising defensive vol

    pushes predictions negative; suppress longs during spikes.

  • Gold1_md_D_Stoch_s1 (gold momentum delta): Higher gold momentum is

    risk‑off; shifts predictions negative.

  • Tech1_std_4H_ATR (volatility regime): Elevated realized vol reduces long

    expectancy; throttle/skip in high‑σ regimes.

  • AeroDef1_md_1H_ADX: Modest, episodic influence; use as weak confirm only.

  • Semi2_md_4H_APO (semis directional trend): Positive supports longs but is

    secondary vs the top five.

  • Tech2_md_1H_ADX (tech trend strength): Minor incremental value; avoid over‑weighting.

  • OGEP3_md_D_CMO: Lowest importance; largely redundant with OGEP2—safe to drop.

  • Expected outcome: Focus on the top five drivers for filtering and sizing; treat the rest as optional confirms to reduce noise.


Disclaimer: This notebook is a use‑case example for informational purposes only and
does not constitute investment advice.

Blog cover for with text Strategy Signals with ML

Use Cases

Oct 23, 2025

Quanted Data Bridge: Filtering Strategy Signals with ML

In this notebook we showcase how Quanted Data Bridge uses historical trading
performance to identify and filter false‑positive signals from a rules‑based strategy.
The system leverages an extensive data lake to surface features with non-linear
relationships with subsequent trade outcomes, reducing false positives so capital is
allocated to higher‑quality opportunities. The model produces scores that we threshold
to retain strong signals. After the software completes its run, if a model meets
predefined performance thresholds, we automatically recommend the most impactful
features and specify exactly where to obtain them and the vendor they come from to
accelerate implementation.

What You Are Looking At

  • Baseline strategy: an RSI2 mean‑reversion model with a 200‑day trend filter, run
    over the analysis window.

  • Quanted ML filtered strategy: same core logic, but trades are taken only on
    timestamps where the model's score is above a data driven selected threshold.

  • Both runs use identical costs, the same time period (with warm‑up to avoid indicator starvation), and equity curves are plotted strictly within that window.

Why It Matters

  • Reduce false positives: concentrate capital on statistically stronger setups (primary
    objective).

  • Improve capital efficiency: fewer, higher‑quality trades; lower turnover and cost
    drag.

  • Operationally simple: plug your strategy’s signals and our scores; set a threshold
    to meet risk/throughput targets.

Comparing Results

We present equity curves and a side‑by‑side summary table of key performance
figures, including:

  • Total Return [%]

  • Sharpe, Sortino and Calmar ratios

  • Max Drawdown [%] and duration

  • Total Trades

  • Win Rate [%]

  • Profit Factor

Baseline Strategy Logic

  • Long entry: RSI(2) ≤ 10 AND price > SMA(200); exit when RSI(2) ≥ 70.

  • Short entry: RSI(2) ≥ 90 AND price < SMA(200); exit when RSI(2) ≤ 30.

  • Positioning: invest all allocated capital to the strategy per signal (no pyramiding or
    scaling out).

Threshold Selection

The figure below plots the number of signals retained after filtering and the number of
correct signals as a function of the model’s confidence threshold (τ). The dashed line
marks the precision–recall intersection at 0.6574. We choose τ ≈ 0.60 as a balanced
operating point:

  • To the left of τ≈0.60, volume increases but hit rate declines (more false positives,
    higher turnover).

  • To the right, hit rate improves but trade count drops (risk of under‑utilizing
    opportunities).

Selecting τ≈0.60 focuses capital on statistically stronger signals while maintaining
sufficient trade flow for robust performance measurement.

import os
import sys
import pandas as pd
import numpy as np
sys.path.append("/home/quant/Documents/Use-Cases")

from engine import Engine
from strategies.rsi2 import RSI2MeanReversion
from strategies.rsi2_final import RSI2MeanReversionFinal

# --- Create engine and load data ---
engine = Engine(init_cash=100_000, fees=0.0, fixed_fees=0.0, slippage=0.0000
close = engine.load_data_yf("QQQ", period="max", interval="1d", field="Close

# --- Apply PredictionDT window + warm-up + recompute fees (built into Engin
filter_csv = "/mnt/Share8TB/use_cases/Strategy2/Report_2025_10_21__15_39_40/
csv_start, csv_end = engine.apply_prediction_window_from_csv(
    csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    warmup_days=300,       
    per_share_fee=0.0035,  # sets engine.fees = per_share_fee / median(close
)

# --- BASELINE backtest ---
base = RSI2MeanReversion(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
)

signals_path_base = "/home/quant/Documents/Use-Cases/signals_csvs/baseline/s
plot_path_base = "/home/quant/Documents/Use-Cases/equity_curves/baseline/equ
os.makedirs(os.path.dirname(signals_path_base), exist_ok=True)
os.makedirs(os.path.dirname(plot_path_base), exist_ok=True)

# Start trading no earlier than first PredictionDT
pf_base = engine.run_backtest(base, export_csv_path=signals_path_base, start

# --- THRESHOLDED backtest ---
strat_thr = RSI2MeanReversionFinal(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
    prediction_csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    score_col="QuantedModelPredictions",
    score_threshold=0.6,
    force_exit_at_end=True,
)
                              
signals_path_thr = "/home/quant/Documents/Use-Cases/signals_csvs/filtered_co
os.makedirs(os.path.dirname(signals_path_thr), exist_ok=True)

pf_thr = engine.run_backtest(strat_thr, export_csv_path=signals_path_thr)

# --- Combined equity plot  --
combined_dir = "/home/quant/Documents/Use-Cases/equity_curves/combined"
os.makedirs(combined_dir, exist_ok=True)
combined_path = os.path.join(combined_dir, "equity_curve_strat2_combined.png
engine.plot_equities(
    [
        ("Baseline", pf_base),
        (f"Filtered (>= {strat_thr.score_threshold})", pf_thr),
    ],
    path=combined_path,
    show=True,
    title="Baseline vs Filtered - Equity Curves",
    normalize_to=100000.0,
)
                             
# --- Side-by-side comparison ---
print("Side-by-side Comparison")
stats_base = pf_base.stats()
stats_thr = pf_thr.stats()
thr = getattr(strat_thr, "score_threshold", None)

common = [
    "Total Return [%]", "Sharpe Ratio", "Calmar Ratio", "Sortino Ratio",
    "Max Drawdown [%]", "Max Drawdown Duration", "Win Rate [%]",
    "Total Trades", "Profit Factor"
]

comp = pd.DataFrame({
    "Baseline strategy": stats_base.reindex(common),
    f"Quanted ML filtered (>= {thr})": stats_thr.reindex(common),
}).round(2)

# Percent-change column (relative to baseline)
comp["Δ% (Filtered vs Baseline)"] = (
    (comp.iloc[:, 1] - comp.iloc[:, 0]) / comp.iloc[:, 0].replace(0, np.nan)
).round(2)

# Build a styled view
col_base = "Baseline strategy"
col_filt = f"Quanted ML filtered (>= {thr})"
rows_pct = ["Total Return [%]", "Max Drawdown [%]", "Win Rate [%]"]
rows_num = ["Sharpe Ratio", "Calmar Ratio", "Sortino Ratio", "Total Trades",
row_dur = ["Max Drawdown Duration"]

def fmt_timedelta(v):
    if pd.isna(v):
        return ""
    return f"{(v / pd.Timedelta(days=1)):.2f} days" if isinstance(v, pd.Time

styled = (
    comp.style
        .format("{:+.2f}%", subset=pd.IndexSlice[:, ["Δ% (Filtered vs Baseli
        .format("{:.2f}%", subset=pd.IndexSlice[rows_pct, [col_base, col_fil
        .format("{:.2f}", subset=pd.IndexSlice[rows_num, [col_base, col_filt
        .format(fmt_timedelta, subset=pd.IndexSlice[row_dur, [col_base, col_
)

Side by side comparison


Baseline
strategy

Quanted ML filtered
(>= 0.6)

Δ% (Filtered vs
Baseline)

Total Return [%] 

11.52% 

10.95% 

-4.90%

Sharpe Ratio

1.18 

1.47

+24.39%

Calmar Ratio 

2.14 

2.78 

+30.12%

Sortino Ratio 

1.73 

2.30 

+32.86%

Max Drawdown [%] 

4.76% 

3.48% 

-26.89%

Max Drawdown

Duration

32.00 days 

32.00 days 

+0.00%

Win Rate [%] 

65.22%

82.35%

+26.27%

Total Trades 

24.00 

17.00 

-29.17%

Profit Factor 

3.22 

5.72 

+77.43%

Feature importance (SHAP‑driven)

  • SpcChem_md_D_ev_ni (valuation momentum in cyclicals; slow): Top driver .

    Higher values tilt predictions positive (risk‑on); deterioration lowers long odds.

  • OGEP2_md_8H_ER (energy trend persistence): Strong ER pushes predictions

    negative; treat as an inflation/rates headwind filter.

  • Telecom2_md_1H_CkinVol (defensive vol expansion): Rising defensive vol

    pushes predictions negative; suppress longs during spikes.

  • Gold1_md_D_Stoch_s1 (gold momentum delta): Higher gold momentum is

    risk‑off; shifts predictions negative.

  • Tech1_std_4H_ATR (volatility regime): Elevated realized vol reduces long

    expectancy; throttle/skip in high‑σ regimes.

  • AeroDef1_md_1H_ADX: Modest, episodic influence; use as weak confirm only.

  • Semi2_md_4H_APO (semis directional trend): Positive supports longs but is

    secondary vs the top five.

  • Tech2_md_1H_ADX (tech trend strength): Minor incremental value; avoid over‑weighting.

  • OGEP3_md_D_CMO: Lowest importance; largely redundant with OGEP2—safe to drop.

  • Expected outcome: Focus on the top five drivers for filtering and sizing; treat the rest as optional confirms to reduce noise.


Disclaimer: This notebook is a use‑case example for informational purposes only and
does not constitute investment advice.

Blog cover for with text Strategy Signals with ML

Use Cases

Oct 23, 2025

Quanted Data Bridge: Filtering Strategy Signals with ML

In this notebook we showcase how Quanted Data Bridge uses historical trading
performance to identify and filter false‑positive signals from a rules‑based strategy.
The system leverages an extensive data lake to surface features with non-linear
relationships with subsequent trade outcomes, reducing false positives so capital is
allocated to higher‑quality opportunities. The model produces scores that we threshold
to retain strong signals. After the software completes its run, if a model meets
predefined performance thresholds, we automatically recommend the most impactful
features and specify exactly where to obtain them and the vendor they come from to
accelerate implementation.

What You Are Looking At

  • Baseline strategy: an RSI2 mean‑reversion model with a 200‑day trend filter, run
    over the analysis window.

  • Quanted ML filtered strategy: same core logic, but trades are taken only on
    timestamps where the model's score is above a data driven selected threshold.

  • Both runs use identical costs, the same time period (with warm‑up to avoid indicator starvation), and equity curves are plotted strictly within that window.

Why It Matters

  • Reduce false positives: concentrate capital on statistically stronger setups (primary
    objective).

  • Improve capital efficiency: fewer, higher‑quality trades; lower turnover and cost
    drag.

  • Operationally simple: plug your strategy’s signals and our scores; set a threshold
    to meet risk/throughput targets.

Comparing Results

We present equity curves and a side‑by‑side summary table of key performance
figures, including:

  • Total Return [%]

  • Sharpe, Sortino and Calmar ratios

  • Max Drawdown [%] and duration

  • Total Trades

  • Win Rate [%]

  • Profit Factor

Baseline Strategy Logic

  • Long entry: RSI(2) ≤ 10 AND price > SMA(200); exit when RSI(2) ≥ 70.

  • Short entry: RSI(2) ≥ 90 AND price < SMA(200); exit when RSI(2) ≤ 30.

  • Positioning: invest all allocated capital to the strategy per signal (no pyramiding or
    scaling out).

Threshold Selection

The figure below plots the number of signals retained after filtering and the number of
correct signals as a function of the model’s confidence threshold (τ). The dashed line
marks the precision–recall intersection at 0.6574. We choose τ ≈ 0.60 as a balanced
operating point:

  • To the left of τ≈0.60, volume increases but hit rate declines (more false positives,
    higher turnover).

  • To the right, hit rate improves but trade count drops (risk of under‑utilizing
    opportunities).

Selecting τ≈0.60 focuses capital on statistically stronger signals while maintaining
sufficient trade flow for robust performance measurement.

import os
import sys
import pandas as pd
import numpy as np
sys.path.append("/home/quant/Documents/Use-Cases")

from engine import Engine
from strategies.rsi2 import RSI2MeanReversion
from strategies.rsi2_final import RSI2MeanReversionFinal

# --- Create engine and load data ---
engine = Engine(init_cash=100_000, fees=0.0, fixed_fees=0.0, slippage=0.0000
close = engine.load_data_yf("QQQ", period="max", interval="1d", field="Close

# --- Apply PredictionDT window + warm-up + recompute fees (built into Engin
filter_csv = "/mnt/Share8TB/use_cases/Strategy2/Report_2025_10_21__15_39_40/
csv_start, csv_end = engine.apply_prediction_window_from_csv(
    csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    warmup_days=300,       
    per_share_fee=0.0035,  # sets engine.fees = per_share_fee / median(close
)

# --- BASELINE backtest ---
base = RSI2MeanReversion(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
)

signals_path_base = "/home/quant/Documents/Use-Cases/signals_csvs/baseline/s
plot_path_base = "/home/quant/Documents/Use-Cases/equity_curves/baseline/equ
os.makedirs(os.path.dirname(signals_path_base), exist_ok=True)
os.makedirs(os.path.dirname(plot_path_base), exist_ok=True)

# Start trading no earlier than first PredictionDT
pf_base = engine.run_backtest(base, export_csv_path=signals_path_base, start

# --- THRESHOLDED backtest ---
strat_thr = RSI2MeanReversionFinal(
    rsi_buy_long=10,
    rsi_sell_long=70,
    rsi_sell_short=90,
    rsi_cover_short=30,
    sma_window=200,
    prediction_csv_path=filter_csv,
    prediction_dt_col="PredictionDT",
    score_col="QuantedModelPredictions",
    score_threshold=0.6,
    force_exit_at_end=True,
)
                              
signals_path_thr = "/home/quant/Documents/Use-Cases/signals_csvs/filtered_co
os.makedirs(os.path.dirname(signals_path_thr), exist_ok=True)

pf_thr = engine.run_backtest(strat_thr, export_csv_path=signals_path_thr)

# --- Combined equity plot  --
combined_dir = "/home/quant/Documents/Use-Cases/equity_curves/combined"
os.makedirs(combined_dir, exist_ok=True)
combined_path = os.path.join(combined_dir, "equity_curve_strat2_combined.png
engine.plot_equities(
    [
        ("Baseline", pf_base),
        (f"Filtered (>= {strat_thr.score_threshold})", pf_thr),
    ],
    path=combined_path,
    show=True,
    title="Baseline vs Filtered - Equity Curves",
    normalize_to=100000.0,
)
                             
# --- Side-by-side comparison ---
print("Side-by-side Comparison")
stats_base = pf_base.stats()
stats_thr = pf_thr.stats()
thr = getattr(strat_thr, "score_threshold", None)

common = [
    "Total Return [%]", "Sharpe Ratio", "Calmar Ratio", "Sortino Ratio",
    "Max Drawdown [%]", "Max Drawdown Duration", "Win Rate [%]",
    "Total Trades", "Profit Factor"
]

comp = pd.DataFrame({
    "Baseline strategy": stats_base.reindex(common),
    f"Quanted ML filtered (>= {thr})": stats_thr.reindex(common),
}).round(2)

# Percent-change column (relative to baseline)
comp["Δ% (Filtered vs Baseline)"] = (
    (comp.iloc[:, 1] - comp.iloc[:, 0]) / comp.iloc[:, 0].replace(0, np.nan)
).round(2)

# Build a styled view
col_base = "Baseline strategy"
col_filt = f"Quanted ML filtered (>= {thr})"
rows_pct = ["Total Return [%]", "Max Drawdown [%]", "Win Rate [%]"]
rows_num = ["Sharpe Ratio", "Calmar Ratio", "Sortino Ratio", "Total Trades",
row_dur = ["Max Drawdown Duration"]

def fmt_timedelta(v):
    if pd.isna(v):
        return ""
    return f"{(v / pd.Timedelta(days=1)):.2f} days" if isinstance(v, pd.Time

styled = (
    comp.style
        .format("{:+.2f}%", subset=pd.IndexSlice[:, ["Δ% (Filtered vs Baseli
        .format("{:.2f}%", subset=pd.IndexSlice[rows_pct, [col_base, col_fil
        .format("{:.2f}", subset=pd.IndexSlice[rows_num, [col_base, col_filt
        .format(fmt_timedelta, subset=pd.IndexSlice[row_dur, [col_base, col_
)

Side by side comparison


Baseline
strategy

Quanted ML filtered
(>= 0.6)

Δ% (Filtered vs
Baseline)

Total Return [%] 

11.52% 

10.95% 

-4.90%

Sharpe Ratio

1.18 

1.47

+24.39%

Calmar Ratio 

2.14 

2.78 

+30.12%

Sortino Ratio 

1.73 

2.30 

+32.86%

Max Drawdown [%] 

4.76% 

3.48% 

-26.89%

Max Drawdown

Duration

32.00 days 

32.00 days 

+0.00%

Win Rate [%] 

65.22%

82.35%

+26.27%

Total Trades 

24.00 

17.00 

-29.17%

Profit Factor 

3.22 

5.72 

+77.43%

Feature importance (SHAP‑driven)

  • SpcChem_md_D_ev_ni (valuation momentum in cyclicals; slow): Top driver .

    Higher values tilt predictions positive (risk‑on); deterioration lowers long odds.

  • OGEP2_md_8H_ER (energy trend persistence): Strong ER pushes predictions

    negative; treat as an inflation/rates headwind filter.

  • Telecom2_md_1H_CkinVol (defensive vol expansion): Rising defensive vol

    pushes predictions negative; suppress longs during spikes.

  • Gold1_md_D_Stoch_s1 (gold momentum delta): Higher gold momentum is

    risk‑off; shifts predictions negative.

  • Tech1_std_4H_ATR (volatility regime): Elevated realized vol reduces long

    expectancy; throttle/skip in high‑σ regimes.

  • AeroDef1_md_1H_ADX: Modest, episodic influence; use as weak confirm only.

  • Semi2_md_4H_APO (semis directional trend): Positive supports longs but is

    secondary vs the top five.

  • Tech2_md_1H_ADX (tech trend strength): Minor incremental value; avoid over‑weighting.

  • OGEP3_md_D_CMO: Lowest importance; largely redundant with OGEP2—safe to drop.

  • Expected outcome: Focus on the top five drivers for filtering and sizing; treat the rest as optional confirms to reduce noise.


Disclaimer: This notebook is a use‑case example for informational purposes only and
does not constitute investment advice.

Blog cover for with text Strategy Signals with ML