Discussing the article: "From Deal History to Hazard Curves: Survival Analysis Applied To Strategies"

 

Check out the new article: From Deal History to Hazard Curves: Survival Analysis Applied To Strategies.

This article reframes performance from unconditional win rate to conditional probability given survival time. It introduces an MQL5 library, an on‑chart indicator, and a demo Expert Advisor that read deal history, fit Kaplan–Meier and Aalen–Johansen curves with competing risks, and report forward probabilities over a bar‑based horizon. Readers gain a reproducible way to quantify the chance that the current position reaches its target or stop, and to see the bias of the naive censoring approach.

Survival analysis needs two numbers per subject: how long it was observed, and what ended the observation. A closed trade supplies both. The duration is how long the position was open and the outcome is how it closed. The difficulty is entirely in the second, because it has three answers rather than two, and almost every mistake here comes from collapsing three into two.

A trade can end in profit, end at a loss, or still be running when we stop looking. The first two are terminal events: the trade is over. The third is censoring: we ran out of observation time, and the trade could still go on to do anything.

It is tempting to treat a win as the event we care about and everything else as censoring. That is incorrect: censoring means the outcome is unobserved, not impossible. It carries a specific promise, that the subject left our view but the event could still happen out there. A patient who moves away and stops attending follow-ups is censored, because they might develop the condition where we cannot see it. A stopped-out trade is closed: the target can never be reached, not because we stopped watching but because there is nothing left to watch.

Wins and losses are competing risks: two terminal events racing for the same position, whichever arrives first permanently ruling out the other. Only a position still open at the moment of measurement is censored.

The consequence is mechanical. Call a stopped-out trade "censored" and the estimator does what it should with censored subjects: it assumes they behave like the trades still under observation. It hands each dead trade the future of the survivors, so the estimated chance of reaching target is inflated. The bias only ever runs one way, and that is algebra rather than a claim about averages: on any sample the naive figure is greater than or equal to the correct one, with equality only where no competing event has occurred.

Three trade outcomes: two competing terminal events and one censored observation

Author: Muhammad Minhas Qamar