A method called when a cBot instance stops (de-initialization). You can use it to perform cleanup, close positions, etc. The docs say “OnStop() – This method is triggered when a cBot instance stops. It is used to perform final operations such as closing positions.”