Command for trade automatic closing when (condition)

 

Please tell me an example of a script or a documentation page so that I can understand how I can write a command so that, for example, after the price reverses towards the stop loss, the adviser will close this deal when it reaches -x% of the deposit?