Before beginning this article, have a look at this "walkthrough" blog post that shows a simple example using the Hash Ribbons indicator to open a new bot deal, you'll get a clear and straightforward overview of the process involved to use your own TradingView.com indicators to control your 3Commas bots!
To use custom TradingView signals you should:
Choose the option for "TradingView custom signal" when creating or editing your bot's "Deal Start Conditions".
To use signals to start deals, copy the bot command from the "Message for deal start signal" field on the bot's information page on the 3Commas website, to find this, simply click the name of your bot and scroll down the page. All the bot commands are listed in a table.
When you have copied the bot command, switch to your TradingView.com account and paste the bot command into the "Message" box when creating a new TradingView alert for the chart you wish to trigger deals from.
Please pay attention: for a Multi-pair bot you should edit the bot command text and specify the exact pair you want a deal to open for.
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 to the settings for a new TradingView alert.
Again, please pay attention: for the Multi-pair bot you should edit this text and specify exact pair. The open deals for this bot with an open deal for this pair will be closed with a Market Order when the alert is triggered.
On the bot creation or edit page, choose the "TradingView custom signal" Deal Start Condition. Note: It is not recommended to combine this condition with other Deal Start Conditions as the results can be hard to troubleshoot to view if ALL conditions are met to start a new deal.
The bot should be enabled (turned on) 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 information page.
To open the bot information page for your bot, go to the DCA Bot page and simply click your bot's name:
Now scroll down the page:
For a Single-pair bot
When you create a custom alert for the Single-pair bot for starting a new deal, copy the message to TradingView alert message without changes. You can simply click the hyperlink text for "Message for deal start signal" and it will be automatically copied in your device's clipboard for you!
For a Multi-pair bot
When you create an alert for the Multi-pair bot to start a new deal, you'll need to change the pair in the message to the one you want the deal to start for when the alert is triggered. Any pairs you create TradingView alerts for should be in the list of pairs in your bot configuration. Note: the pairs are always entered with the "Quote" currency first, followed by an underscore, and then the "Base" currency, for example:
USDT_BTC, ETH_BNB, BTC_POLY etc.
You can click your bot's name to see the bot information page which lists the trading pairs you have configured - if you want to change this list at any time, click the "edit" button at the top of this page:
When the signal is received, the new deal will be opened (for the Single-pair bot it will be the deal for its only pair, for the Multi-pair 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 enabled;
The maximum active deals limit is reached;
The trade start condition has been changed to another;
The currency pair in the signal for a Multi-pair bot is not present in the bot's configuration within its pairs list.
Closing Deal signals
When you create a Close Deal signal for the Single-pair bot, simply copy the text from the “Message to Close Deal at Market Price” without any changes to the TradingView alert settings.
For the Multi-pair bot you should change the pair in the message to the specific one, for which all the open deals opened by this bot should be closed at market price 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 anyway, nothing will 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. Most 3Commas users find the Pro+ subscription in TradingView is sufficient for their needs.
On the chart page for the specific pair, there is a clock icon, when you click it, you will see a pop-up with parameters for a new alert.
You can also right-click on the chart, choose 'Add alert' and the same window will appear to configure the alert settings.
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 Single-pair bot the text should be copied without changes, for the Multi-pair 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 "Stop" button on the DCA Bot page, or disable the alert in TradingView.com.
Other Bot Commands
Message for deal start signal
Starts a new deal as soon as the signal is received - if using with a Multi-pair bot, please specify the currency pair name
Message to close order at Market Price
Closes a running deal at current Market Price. If your bot is running more than one deal, then specify the currency pair name
Message to close all deals at Market Price
If your bot has multiple active deals, this command will close all deals for this bot at current Market Price
Message to close all deals at Market Price and stop bot
If your bot has multiple active deals, this command will close all deals for this bot at current Market Price and additionally disable (turn off) the bot
Message for deal add funds signal in the quote currency
Send this message when running a Long bot to buy more of the Base currency using the Quote currency, you can use this to add Safety Orders to Dollar Cost Average or add funds to a winning position and increase the trade size. You can edit the message and specify the exact amount of Quote currency to add (so if you are trading BTC/USDT the Quote currency is USDT)
Message for deal add funds signal in the base currency
Send this message when running a Short bot to sell more of the Base currency, you can use this to add Safety Orders to Dollar Cost Average or add funds to a winning position and increase the trade size. You can edit the message and specify the exact amount of Base currency to add (so if you are trading BTC/USDT the Base currency is BTC)
Message to cancel the deal
Will cancel the deal and you will keep any currency bought (or for a short bot, keep the funds released).
If using this command on a Multi-pair bot, please specify the currency pair to cancel the deal for
Message to cancel all bot deals and stop the bot
Cancels all active deals running for this bot and additionally stops (turns off) the bot
Message to cancel all active deals
Cancels all active deals for this bot
Message to start bot
Message to stop bot
Simple commands to stop or start a specific bot.
Typically used if you have your bot configured with a built-in Deal Start Condition, like QFL or RSI-7 and you are using a TradingView indicator when the market conditions change to enable the bot to start trading and stop it when the market conditions are unfavourable
Message to start bot and deal
Typically used if you configured your bot to use built-in Deal Start Condition (like "Open new deal asap"), you can start the bot and open a new deal immediately
To use this command you must have Trailing Take Profit enabled and configure with a Trailing deviation percentage in your bot's configuration.
Warning: when the bot receives this command it will immediately start Trailing Take Profit, whether the trade is in a profitable state or not!
Message to start all long bots on account
Message to start all short bots on account
These messages can be used to start all of your Long bots, or Short bots, created for this specific exchange account
Message to stop all long bots on account
Message to stop all short bots on account
These messages can be used to stop all of your Long bots, or Short bots, created for this specific exchange account
Have a look at our guide for Reversing your bot from Long to Short (and vice versa) - here you will learn how to flip trade direction and also how to use multiple bot commands with one TradingView alert!