To use custom TradingView signals you should:
Choose trade start condition "TradingView custom signal" when creating or editing the bot.
To use signals to start deals, paste text from the "Message for deal start signal" field on the bot view page on 3Commas website to the field "Message" in alert settings form on TradingView. Please pay attention: for the composite bot you should edit this text and specify exact pair.
To use signals to Market Close deals, you should set up another TradingView alert and copy text from the “Message to Close Deal at Market Price” field on the bot view page on 3Commas website to the “Message” field in TradingView alert settings. Please pay attention: for the composite bot you should edit this text and specify exact pair. The open deals for this bot with this pair will be closed with a Market Order when the alert is triggered.
On the bot creation or edit page choose trade start condition "TradingView custom signal". This condition cannot be used at the same time with other conditions.
The bot should be enabled to start new deals when new signals are received.
When the "TradingView custom signal" is chosen, the lines "Message for deal start signal" and "Message for Close Deal at Market Price" will appear on the bot show page.
Notice: these messages will appear on the bot view page after creation. View page is the one that opens when you press 'eye' button on the page "My Bots". The page also opens after you press the 'Create' button.
For the simple bot:
For the composite bot:
When you create a custom alert for the simple bot for starting a new deal, copy the message to TradingView alert message without changes.
When you create alert for the composite bot for starting a new deal, change the pair in the message to the one you want the deal to be opened for when the alert is triggered. This chosen pair should be present in the composite bot pairs list, that is displayed in the same table on the bot view page on 3Commas.
When the signal is received, the new deal will be opened (for the simple bot it will be the deal for its only pair, for the composite bot it will be the deal for the pair specified in the signal message) if this is possible.
The new deal will not be opened if:
The bot is not working;
The maximum active deals limit is reached;
The trade start condition has been changed to another;
The pair in signal for the composite bot is not present in its pairs list.
Closing Deal signals
When you create Close Deal signal for the simple bot, copy the text from the “Message to Close Deal at Market Price” without changes to the TradingView alert settings. For the composite bot you should change the pair in the message to the specific one, for which all the open deals corresponding to this bot will be market closed when the alert is triggered.
When the market close signal is received the following will happen:
If the deal has a status of "bought", the bot will market close it.
If the base order is not filled even partially, the bot will cancel it.
If the deal is already in the process of cancelling, closing at market price or stop loss, the signal will not change anything.
If the deal closed already in any way, nothing would happen.
If you disable/turn off the bot, it will still close a deal if the bot receives the "Close Deal" signal
Alerts on TradingView
This part explains settings on https://tradingview.com/; you should have an account there and be logged-in.
On the chart page for the specific pair, there is a clock icon on the right. When you click it, the "Manage alerts" panel will appear.
Press the plus button on the panel. You will see a pop-up with params for a new alert.
You can do a right click on the chart, then 'Add alert'; the same window will appear.
When creating alerts on Trading View, choose 'Webhook URL' then paste the link: https://3commas.io/trade_signal/trading_view
Choose the conditions when you want the alert to be triggered.
"Message" text should contain text taken from the "Message for deal start signal" or "Message to Close Deal at Market Price" field on the bot view page on 3Commas. For the simple bot the text should be copied without changes, for the composite bot the pair should be changed to the one you want the deal to be opened or the deals to be closed with a Market Order for when the alert is triggered.
Then click the "Create" button. The alert will be displayed on the "Manage alerts" panel.
When the alert is triggered according to the settings you have entered, the signal will be sent to 3Commas via Webhook, and the deal for the corresponding bot will be created if possible, or the deal for the specified pair will be sold (market closed), depending on what exactly was pasted to the "Message" field.
Please pay attention that the alerts on TradingView can be one-time or repeated ("Every Time"). Alerts of "Every Time" kind can be triggered repeatedly with small intervals between them (it depends on the alert trigger conditions you choose) and will, therefore, try to trigger new deal or opened deal to be closed with a Market Order again. This situation is common, but please keep this in mind when you choose the repeated alerts, and check if this effect is the desired one.
Switching off custom signals
If you want to switch off custom TradingView signals for the specific bot, you should either switch this bot off completely, use the button "Stop" on the bot view page, or change its trade start condition to something other than "TradingView custom signal". After that, even if a new signal for this bot is received, it will not trigger a new deal.