RawData

Drawing the line before writing a line of code

Why Drawline started as a stack of decisions instead of a repo, and the one change of direction that shaped everything after it.

Every prop-firm challenge has a line you don't cross. Lose past it and you're out, no matter how good the next trade would have been. The line isn't there to punish you. It's there because the version of you who set it, calm and before the market opened, is more trustworthy than the version of you staring at a red position at 2am.

That's the idea behind Drawline. You design your own challenge (starting capital, profit target, fail line, risk per trade, minimum reward-to-risk, what you're allowed to trade) and then trade it on your real exchange account. Drawline imports your trades, checks each one against the rules you set, journals it, and scores you on whether you followed your plan, not just on whether you made money.

The name does double duty. It's the drawdown limit you committed to, and it's a line drawn on a chart.

The first sessions had no code in them

It's tempting to open an editor on day one. I didn't. The first stretch of work on Drawline was all documents: a concept write-up, a full brief, an architecture sketch, a planned API, and a mapping of a real challenge onto the rules the engine would need.

That reference challenge is the RawData Ladder. It takes a small account from $100 to $1,000 in levels, with fixed risk, loss floors, and payouts along the way. I'd drafted it as the benchmark the app has to handle. Mapping it rule by rule into generic building blocks was where the design actually got tested. All twelve rules got reviewed, and a lot of them turned out to be vaguer than they looked:

None of those questions are exciting. Every one of them would have become a bug, or an argument with a user, if I'd found it after the code was written.

The change of direction

The original plan leaned hard on the exchange as the source of truth. Import everything and judge everything from it.

Partway through planning I repositioned Drawline as an educational, honesty-based tool. The journal comes first, and the exchange corroborates it. Or, as the principle ended up written: facts from the exchange, intent from the journal.

The reason is simple once you say it out loud. An exchange can tell you what happened: the fill price, the size, the time. It can't tell you what you meant to do. Did you plan that stop, or move it? Was that entry in your plan, or was it revenge for the last loss? Discipline is about intent, and intent only exists in what you recorded before the trade.

That shift rippled through everything. Rule results now carry their data source, so you can see whether a verdict came from exchange data or from your journal. And I changed the drawdown basis from mark-to-market to realized equity, so the floor judges the trades you closed, not the noise on the ones still open.

The principles I wrote down before anything else

Some decisions are easy to make early and very hard to reverse later, so I put them in writing first:

That last one is harder to stick to than it sounds. Charts are fun to build, and it would be easy to spend a month on them. They're milestone 4 for a reason.

Plan locked

The planning phase ended with a milestone of its own: Plan locked. The product, the rules, the data model, the stack (TypeScript, React, Fastify, PostgreSQL) and the UI direction were all decided and written down. I also mocked the first screens and approved them before any real UI existed.

It feels a little ironic to "lock" a plan for an app whose whole point is locking plans. But it's the same principle. Decide while you're calm, then hold yourself to it.

Next up was the least glamorous part of any app, and the place where it's easiest to get security wrong: accounts.

~ Jer