If a trader can quietly change their risk limit halfway through a bad week, the challenge means nothing. So the most important feature in Drawline isn't a chart or a score. It's a lock: once a challenge starts, its rules can't change. Not by the trader, not by a bug, not by me.
This is milestone 2, the rule engine and the journal. It's still in progress, but the core is built, and it's taught me a lot.
Rules as blocks
Every rule is a reusable block with a small interface. Given the state of a challenge and a trade, it reports a result. The engine runs the blocks and collects the verdicts. The first three were:
- Risk per trade, in bands that step up as your equity grows.
- Minimum stop distance, so a stop can't be set unrealistically tight.
- Minimum reward-to-risk, measured both gross and net of fees.
One design choice I keep coming back to: a rule that can't run says so instead of guessing. If a rule needs a field your plan doesn't have, or data Drawline hasn't imported yet, the result is not_evaluable, never a silent pass. It even says which kind: something you can fix (a missing plan field), or something Drawline simply can't check yet (missing data). A discipline tool that assumes the best when it's unsure is lying to you.
The fee lesson
The position-size calculator is where the engine first became something you could touch. You type an entry, a stop and a target, and it shows the size, the reward-to-risk after fees, and which of your rules the trade breaks.
I locked the Ladder's reference trade in as a "golden case" test. It's a $99.25 order that looks like a 2.76R trade. After fees, it's 1.87R, and fees eat 26.2% of the reward. On a small account, fees aren't a rounding error. They're a quarter of your edge. That's exactly why the minimum reward-to-risk rule checks the net number.
Locking it below the code
Starting a challenge takes two steps: you review your rules in plain language, then confirm. From that moment they're locked.
The obvious way to enforce that is in the service code: if (challenge.active) refuse(). But service code has bugs, and it grows new endpoints that forget to check. So the lock lives in the database itself. Four triggers refuse any change to a rule set once its challenge is active, and a partial unique index allows only one active challenge per user. Even a buggy route, or a hand-typed SQL statement, gets turned away.
Trade plans work the same way. A plan you save is a draft, and it stays live: its numbers are recalculated every time you open it. Locking it means "I'm taking this trade now", and from then on the database refuses to change it, and refuses to lock a plan that doesn't have its sizing and verdicts attached.
The floor that only goes up
Your challenge page shows your equity, your target, and your floor, the line you can't close below. The floor ratchets: as your equity grows, it steps up, and it never falls back.
It also shows how many full-risk losses in a row would take you to the floor. I got this wrong in my head at first. At $100 with a $70 floor, simple division says 6 losses. But each loss shrinks the account, which shrinks the next loss, and the risk bands shift too. The honest answer is 7. It's a small difference, but it's the kind of number a trader makes decisions on, so it has to be right.
A clock that counts up
Every challenge now has a clock: "Day N", counted in your own timezone, plus the time since you started.
It counts up, not down. The Ladder has no deadline, and a countdown on screen is just pressure to trade, which is the opposite of what Drawline is for. If you want a time limit, you can set one yourself, and then it counts that down too.
Even "Day N" hid a trap. A day isn't always 24 hours. When the clocks change, you get a 23 or 25 hour day. So days are counted on the wall calendar in your timezone, not by dividing milliseconds, and the page ticks on the server's clock rather than the browser's.
Measured, not declared
The latest rule controls what you're allowed to trade: which directions, which assets, and whether an order may be bigger than the cash you have.
My first instinct was a checkbox: "uses leverage: yes/no". But then the rule depends on the trader filling in a field honestly, and leaving it blank dodges the rule. So leverage is measured from the order size, not declared. If the order is bigger than your cash, you're borrowing, whatever any box says. There's nothing to get wrong, and nothing to game.
Where it stands
The tests went from 127 to 159 to 180 across these sessions, and every lock above has a test that tries to break it.
Still to come in this milestone are the plan screen, the rest of the twelve Ladder rules, the journal, lockouts, and the Integrity Score. The line is drawn, and now it has to hold.
~ Jer