The safety check that was quietly doing nothing.
By Himanshu Bhagat · Engineering notes · 6 August 2026 · Education, not advice
In short. Our protective stops sit with the broker, so they keep working even if our own machine is asleep, and the broker acts on them itself. While building the part of the system that finds out what the broker actually did, we nearly shipped a check that would have reported a healthy account forever. We caught it in review.
The courier who never says "delivered"
Search your inbox for "delivered" when your courier writes "handed over", and you will conclude that nothing ever arrived. The search works perfectly, the conclusion is wrong, and it stays wrong every day, because a search that finds nothing never tells you the vocabulary was the problem. Our check looked for a description the broker does not use.
Why a sleeping check costs real money
So a stop fires at the exchange, the shares are sold, and a book that never checks goes on showing the position open, the cash wrong and the profit wrong, until a person happens to look. A missing safety system keeps you humble, because you know you have to look yourself. One that is quietly doing nothing is worse, because it retires your attention.
Entry and exit are not mirror images
Buying and selling look alike, so the tempting shortcut is to build the exit path by copying the entry path. An entry chooses what it buys and the order is ours; an exit inherits a position and protection that already exist. Copied across, that shortcut would have sold an already sold position a second time. Symmetry is an assumption, not a fact.
What runs today
Before the system reasons about anything else, it reads the broker's own record of what happened, books any sale at the price the shares actually fetched, and reconciles the result against what the account holds. If anything does not add up, it writes nothing and says so loudly, because a wrong entry spreads through profit and statistics wearing the same shape as a correct one. We would rather be visibly behind than invisibly wrong.
P.S. We now read the broker's dictionary before we go searching for its words.
These notes are general education about how we build, not investment advice or a recommendation. Investments in the securities market are subject to market risks. See the disclaimer and risk disclosure.