Break-even is a state, not a magic price
The lesson uses break-even as part of ongoing position management: once a favorable move develops and one leg can be closed or protected, remaining exposure can be advanced into a lower-risk state. In software, break-even should be defined precisely rather than treated as a vague instruction to move the stop to entry.
Define what “break-even” includes
A technically useful implementation can distinguish raw entry price from cost-adjusted break-even. Spread, commission, swap/funding and expected slippage may mean that a stop exactly at the entry price still realizes a small loss.
Do not move to break-even too early
This follows the same principle as the source's structure-based trailing method: protection should react to meaningful market development rather than every favorable tick. A premature break-even rule can remove the position before the original thesis has had room to develop.
Combine break-even with confirmed swings
A robust state machine can first reduce the original risk, then transition to break-even, and later trail behind confirmed structural swings. Each transition should have a reason that can be logged and replayed.
Multi-entry positions need portfolio-aware break-even
When several entries are open, there is more than one possible break-even definition: per-leg entry, volume-weighted average entry or the price at which the entire basket covers all costs. The correct choice depends on whether the strategy manages legs independently or as one aggregate position.
Log every state transition
For live automation, record the trigger, previous stop, new stop, protected risk, unrealized P&L and structural reference that caused the transition. This makes the behavior explainable and helps distinguish a strategy problem from an execution problem.