lookahead bias proof tester

    by nowrich

    1

    Audit trading strategies and backtests to expose lookahead bias, data leakage, and misleading performance metrics.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLI+17 more

    See it in action

    You say

    Audit this Python strategy. It uses a 20-day rolling Z-score for entries and the current S&P 500 constituents. I'm getting a 4.0 Sharpe ratio in backtesting.

    Your agent does

    VERDICT: BROKEN.

    1. Survivorship Bias: Using 'current' S&P 500 constituents ignores delisted companies, inflating returns.
    2. Leakage: The Z-score uses full-sample mean/std. FIX: Use a rolling window for Z-score stats and point-in-time universe data. Adjusted Sharpe: 0.85.

    What you get

    Identify hidden future-data leakage in Python trading scripts.Verify point-in-time integrity of time-series features and labels.Detect survivorship bias in historical universe selection.Quantify the impact of lookahead bias on strategy Sharpe ratios.Fix pandas alignment errors that cause non-causal signal generation.

    About this skill

    The problem

    Backtests often produce "too good to be true" results because of hidden information leakage. Developers unknowingly use future data in feature scaling, signal generation, or universe selection, leading to catastrophic failure in live trading.

    What it does

    • Audits trading scripts and execution models for point-in-time data integrity.
    • Identifies common leakage paths like centered moving averages, full-sample normalization, and shift(-k) errors.
    • Detects survivorship bias in universe selection and restated financial data.
    • Runs leakage probes including lag tests, label shuffles, and rolling retrain tests to stress-test strategy validity.
    • Provides a Lookahead Bias Audit Report with code-level fixes and corrected performance metrics.

    Frameworks & tools

    Python, Pandas, NumPy, Scikit-Learn, and various backtesting engines.

    Why this beats prompting it yourself

    Generic LLMs often miss subtle alignment errors in time-series data or fail to account for serial correlation between train/test splits. This skill enforces a strict non-causal audit workflow that assumes leakage exists until proven otherwise, specifically looking for pandas index mismatches and lookahead execution artifacts that manual reviews overlook.

    Use cases

    • Verifying a newly developed quantitative strategy before deploying capital.
    • Auditing third-party trading algorithms or academic research claims.
    • Debugging unexpected discrepancies between backtest and paper trading results.
    • Ensuring ML models for time-series use proper purging and embargo techniques.

    Known limitations

    Requires access to the strategy source code and data handling logic. Cannot detect leakage hidden within proprietary, pre-processed black-box datasets where the original collection methodology is unknown.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Frequently Asked Questions

    Popular in Trading