Case study · Quant Research & Intelligence

    Machine Learning Signal Filter

    A machine learning pipeline that acts as a signal filter for trend-following systems. Uses LightGBM for classification of signal quality, reducing whipsaws and maximizing overall strategy expectancy.

    Primary Tech
    Python / LightGBM
    API Protocol
    FastAPI Endpoint
    Architecture
    ML Classifier

    Client work under NDA. Client names, trading data, performance figures and live screens are not shown. This page describes the problem, what we built and the technology used.

    01

    The client

    A quantitative fund running a trend-following strategy.

    02

    The problem

    A quant fund needed to filter out false signals from their trend-following strategy using machine learning.

    • The strategy lost money on false signals in ranging markets, known as whipsaws.
    • Filters written as fixed rules fitted past data well but failed on new data.
    • Any filter had to work live, scoring each new signal in time to act on it.
    03

    Our approach

    We kept the fund's trend strategy as it was and added a machine learning model that scores each signal. The fund trades only the signals above a threshold it sets.

    04

    How we built it

    1. 1

      Labelling

      Every historical signal was labelled by its outcome, so the model learns which conditions came before signals that worked and signals that failed.

    2. 2

      Features

      Each signal is described by market conditions at the time, such as volatility, trend strength and range behaviour.

    3. 3

      LightGBM classifier

      The model is a LightGBM classifier in a scikit-learn pipeline, trained with time-ordered validation so it never learns from the future.

    4. 4

      Feature importance analysis

      Features whose importance was unstable across periods were removed, to keep the model from fitting noise.

    5. 5

      Live signal API

      A FastAPI endpoint scores each new signal as it is generated and returns the score to the strategy.

    05

    How we tested it

    • Out-of-sample periods the model never saw during training.
    • Filtered and unfiltered strategy compared on the same out-of-sample data.
    • Checks for leakage, so no feature uses information from after the signal.
    06

    What we delivered

    • The trained model and pipeline, with the code to retrain it.
    • The live scoring API deployed on the fund's infrastructure.
    • Support after launch.
    07

    The result

    Every signal now arrives with a score, and the fund sets its trading threshold with out-of-sample results in front of it.

    Features

    • LightGBM classifier
    • Feature importance analyzer
    • Whipsaw filtering engine
    • Live signal API endpoint

    Technology

    • Python
    • Scikit-Learn
    • LightGBM
    • FastAPI

    Start here

    Need something similar?