Quant500 Academy

4. Wrapping up: the checklist, and where to go next

Level 6: From data to decision

This is where the first half of the course closes, the data half, before we go into the six production levels. The right place to gather those six levels into a tool you can use on Monday, and to say clearly what you are still missing and where to get it.

The first six levels, one sentence each

The checklist

Apply it to any dataset before you believe a backtest run on it, whether it is yours or somebody is showing it to you. The first six points are blocking: if any of them fails, the result is not up for discussion, it is discarded and redone. From the seventh onwards they do not invalidate anything on their own, but every one that fails is a question you will not be able to answer the day the numbers change.

The same list, in code

The mechanical points get automated and put in front of the backtest, not behind it.

def puerta(df, universo_pit, notas_decisiones, manifiesto):
    """Runs BEFORE the backtest. If it returns False, nothing runs."""
    controles = {
        "universo_punto_en_el_tiempo": universo_pit is not None,
        "fundamentales_por_publicacion": "fecha_publicacion" in df.columns,
        "senal_desfasada": df["posicion"].equals(df.groupby("simbolo")["senal"].shift(1)),
        "sin_fechas_futuras": df["fecha"].max() <= pd.Timestamp.today(),
        "sin_claves_duplicadas": not df.duplicated(["simbolo", "fecha"]).any(),
        "bruto_con_huella": all("sha256" in f for f in manifiesto["fuentes"]),
        "decisiones_escritas": len(notas_decisiones) > 0,
    }
    for nombre, ok in controles.items():
        print(("OK  " if ok else "FALLA ") + nombre)
    return all(controles.values())

Points 14 and 15 cannot be automated and they are the ones that bring down the most results. They are written by hand in the same file as the rest, before looking at the curve.

registro = {
    "observaciones_independientes": "20 trimestres, no 6000 filas",
    "variantes_probadas": 37,
    "regimen_cubierto": "2016-2025, tipos cero y su normalizacion posterior",
}

What comes next

With this you have a table that can be trusted. What you do not have yet is a system: something that runs on its own every morning, that knows where it left off yesterday, that does not duplicate an order if it restarts halfway through the job, and that raises the alarm when something goes wrong. That is what the next six levels, 7 to 12, are about, and they are the other half of this course.

And getting the data right does not tell you whether your result means anything either. That lives in other places.

A reminder at the halfway point

All this material is education, not financial advice. Nothing you have read is a recommendation to buy or sell any asset, nor is it tailored to your situation, your objectives or your risk tolerance. A flawless dataset removes an entire family of errors; it does not make an idea good, it does not validate a strategy and it does not predict anything. Investing carries the risk of loss, including the total loss of your capital. If you are going to take decisions with real money, do it with your own analysis and, if you need it, with a professional authorized to give it.

The rest of Quant500

What you are learning, applied to the index every day:

The model portfolio, weekly in your inbox

Every Saturday, its week in one minute: how it went, the best and the worst, and which insiders bought with their own money. Plus, the day the model is rebuilt, which stocks come in and which go out. A simulation, not advice. At most one email a week, no ads, no account; one-click unsubscribe. Made by one person: Pol Gracia.

A model portfolio with simulated results, not a personalized recommendation. Your email is used for this only: privacy.

Behind the Academy and the rest of Quant500 there is one person: Pol Gracia Serrahima.