The loss was bigger than the stop allowed, and the stop worked
By Robert Yenokyan,
The loss was bigger than the stop allowed, and the stop worked.
It closed the position on time. Then it opened a new one in the opposite direction.
You spend the next week looking for the explanation in the market. It was in the order.
An exit order says sell this much. On most venues it does not also say, and only if I am still holding it.
So an order to sell your full size, sent when you are only holding half of it, does two things. It closes the long. Then the rest of the order opens a short the same size as the long you just closed. Now you are losing money in the direction you were trying to get out of, past the point where the stop was supposed to end it.
The fix is one instruction on every exit: only reduce, never open. The venues call it reduce only. It is a flag and it takes a second to set. When it is missing nothing complains, because every step did what it was told.
It is the first thing we look at when a loss outruns the stop that was meant to cap it. We start with the exit, not the market.
Worth doing this afternoon. Find every place your code can exit a position and check the flag is on all of them. Not most of them. Exits get written in a hurry and then copied. The copy nobody reread is the one that flips you short.
Research is the part your team is good at. This is the part under it, and it is the one that ruins a good week.
We build and run the infrastructure underneath systematic trading. If the research is fine and the machinery around it was written in a hurry, write to me at robert_yenokyan@bonton.ai and tell me what your exits look like.
This one is worth an hour today because better research does not protect you from it. The test can be right, the live strategy can be right and the flag can still be missing from one exit path out of five. The one missing it will be the one that gets used on the worst day.