How to send commands from TradingView to Hummingbot telegram bot
Important as of Aug 1st 2020: Confluxbot no longer offer free tier(Previously, you can set up to two free resender combinations), you need to pay $15/mth for unlimited resender combinations.
Discovered liquidity mining back in late May, and has a VPS setup to run the operation ever since. My problem with liquidity mining that it will work brilliantly in a trending or sideways market but terrible in a downtrend market.
So how can we keep running the bot in a trending or sideways market, and stop the bot in a downtrend market? The cons to stopping the bot in a downtrend is that liquidity rewards will stop unless there is way to import different strategy file but this is currently not possible. So let's take a look on how we can auto-trigger the bot based on any technical indicator.
Overview
Luckily, hummingbot has a telegram feature where you can start or stop the bot. Secondly, tradingview has a webhook feature to trigger trades but what is missing is the connector.
The connecter is conflux bot which provides a free webhook, and then setup a channel, group account where the tradingview signals are sent to. From that channel/group account, we need to forward the messages, start/stop to the hummingbot telegram. See following flowchart:
During the setup, there were some problems as the message from tradingview to channel/group has addition message of #webhook. Inorder to forward the correct messages, using text manipulation (by confluxbot) needs to be perform first before sending the commands to the hummingbot telegram.
The end result is that total automation of liquidity mining can be perform by sending start/stop signals from Tradingview to humming telegram bot.
Instructions
- Follow instructions https://docs.hummingbot.io/advanced/telegram/ to setup your hummingbot telegram.
- Add https://t.me/ConfluxBot
- (For payment, steps 3-4) Click Show Packages.
- Select and click 1.Plus [...option], and follow onscreen instructions to pay. Two payment types: Paypal and Bitcoin.
- Paypal: You will received a code in your email which you need to enter in the Redeem Access Code option.
- Bitcoin: Just pay to the address and the bot will be activated.
- Create a channel or a group. This group/channel is used as receiver from Tradingview triggers, and then forward to the hummingbot telegram bot. Add confluxbot as admin to the group.
- Go to ConfluxBot
- Enter /Start
- Click Connect Accounts. Follow on-screen instructions for first time setup.
- Click Webhook. Your webhook URL is displayed.
- Copy & paste the webhook URL in your browser. A list of groups or channels is displayed.
- Look for the channel/group URL that you created (not the Hummingbot telegram) to confirm your channel/group is detected by conflux bot. Copy that URL as well.
- Go back to confluxbot, and click Telegram Account. You will be prompted to share your contact.
- Click Re-sender combinations.
- Click Add Combination. A list of telegram and discord groups/channels are displayed.
- Search for your group/channel. Tip: pin the group/channel so it will appear first. Select the number of the group/channel as your source.
- Select the hummingbot telegram number as the destination.
- Click Back to Configs to confirm that you have selected source and destination.
- Go Tradingview and setup your alerts to trigger start or stop: - In the alert actions, use the confluxbot webhook URL for your group/channel. For info how to setup Tradingview webhook, see https://www.tradingview.com/blog/en/webhooks-for-alerts-now-available-14054/ - Enter Start or Stop in the message.So there will be two alerts messages, start and stop sent to the confluxbot webhook URL .Once either start or stop message is sent to group/channel. There should be an additional text infront of Start/Stop, for example #webhook Start or #Webhook stop. You need to perform text manipulation on those words. If there is none, great!
- Now go back to conflux bot, click Text Manipulation.
- Cut and paste the #webhook Start literally from the group/channel and paste the text in, and add :start. see following: Repeat step 17 for the stop For info on text manipulation: https://medium.com/@ak4zh/confluxbot-how-to-use-text-manipulation-feature-63b24fb9a93e
- Click Forward/Resend , and ensure the mode is in Resend. This allows text manipulation to be performed before sending the message to the bot.Now the bot should be able to start/stop based on your Tradingview strategy and alert triggers.
- You also need to disable Show Headers, so when sending, the channel/group headers wont be included in the headers.Hope this helps! So we can sleep better :P
Note: If you have alertatron, it can be use as well but the steps will be a bit different.