Muhammed Mustafayev — independent software engineer
Custom platforms for real businesses
Work across Türkiye and Europe
From product architecture to production
AI integrated into practical systems
Next.js · TypeScript · Python · Supabase
Muhammed Mustafayev — independent software engineer
Custom platforms for real businesses
Work across Türkiye and Europe
From product architecture to production
AI integrated into practical systems
Next.js · TypeScript · Python · Supabase
All work
Case Study

Honest Swing

A test harness that kills indicators which cheat.

PythonPine Script v6BacktestingStatistics

An invite-only indicator advertised a 95% first-target hit rate. It took one night to show that the number came from a single line of code letting the chart see the future.

01

The claim

A paid, invite-only trading script promised near-perfect accuracy, and its historical chart backed it up beautifully. Charts like that usually do — right up to the moment you replay them bar by bar instead of admiring the finished picture.

02

The autopsy

Bar Replay showed the trend lines moving after the fact: levels drawn in May had quietly relocated by June. The entire illusion rested on one toggle — an offset that shifts a pivot backwards in time so the indicator 'knows' a swing that had not formed yet. That is repaint: hindsight rendered as a signal, sold as foresight.

03

The rebuild

So I built the thing that should have existed first: a harness that fails any indicator which cannot survive replay, a swing pivot engine with no lookahead leak, and an honest R-expectancy backtest. The result was humbling. A naive swing-breakout across 65 symbols and 1,181 trades returns −0.087R per trade, with a confidence interval entirely below zero. The same code on eight hand-picked symbols reported +0.297R and would happily have called itself an edge. The whole difference was selection bias — measured, not argued about.

The scoreboard

  • Repaint proven with bar-by-bar replay, not opinion
  • −0.087R per trade over 1,181 trades and 65 symbols — CI entirely negative
  • Same code, 8 cherry-picked symbols: +0.297R. That gap is the whole lesson.

Want a story like this on your side?

Two lines about your problem is enough to start.