TestingView closes trades when price reaches stop loss or take profit, when a user manually closes the trade, or when trade-management logic such as break-even changes the active stop.