2020↑
Thoughts on using Hummingbot so far
It's been quite a journey since late May 2020 till now, been trying out Hummingbot on an Ubuntu server, think i go live in mid June. Since then, i have 4 instances running, and so far make over 5000 trades, and a 12-13% return. Looking good so far but still need another 11 mths of data to really qualify it.
Was trading a fair bit using Quantfury but it will be next to impossible to trade during my sleeping hours or after Covid restrictions are lifted off. I did try to use 3Commas, they have excellent platform and have numerous bot including grid bot which is similar to market making bot except that the grid bot are trading on different price levels while hummingbot orders are price according to the mid-price.
What sets hummingbot apart is liquidity mining where you can get a reward based on your liquidity activity. I only run 2 instances for liquidity rewards to sort of earn back my VPS fees which is about $10usd, and hopefully the tokens that are being liquidity mined goes up in value as well. The other 2 instances is basically tokens that i have a long term view.
So far, i only need to monitor my instances a couple of times a day or if i need to change strategy for any bot, it doesn't takes more than 20mins. Then there is monthly versions upgrade of hummingbot which takes slightly longer but i will usually update when no bots are running.
My target is running a max of 6-10 instances but i am happy with what i have now.
TradingView indicators ideas for Hummingbot
Now that we can send and control the start/stop commands from Tradingview to Telegram (see Link), let's explore some Indicators that can be used for certain parameters:
- Order levels and order spread
- Start/Stop
- Price band/Dynamic price brand(scripts)
Order levels and order spread
There are two indicators that you can use in Tradingview:
- Average pip movement
- EMA
See following screenshot:
The blue line on the price is the EMA while the bottom panel shows the average movement of the price, redline is the EMA and the blue is the average of the day. You can calculate the average percentage by taking average pip movement(EMA)/EMA, that is 0.00000021/0.00000398=0.0527. Then you multiply by 100, that is roughly 5.27 percent. What this means is the price moves around 5.27% a day. (You can adjust the settings to experiment which are the optimal settings) Based on this percentage, you can set your order levels to 5, spread to 1% or up to your desired levels within the 5.27%, or whatever fits your boat.
Start/Stop
Depending on what strategies you want, you can use a trend following strategy, a simple moving average to start your bot during uptrend on stop your bot during downtrend, or accumulate more during downtrend. If you are a die-hard supporter of liquidity mining rewards and love the project/token very much but at the same does not wish to be suffering from down spikes, maybe volume profile will be a good way to explore, see https://www.tradingview.com/support/solutions/43000502040-volume-profile/ for details.
Volume Profile
In a nutshell, most of the price action trade within 70-80% (you can define the percentage) of the price range and will revert to mean(POC). See following screenshot:
The upper and lower lines indicate the boundaries of the price within 80%(you can set this to whatever amount you like), yellow line is the POC which price will revert to. How to use? Set your stop when price cross down the lower boundary, and start when the price cross back up. By setting this, your bot will always trade where prices are bound within 80% of the volume profile. The pros are that 80% of time, your bot will always be engaged in mining where most of the action takes place, and if prices move out of bounds (saves you from spikes down), the bot will stop till prices revert up.
Note: If you want a risk-free approach in holding and increasing the coin inventory, try using the cross-exchange maker making.
Price Band
Or you can use volume profile as to sell above 80% or buy below 20%. In this case, you wont be bothered by the whipsawed price actions within 80%, buy and sell at the extremes, this is similar to the price band parameters. The Hummingbot scripts which is enabled in v0.29 allows you to use a dynamic price band based on moving average price or you can customize the dynamic price band according to your own strategy. In short summary, there are three ways:
- Volume profile:
- start the sell orders when above 70-80%, stop when price cross down 70%-80%,
- start the buy orders when below 20-30%, stop when price cross up 70-80%
- Price band: manually set your buy and sell orders
- Dynamic Price band: Using scripts to dynamically set your buy and sell order
So what about the POC? another way is to change strategy when prices cross down the the POC by accumulating more coins, and when prices cross up POC, start to distribute (sell) the coins. However, this is still quite a manual process in Hummingbot unless develop own script.
Trend Following
There are dozens of TV indicators that you can use for trend following. You can start the HB during uptrend or stop the bot during the downtrend. The issue with stop the bot during the downtrend is in the event of a prolong downtrend, the average cost of the coin for the inventory is higher. You can do a dollar cost average during the downtrend by buying the coin at a higher spread level, increase order level, etc, so the average cost per coin will be lower, and when the price reverts, the time taken to return profit is hopefully faster. Again, if the downtrend persist for a few months, you will be trapped with a large inventory and will have to ride it out. IMHO, don't use it for smaller cap coins unless you really really have a strong sense with the coin that it can moon or only use it for the top 50/100 coins in Coinmarketcap.
If you don't have the time to change strategy on-the-fly, and trade on a short timeframe, try using ping-pong mode during the uptrend which hopefully perform a fast in fast out trade, and during downtrend - stop the bot.
Choices, choices, choices.
Mean reversion
Still pondering with some ideas with futures order for hedging but Hummingbot doesn't support this feature yet, will update on this post once futures is available.
Summary
Hope the article lets you explore more ideas in using various TV indicators to trigger Hummingbot.
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.
Liquidity Mining, Bots Trading, and Quantfury Trading
My main trading focus have shifted to the following three platforms:
- Hummingbot for liquidity mining
- 3commas for automated Crypto bot trading
-
Quantfury for currencies/commodities/stocks trading.The focus is to shift everything to automated trading, as for Quantfury platform, its difficult to perform automated trading as they do not have APIs exposed, still researching other ways to use Quantfury as it still has the best fees in the business.
Another method is using the Tradingview to MT4/MT5, but needs to find the best brokerage to execute this strategy.