You can use the TradingView signal as a condition for the bot to stop.
The bot will be stopped using the Stop-Loss mechanism.
When TradingView receives a signal, the bot will cancel all active cycle orders and send a market order to close the open position to the exchange.
To activate this function, you need to enable the filter "Stop-Loss: Execute stop-loss on the signal" in the bot filters.
The launched bot will wait for the TradingView signal, upon receipt of which the Stop-Loss mechanism will be launched, the current cycle will be closed, and the bot will start a new cycle.
If you want the bot not to start a new cycle after the TradingView receives a stop signal, you need to enable the "Stop-Loss: Stop the bot on execution" filter.
The message for the signal to stop the bot must be copied from the bot editing menu, and stoploss must be specified in the action field.
An example of a signal to stop a bot:
"action" : "stoploss",
"bot_id" : 242047,
"ref_token" : "982d2195-61c0-11e8-aa40-80418s442871"
Stopping a bot based on a TradingView signal can work:
Separately from the start of the bot by the TradingView signal (the bot does not use the start by the TradingView signal).
If the bot should not use the mechanism for starting a bot by a TradingView signal, then in the bot editing menu, deactivate the checkbox for the bot to work on a TradingView signal and save the bot settings.
Together with the start of the bot by the TradingView signal (the bot uses the start by the TradingView signal).
If the bot uses the mechanism for launching a bot based on a TradingView signal, then in the bot editing menu, the checkbox for the bot's operation on a TradingView signal must be activated, and the bot settings are saved.