<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nobbi's Crypto</title>
    <description>The latest articles on DEV Community by Nobbi's Crypto (@nobbi).</description>
    <link>https://dev.to/nobbi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F711321%2F26d1cd49-53c2-40b3-91a7-2ab04be4e816.png</url>
      <title>DEV Community: Nobbi's Crypto</title>
      <link>https://dev.to/nobbi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nobbi"/>
    <language>en</language>
    <item>
      <title>Connecting Hodloo With  a 3Commas Bot (API Version)</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Wed, 10 Nov 2021 08:55:20 +0000</pubDate>
      <link>https://dev.to/nobbi/connecting-hodloo-with-a-3commas-bot-api-version-4od0</link>
      <guid>https://dev.to/nobbi/connecting-hodloo-with-a-3commas-bot-api-version-4od0</guid>
      <description>&lt;p&gt;This is a follow up to my &lt;a href="https://dev.to/nobbi/filtering-hodloo-alerts-api-version-5deo"&gt;last article on Hodloo&lt;/a&gt;. While last time I explained how to receive Hodloo alerts for USDT pairs, this time I'm showing you how to send the signals to 3Commas and trade hands-free - so you can get rich relaxing on the beach (see the cover image). Just joking, we all know it doesn't work that way, but it is a step in the direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;Let's recap what we have when following the other article. We have a Python script running 24/7 on a &lt;a href="https://hetzner.cloud/?ref=ZiLEIYGoKB0X" rel="noopener noreferrer"&gt;VPS&lt;/a&gt; that parses messages from the official Hodloo API and sends USDT pairs to a Discord channel.&lt;/p&gt;

&lt;p&gt;Now, instead of sending alerts to a Discord channel, we want to send them to a bot which does the buying/selling.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why combining Hodloo with a bot? Why not trade manually?&lt;/strong&gt;&lt;br&gt;
I'm not doing this full-time. I have a day to day job. Also, the crypto market is running 24/7 and it happened too often in the past that a drop occured while I was asleep or not in front of my computer. By using a bot, I'm participating in the drop immidiatly.&lt;/p&gt;

&lt;p&gt;In addition, I suck at trading. I'm FOMOing in all the time with too much size and then carry red bags for months. The bot keeps me away from the trading terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why 3Commas?&lt;/strong&gt;&lt;br&gt;
I find it intuitive and easy to work with. I'm using the bot mainly to get in a trade and then taking care of the rest manually. That means I often switch the bot's deal to a smart trade to get out when I want and not at a fixed percentage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do you not use the built-in QFL algos in 3Commas&lt;/strong&gt;&lt;br&gt;
Because they suck - period. Hodloo bases are way better respected. And I need well-respected bases. I just can't take losses mentally and because of silly tax rules in my country.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I run this on my Windows/macOS machine?&lt;/strong&gt;&lt;br&gt;
Yes. Python is cross-platform. Remember that you need to let the machine running all the time. I don't want that hence I'm using a Linux VPS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is this so complex and why can't I use a public service for this?&lt;/strong&gt;&lt;br&gt;
It's not available, unfortunately.&lt;/p&gt;
&lt;h2&gt;
  
  
  Preparing The QFL Bots
&lt;/h2&gt;

&lt;p&gt;Head over to 3Commas and create two multi-pair bots. One for the 5% alerts and one for the 10% alerts. You choose the pairs you want to trade in the bot settings. While the script will send all Hodloo alerts to 3Commas, 3Commas will only create deals for the pairs you've selected in the bots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnq4sd87gumrfps1ndc2x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnq4sd87gumrfps1ndc2x.png" alt="Pairs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see that I've chosen six pairs for the bot but max deals is set to four. The bot will start a deal for the first Hodloo alert it receives to a maximum of four deals. Hence not all pairs you've configured will get a deal. First-come first-serve so to say.&lt;/p&gt;

&lt;p&gt;You can also choose &lt;strong&gt;USDT_ALL&lt;/strong&gt;. Note that this will include leveraged tokens and stablecoin pairs. Typically, you don't want to trade these and put them on the 3Commas blacklist. But that is cumbersome, instead you may want to use my script to do filter out leveraged tokens and stablecoin pairs. Just read on, it will be explained later.&lt;/p&gt;

&lt;p&gt;Your safety order should be double the size of your base order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmylir1lbr03pkzznzbar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmylir1lbr03pkzznzbar.png" alt="Deal start condition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the deal start condition to manually as the bot receives the signal through the Python script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jm73c4ffqc73y4w1117.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jm73c4ffqc73y4w1117.png" alt="Take profit"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wrote above that I like to get out of a trade manually. But, you have to set the take profit value to something and if it bounces to a 30% profit while I'm asleep - I'm okay with that ;-)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyqfxt9df60ud7gq70j9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyqfxt9df60ud7gq70j9.png" alt="Layers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the juicy part - the buy layers. The above settings make sure that you get in with a small size and double-down when it goes south. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the 5% bot the deepest layer is around 45% under the base.&lt;/li&gt;
&lt;li&gt;For the 10% bot the deepest layer is around 50% under the base.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Save and start the bot. On the following page scroll down to the bottom and write down the bot ID. You need that later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht3znewc0kyf1vxjx4r8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht3znewc0kyf1vxjx4r8.png" alt="Bot ID"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Preparing The Panic Sell Bot
&lt;/h2&gt;

&lt;p&gt;Panic sells are a new Hodloo signal which is not availalbe via the Telegram alerts, but only with the new API. It detects a higher than normal sell off which is often where it bounces. If you have access to the new API, the panic sells are the green arrows in the charts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsds3h73ybup5qh6dm1jd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsds3h73ybup5qh6dm1jd.png" alt="Panic sells"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm currently testing these myself and do not have a best-practice bot setting for you, you have to find it out yourself. So, create a bot and write down the bot ID.&lt;/p&gt;
&lt;h2&gt;
  
  
  Script Requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Copy everything from my &lt;a href="https://github.com/NobbisCrypto/Crypto/tree/main/Hodloo_to_3commas" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; to a local folder. I'm using &lt;code&gt;/opt/nobbi/hodloo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install required Python libraries for all users:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su
cd ~
pip install -r /opt/nobbi/hodloo/requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Rename &lt;code&gt;config.py.example&lt;/code&gt; to &lt;code&gt;config.py&lt;/code&gt; and change the variables. The variables are very well documented in the file itself hence I won't cover this here. For your reference the variables below:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 3c
TC_API_KEY = ''
TC_API_SECRET = ''
BOT_ID_5 = '' # Bot to start deal for pair 5% under the base. Leave empty if not desired.
BOT_ID_10 = '' # Bot to start deal for pair 10% under the base. Leave empty if not desired.
BOT_ID_PANIC = '' # Bot to start a deal for a panic sell. Leave empty if not desired.
MODE = 'paper' # 'real' or 'paper'
TC_EXCLUDE_LEVERAGED_TOKENS = True # Set to false to trade leveraged tokens. Currently supports excluding Binance and Kucoin leveraged tokens.
TC_DENYLIST = ["USDN/USDT","USDC/USDT","USDJ/USDT","CEUR/USDT","SUSD/USDT"] # Pairs on this list will not be traded.

# Discord
DISCORD_NOTIFICATIONS = '' # Discord Webhook of channel for trade notifications. Leave empty if not desired.
DISCORD_ERRORS = '' # Discord Webhook of channel for script errors. Mandatory.

# Hodloo
HODLOO_URI = '' # Hodloo Websocket API. Request the info from Pete in the Hodloo Discussions Telegram channel as it is private.
HODLOO_EXCHANGES = ["Binance"] # Multiple exchanges -&amp;gt; ["Binance","Kucoin"] Note that only Binance and Kucoin are fully supported at the moment.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Saw the variables &lt;code&gt;TC_EXCLUDE_LEVERAGED_TOKENS&lt;/code&gt; and &lt;code&gt;TC_DENYLIST&lt;/code&gt;? By using these you don't need to click 1,000 times in 3Commas to build a blacklist. I prefer the term &lt;em&gt;denylist&lt;/em&gt; btw, it's 2021 after all...&lt;/p&gt;
&lt;h2&gt;
  
  
  Running The Script
&lt;/h2&gt;

&lt;p&gt;Run the script to see if everything is running as expected: &lt;code&gt;python3 /opt/nobbi/hodloo/hodloo-to-3commas.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Running the script like above will work but is not very handy because as soon as you close the terminal or the session, the script stops. So we need a way to run the script in the background and also after a server reboot. Check the next chapter on how to achieve this.&lt;/p&gt;
&lt;h3&gt;
  
  
  Running the Script in Background
&lt;/h3&gt;

&lt;p&gt;We need a way to run the script in the background and also after a server reboot. There are multiple ways to achieve that and the easiest method for Ubuntu I found is using the tool supervisor.&lt;/p&gt;

&lt;p&gt;Installing supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install supervisor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checking the status of supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Starting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stopping and restarting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor stop
sudo service supervisor restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create an entry for the &lt;code&gt;hodloo-to-3commas.py&lt;/code&gt; script. The following example uses vi.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vi /etc/supervisor/conf.d/hodloo-to-3commas.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contents of the file (change the paths accordingly):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[program:hodloo-to-3commas]
command=python3 -u hodloo-to-3commas.py
directory=/opt/nobbi/hodloo
stdout_logfile=/opt/nobbi/hodloo/hodloo-to-3commas.log
redirect_stderr=true
autorestart=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo supervisorctl
reread
add hodloo-to-3commas
status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check whether your python script is running use the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ps -axs | grep python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've automated QFL-style trading with Hodloo bases, Python, and 3Commas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1y30z07ob0f4ygjzve7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1y30z07ob0f4ygjzve7.png" alt="Discord example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Hodlooing!&lt;/p&gt;

&lt;h2&gt;
  
  
  Update 2021-11-18
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Volume Filter
&lt;/h3&gt;

&lt;p&gt;The new variable &lt;code&gt;HODLOO_MIN_VOLUME&lt;/code&gt; allows to filter coins based on a certain amount of volume. If the volume is below the variable's threshold, the coin will be ignored. See the variable description for an example.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple Config Files
&lt;/h3&gt;

&lt;p&gt;Until now the script required one config file named &lt;code&gt;config.py&lt;/code&gt;. It now supports passing the name of the config file as a parameter, which allows running multiple instances of the script with different config files. Examples below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Old behavior where the script uses config.py as variable source (still supported btw)
&amp;gt; python hodloo-to-3commas.py

# Use kucoin.py file as variable source instead.
&amp;gt; python hodloo-to-3commas.py kucoin.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>hodloo</category>
      <category>3commas</category>
      <category>python</category>
      <category>crypto</category>
    </item>
    <item>
      <title>Filtering Hodloo Alerts (API Version)</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Mon, 01 Nov 2021 05:10:36 +0000</pubDate>
      <link>https://dev.to/nobbi/filtering-hodloo-alerts-api-version-5deo</link>
      <guid>https://dev.to/nobbi/filtering-hodloo-alerts-api-version-5deo</guid>
      <description>&lt;p&gt;The other day I wrote an article on how to use Telegram and Python to filter Hodloo alerts for USDT pairs only (took it offline on 2021-12-27). That turned out out to be quiet popular. However, shortly after I found that there is also an API availalbe to which I got access by the founder Pete through the &lt;em&gt;Hodloo Discussion&lt;/em&gt; &lt;a href="https://qft.hodloo.com/alerts/" rel="noopener noreferrer"&gt;Telegram channel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Using the API is better than parsing Telegram messages as it's faster and more robust. It has a new metric called panic sells, too. It detects a higher than normal sell of.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Setup
&lt;/h2&gt;

&lt;p&gt;My setup is still the same as described in the old article: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'm running everything on a &lt;a href="https://hetzner.cloud/?ref=ZiLEIYGoKB0X" rel="noopener noreferrer"&gt;Linux VPS&lt;/a&gt; for 24/7 availability. You can run this on your home PC, too, but it needs to be online all the time.&lt;/li&gt;
&lt;li&gt;I'm parsing Hodloo messages for USDT pairs on Binance.&lt;/li&gt;
&lt;li&gt;Results are send to a Discord server. Discord is the only notification method available at the moment, so please read &lt;a href="https://dev.to/nobbi/send-exchange-updates-to-discord-5efd"&gt;my tutorial&lt;/a&gt; on how to set it up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Script And Requirements
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Copy everything from my &lt;a href="https://github.com/NobbisCrypto/Crypto/tree/main/Hodloo_api" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; to a local folder. I'm using &lt;code&gt;/opt/nobbi/hodloo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install required Python libraries for all users:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su
cd ~
pip install -r /opt/nobbi/hodloo/requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Rename &lt;code&gt;config.py.example&lt;/code&gt; to &lt;code&gt;config.py&lt;/code&gt; and change the variables. The variables are very well documented in the file itself hence I won't cover this here. For your reference the variables below:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Discord
DISCORD_WEBHOOK_5 = '' # Discord Webhook for alerts 5% under the base. Leavy empty if not desired.
DISCORD_WEBHOOK_10 = '' # Discord Webhook for alerts 10% under the base. Leavy empty if not desired.
DISCORD_PANIC = '' # Discord Webhook for panic sell alerts. Leave empty if not desired.
DISCORD_ERRORS = '' # Discord Webhook in case of errors. Mandatory.

# Hodloo
HODLOO_URI = '' # Hoodlo Websocket API. Request the info from Pete in the Hoodlo Discussions Telegram channel as it is private.
HODLOO_QUOTES = ["USDT"]  # Multiple quotes -&amp;gt; ["USDT","USDC"]
HODLOO_EXCHANGES = ["Binance"] # Multiple exchanges -&amp;gt; ["Binance","Kucoin"] Note that only Binance and Kucoin are fully supported at the moment.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the script to see if everything is running as expected: &lt;code&gt;python3 /opt/nobbi/hodloo/hodloo-alerts-api.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Running the script like above will work but is not very handy because as soon as you close the terminal or the session, the script stops. So we need a way to run the script in the background and also after a server reboot. Check the next chapter on how to achieve this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running the Script in Background
&lt;/h3&gt;

&lt;p&gt;We need a way to run the script in the background and also after a server reboot. There are multiple ways to achieve that and the easiest method for Ubuntu I found is using the tool supervisor.&lt;/p&gt;

&lt;p&gt;Installing supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install supervisor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checking the status of supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Starting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stopping and restarting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor stop
sudo service supervisor restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create an entry for the &lt;code&gt;hodloo-alerts-api.py&lt;/code&gt; script. The following example uses vi.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vi /etc/supervisor/conf.d/hodloo-alerts-api.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contents of the file (change the paths accordingly):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[program:hodloo-alerts-api]
command=python3 -u hodloo-alerts-api.py
directory=/opt/nobbi/hodloo
stdout_logfile=/opt/nobbi/hodloo/hodloo-alerts-api.log
redirect_stderr=true
autorestart=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo supervisorctl
reread
add hodloo-alerts-api
status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check whether your python script is running use the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ps -axs | grep python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You now get Hodloo alerts like the one below in your own Discord server:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc519068veky0w28mkuq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc519068veky0w28mkuq1.png" alt="Alert"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd like to thank Pete for access to the API and the permission to post this script. And I like to thank &lt;em&gt;lampak&lt;/em&gt; from the Hodloo Discussion Telegram channel for sending me his Python implementation - a lot of my work is based on his actually.&lt;/p&gt;

&lt;p&gt;The next article will cover how to connect the alerts with a trading bot. &lt;/p&gt;
&lt;h2&gt;
  
  
  Update 2021-11-18
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Volume Filter
&lt;/h3&gt;

&lt;p&gt;The new variable &lt;code&gt;HODLOO_MIN_VOLUME&lt;/code&gt; allows to filter coins based on a certain amount of volume. If the volume is below the variable's threshold, the coin will be ignored. See the variable description for an example.&lt;/p&gt;
&lt;h3&gt;
  
  
  Multiple Config Files
&lt;/h3&gt;

&lt;p&gt;Until now the script required one config file named &lt;code&gt;config.py&lt;/code&gt;. It now supports passing the name of the config file as a parameter, which allows running multiple instances of the script with different config files. Examples below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Old behavior where the script uses config.py as variable source (still supported btw)
&amp;gt; python hodloo-alerts-api.py

# Use kucoin.py file as variable source instead.
&amp;gt; python hodloo-alerts-api.py kucoin.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>hodloo</category>
      <category>python</category>
    </item>
    <item>
      <title>Hodloo, Telegram, and 3Commas</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Thu, 28 Oct 2021 09:09:52 +0000</pubDate>
      <link>https://dev.to/nobbi/hodloo-telegram-and-3commas-47gh</link>
      <guid>https://dev.to/nobbi/hodloo-telegram-and-3commas-47gh</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Using Telegram to trade Hodloo bases is outdated. Please read my &lt;a href="https://dev.to/nobbi/connecting-hodloo-with-a-3commas-bot-api-version-4od0"&gt;other article&lt;/a&gt; instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a follow up to my &lt;a href="https://dev.to/nobbi/filter-hodloo-alerts-59mb"&gt;last article on Hodloo&lt;/a&gt;. While last time I explained how to receive Hodloo alerts for USDT pairs, this time I'm showing you how to send the signals to 3Commas and trade hands-free - so you can get rich relaxing on the beach (see the cover image). Just joking, we all know it doesn't work that way, but it is a step in the direction.&lt;/p&gt;

&lt;h1&gt;
  
  
  Recap
&lt;/h1&gt;

&lt;p&gt;Let's recap what we have when following the other article. We have a Python script running 24/7 that parses messages from the official Hodloo alerts Telegram channels and sends USDT pairs to a Discord channel.&lt;/p&gt;

&lt;p&gt;Now, instead of sending the alerts to a Discord channel, we want to send them to a bot which does the buying/selling.&lt;/p&gt;

&lt;h1&gt;
  
  
  FAQ
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Why combining Hodloo with a bot? Why not trade manually?&lt;/strong&gt;&lt;br&gt;
I'm not doing this full-time. I have a day to day job. Also, the crypto market is running 24/7 and it happened too often in the past that a drop occured while I was asleep or not in front of my computer. By using a bot, I'm participating in the drop immidiatly.&lt;/p&gt;

&lt;p&gt;In addition, I suck at trading. I'm FOMOing in all the time with too much size and then carry red bags for months. The bot keeps me away from the trading terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why 3Commas?&lt;/strong&gt;&lt;br&gt;
I find it intuitive and easy to work with. I'm using the bot mainly to get in a trade and then taking care of the rest manually. That means I often switch the bot's deal to a smart trade to get out when I want and not at a fixed percentage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do you not use the built-in QFL algos in 3Commas&lt;/strong&gt;&lt;br&gt;
Because they suck - period. Hodloo bases are way better respected. And I need well-respected bases. I just can't take losses mentally and because of silly tax rules in my country.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I run this on my Windows/macOS machine?&lt;/strong&gt;&lt;br&gt;
Yes. Python is cross-platform. Remember that you need to let the machine running all the time. I don't want that hence I'm using a Linux VPS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is this so complex and why can't I use a public service for this?&lt;/strong&gt;&lt;br&gt;
It's not available, unfortunately. The Hodloo API is private.&lt;/p&gt;

&lt;h1&gt;
  
  
  Preparing The Bots
&lt;/h1&gt;

&lt;p&gt;Head over to 3Commas and create two multi-pair bots. One for the 5% alerts and one for the 10% alerts. You choose the pairs you want to trade in the bot settings. While the script will send all Hodloo alerts to 3Commas, 3Commas will only create deals for the pairs you've selected in the bots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GtglnQU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nq4sd87gumrfps1ndc2x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GtglnQU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nq4sd87gumrfps1ndc2x.png" alt="Pairs" width="880" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see that I've chosen six pairs for the bot but max deals is set to four. The bot will start a deal for the first Hodloo alert it receives to a maximum of four deals. Hence not all pairs you've configured will get a deal. First-come first-serve so to say.&lt;/p&gt;

&lt;p&gt;Your safety order should be double the size of your base order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JNEGgsEA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mylir1lbr03pkzznzbar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JNEGgsEA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mylir1lbr03pkzznzbar.png" alt="Deal start condition" width="880" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the deal start condition to manually as the bot receives the signal through the Python script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a8OFyH2T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jm73c4ffqc73y4w1117.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a8OFyH2T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jm73c4ffqc73y4w1117.png" alt="Take profit" width="880" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wrote above that I like to get out of a trade manually. But, you have to set the take profit value to something and if it bounces to a 30% profit while I'm asleep - I'm okay with that ;-)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EeRpZtu9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyqfxt9df60ud7gq70j9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EeRpZtu9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyqfxt9df60ud7gq70j9.png" alt="Layers" width="880" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the juicy part - the buy layers. The above settings make sure that you get in with a small size and double-down when it goes south. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the 5% bot the deepest layer is around 45% under the base.&lt;/li&gt;
&lt;li&gt;For the 10% bot the deepest layer is around 50% under the base.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Save and start the bot. On the following page scroll down to the bottom and write down the bot ID. You need that later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nzNv1NQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht3znewc0kyf1vxjx4r8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nzNv1NQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht3znewc0kyf1vxjx4r8.png" alt="Bot ID" width="815" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Script Requirements
&lt;/h1&gt;

&lt;p&gt;The script has the same requirements as in the first article. So please check that. In addition, you need to install the Python module for 3Commas -&amp;gt; &lt;code&gt;pip install py3cw&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Configuring The Script
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://github.com/NobbisCrypto/Crypto/tree/main/Hoodlo_telegram"&gt;GitHub&lt;/a&gt; and download &lt;code&gt;hodloo-to-3commas.py&lt;/code&gt; and &lt;code&gt;config.py.example&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rename &lt;code&gt;config.py.example&lt;/code&gt; to &lt;code&gt;config.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change the variables in &lt;code&gt;config.py&lt;/code&gt; to your needs&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Running The Script
&lt;/h1&gt;

&lt;p&gt;Please check the section &lt;em&gt;Running the Script in Background&lt;/em&gt; in the first article and do the same for &lt;code&gt;hodloo-to-3commas.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As soon as the script is running it parses the Telegram channels for any USDT pairs. It then sends the pair to your Discord channel and also trys to open a deal via your bots in 3Commas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ii4LGrKY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fiwi7teir340b3aso294.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ii4LGrKY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fiwi7teir340b3aso294.png" alt="Discord" width="450" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Hodlooing!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Get Alerts and Adjust TP on 3Commas Based on SOs</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Thu, 07 Oct 2021 09:16:18 +0000</pubDate>
      <link>https://dev.to/nobbi/get-alerts-and-adjust-tp-on-3commas-based-on-sos-4k76</link>
      <guid>https://dev.to/nobbi/get-alerts-and-adjust-tp-on-3commas-based-on-sos-4k76</guid>
      <description>&lt;p&gt;A very unwieldy title, I know. But I couldn't think of a better one. The topic is also very specific to my requirements, but maybe it will help someone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t3e41Qhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdz7aj67bzsdd1c35co3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t3e41Qhq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdz7aj67bzsdd1c35co3.png" alt="picture" width="504" height="201"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h1&gt;
  
  
  The Situation
&lt;/h1&gt;

&lt;p&gt;I'm running several &lt;a href="https://www.buymeacoffee.com/UrmaGurd"&gt;Urma v3 Lite&lt;/a&gt; (update 2021-10-27: apparently the creator took that site offline) bots on 3Commas. If you don't know what I'm talking about then stop here, this blog post is not for you ;-)&lt;/p&gt;

&lt;p&gt;Anyway, if you are familiar with Urma v3 Lite bots you know that they often get stuck after the 4th safety order (SO) as the spacing between the SOs is large. And if it goes down to the 5th or even the 7th SO, a bounce is very common. &lt;/p&gt;

&lt;p&gt;Hence I needed two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Alerts whenever the 4th SO is completed. So that I don't need to check 3Commas the whole time. I then can play with manual safety orders to bring the deal into profit more quickly.&lt;/li&gt;
&lt;li&gt;Adjust the take profit (TP) value starting with the 5th SO. I usually go with 1.5% TP, but the value should be higher depending on the SO.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  The Solution
&lt;/h1&gt;

&lt;p&gt;I wrote a Python script which does exactly the above. You can find it in my &lt;a href="https://github.com/NobbisCrypto/Crypto/blob/main/3c_SO_manager"&gt;GitHub repo&lt;/a&gt;. I'm not a Python expert, but the script gets the job done.&lt;/p&gt;

&lt;p&gt;The script checks all active deals whether they have 4 or more SOs completed. If yes, you get an alert. The deal ID is then saved so that you don't get further alerts for that deal. Then, it checks if 5 or more SOs are completed and sets the TP accordingly. I'm running the script every 15 minutes via cron on a Ubuntu VPS.&lt;/p&gt;

&lt;p&gt;You need to have Python and &lt;a href="https://github.com/bogdanteodoru/py3cw"&gt;py3cw&lt;/a&gt; installed.&lt;/p&gt;

&lt;p&gt;The alerts are send to Discord. Read &lt;a href="https://dev.to/nobbi/send-exchange-updates-to-discord-5efd"&gt;here&lt;/a&gt; why and how.&lt;/p&gt;

&lt;p&gt;The script has a variable section which you need to modify. There are a lot of comments in the script so I won't go over the variables here. Below the variable section for your reference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 3Commas API info
# BOTS_READ permissions are mandatory
# BOTS_WRITE permissions are only needed if you want to adjust the take profit value
API_Key = ''
API_Secret = ''
account_id = ''

# Discord webhook for notifications
DiscordWebhook = ''

# Adjust TP, too?
adjust_TP = True # Can be True or False

# Adjust TP percentages when SO is completed
TPSO5 = 3 # Safety order 5
TPSO6 = 7 # Safety order 6
TPSO7 = 10 # Safety order 7

# Trailing settings
trailing_enabled = False
trailing_deviation = 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>3commas</category>
      <category>python</category>
    </item>
    <item>
      <title>Filtering Hodloo Alerts</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Wed, 22 Sep 2021 18:01:30 +0000</pubDate>
      <link>https://dev.to/nobbi/filter-hodloo-alerts-59mb</link>
      <guid>https://dev.to/nobbi/filter-hodloo-alerts-59mb</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Using Telegram to filter Hodloo alerts is outdated. Please read my &lt;a href="https://dev.to/nobbi/filtering-hodloo-alerts-api-version-5deo"&gt;other article&lt;/a&gt; instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://help.3commas.io/en/articles/3108941-what-s-qfl"&gt;QFL&lt;/a&gt; is a popular crypto trading strategy. In a nutshell, you mark strong buying action as a base, buy when the price falls under that base and sell when it reaches the base again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9etf4Don--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjy4f6i5lp0te809lnuc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9etf4Don--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjy4f6i5lp0te809lnuc.png" alt="Alerts example" width="657" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the founder of QFL marked bases manually, many services were created that can draw bases automatically. You can find some indicators on TradingView (search for QFL) or use something like 3commas which has several algorithms built-in.&lt;/p&gt;

&lt;p&gt;The best service, in my opinion, is &lt;a href="https://qft.hodloo.com/"&gt;Hodloo&lt;/a&gt;. Its bases are very well respected hence the winning rate is very high. You even get &lt;a href="https://qft.hodloo.com/alerts/"&gt;Telegram alerts&lt;/a&gt; for free! But, the alerts can get quite spammy when BTC drops. Also, you get alerts for BTC and ETH pairs while I only care about USDT pairs. So I needed a way to filter the Hodloo alerts. Luckily that's possible with Python.&lt;/p&gt;

&lt;p&gt;This article outlines how to filter Hodloo alerts and forward them to a Discord server. The latter is what I'm using as my personal notification system as I prefer it over a flooded mailbox. A second blog post will cover how you can forward the alerts to a bot for automated trading.&lt;/p&gt;

&lt;h1&gt;
  
  
  My Setup
&lt;/h1&gt;

&lt;h2&gt;
  
  
  VPS
&lt;/h2&gt;

&lt;p&gt;The alerts need to be monitored constantly, hence a normal computer is not the ideal place to run this as it is not always on. I'm using an Ubuntu VPS for stuff like this. More precisely a &lt;a href="https://www.hetzner.com/cloud"&gt;CX11 Cloud server from Hetzner&lt;/a&gt;. But you can go with whatever you like, of course.&lt;/p&gt;

&lt;p&gt;Anyway, I can't teach you Linux here. You need some basic knowledge to follow this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Discord
&lt;/h2&gt;

&lt;p&gt;Discord is what I use as my notification system. I created a server just for me where I collect all kinds of notifications. The script currently supports only Discord as its notification system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Binance
&lt;/h2&gt;

&lt;p&gt;Hodloo alerts are available for multiple exchanges. I use Binance hence the script is optimized for it. If you use other exchanges please change the script accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Telegram
&lt;/h2&gt;

&lt;p&gt;Obviously, you need to have a Telegram account and must be a member of the Hoodlo alert groups to be able to parse and filter the alerts.&lt;/p&gt;

&lt;h1&gt;
  
  
  Script Requirements
&lt;/h1&gt;

&lt;p&gt;The script is written in Python and uses a public Python library to interact with Telegram. The following things must be present on your machine for everything to work. Installation instructions can be found via Google.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python, should be installed by default on Ubuntu&lt;/li&gt;
&lt;li&gt;Telethon, the library to interact with Telegram&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Customizing and Running the Script
&lt;/h1&gt;

&lt;p&gt;The script &lt;code&gt;hodloo-alerts.py&lt;/code&gt; is available on &lt;a href="https://github.com/NobbisCrypto/Crypto/tree/main/Hodloo_telegram"&gt;GitHub&lt;/a&gt;. The variable section needs to be customized.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;###
### Variables
###
api_id = 
api_hash = ''
binance_10_webhook = ''
binance_5_webhook = ''

# Only include USDT pairs but exclude anything with "DOWN/" or "UP/" in the name aka Binance Leveraged Tokens.
# Valid pair examples: ADA/USDT, LINK/USDT and so on
# Non-valid pairs: ADADOWN/USDT, ADA/BUSD, LINK/ETH, LINK/BTC and so on
pattern = '(?i)^(?!.*DOWN\/)(?!.*UP\/).*\/USDT.*'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go over each.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;api_id&lt;/code&gt; and &lt;code&gt;api_hash&lt;/code&gt; - Telegram API information. You need to get yours from my.telegram.org.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;binance_5_webhook&lt;/code&gt; and &lt;code&gt;binance_10_webhook&lt;/code&gt; - The webhooks for the notification channels in Discord. Read &lt;a href="https://dev.to/nobbi/send-exchange-updates-to-discord-5efd"&gt;this post&lt;/a&gt; on how to get the webhooks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;pattern&lt;/code&gt; - See description in the script. If you are trading only USDT pairs like me you don't need to change anything.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Save the script somewhere on your Linux box. I like to create a folder in &lt;code&gt;/opt&lt;/code&gt; for these kinds of scripts. Then run it with Python, like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 /opt/nobbi/hodloo/hodloo-alerts.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script will ask you to verify your phone number. You only need to do this once.&lt;/p&gt;

&lt;p&gt;Running the script like above will work but is not very handy because as soon as you close the terminal or the session, the script stops. So we need a way to run the script in the background and also after a server reboot. Check the next chapter on how to achieve this.&lt;/p&gt;

&lt;h1&gt;
  
  
  Running the Script in Background
&lt;/h1&gt;

&lt;p&gt;We need a way to run the script in the background and also after a server reboot. There are multiple ways to achieve that and the easiest method for Ubuntu I found is using the tool supervisor.&lt;/p&gt;

&lt;p&gt;Installing supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install supervisor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checking the status of supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Starting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stopping and restarting supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service supervisor stop
sudo service supervisor restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create an entry for the &lt;code&gt;hodloo-alerts.py&lt;/code&gt; script. The following example uses vi.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vi /etc/supervisor/conf.d/hodloo-alerts.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contents of the file (change the paths accordingly):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[program:hodloo-alerts]
command=python3 -u hodloo-alerts.py
directory=/opt/nobbi/hodloo
stdout_logfile=/opt/nobbi/hodloo/hodloo-alerts.log
redirect_stderr=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo supervisorctl
reread
add hodloo-alerts
status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check whether your python script is running use the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ps -axs | grep python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;That's it! You're successfully filtering the Hodloo telegram alerts for USDT pairs. I know the setup is quite cumbersome and I would love to pay a monthly fee to the creator of Hodloo for the filtered alerts, but sadly that service is not available.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Send Exchange Updates to Discord</title>
      <dc:creator>Nobbi's Crypto</dc:creator>
      <pubDate>Wed, 22 Sep 2021 17:48:43 +0000</pubDate>
      <link>https://dev.to/nobbi/send-exchange-updates-to-discord-5efd</link>
      <guid>https://dev.to/nobbi/send-exchange-updates-to-discord-5efd</guid>
      <description>&lt;p&gt;I’m using Binance as my main exchange. They add new symbols frequently and I want to be notified if there is something new I could trade.&lt;/p&gt;

&lt;p&gt;Also, I set up my own Discord server, mainly to receive TradingView alerts so that my inbox is not flooded with emails.&lt;/p&gt;

&lt;p&gt;To connect both pieces, I wrote a PowerShell script that checks for new symbols on a daily basis and sends the result to my Discord server. No worries, you need next to zero PowerShell knowledge to use this script.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ilusI3eO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c82cnvoxa3l1doh80y50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ilusI3eO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c82cnvoxa3l1doh80y50.png" alt="Results in Discord"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating a Discord Webhook
&lt;/h1&gt;

&lt;p&gt;The first step is to sign-up on Discord and create a server. That’s pretty straightforward - if you need assistance, though, there are hundreds of tutorials on the Internet.&lt;/p&gt;

&lt;p&gt;Next, create a new text channel and give it a name like exchange-updates or similar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XDEN_g-I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/curr2a52pozt7u3bvmv3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XDEN_g-I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/curr2a52pozt7u3bvmv3.png" alt="Name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edit your channel, click on Integrations and create a webhook.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RBy9SfyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyuau030ghzk5np2u491.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RBy9SfyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyuau030ghzk5np2u491.png" alt="Webhook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give it a name and copy/paste the webhook URL somewhere safe.&lt;/p&gt;

&lt;h1&gt;
  
  
  Modifying The Parameters
&lt;/h1&gt;

&lt;p&gt;The script &lt;code&gt;Update-TickerListToDiscord.ps1&lt;/code&gt; is available on &lt;a href="https://github.com/NobbisCrypto/Crypto"&gt;GitHub&lt;/a&gt;. Go there and download it.&lt;/p&gt;

&lt;p&gt;Paste the webhook URL from above between the '' in the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$DiscordWebhook = ''
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see in the script, I’m checking three lists:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;USDT&lt;/li&gt;
&lt;li&gt;Futures&lt;/li&gt;
&lt;li&gt;EUR&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also see that the script gets the lists from the website &lt;a href="//edgesforledges.com"&gt;edgesforledges.com&lt;/a&gt;. If you trade other pairs than I, check the website for other lists, download them into the same folder as the script, copy the download URL, and change the variable &lt;code&gt;$Inputs&lt;/code&gt; accordingly. &lt;a href="//sandwich.finance"&gt;sandwich.finance&lt;/a&gt; is another site to get lists.&lt;/p&gt;

&lt;h1&gt;
  
  
  Running The Script
&lt;/h1&gt;

&lt;p&gt;To run the script manually, right-click it and choose &lt;em&gt;Execute with PowerShell&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To run it periodically on Windows, create a scheduled task and set the action as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Script: &lt;code&gt;powershell.exe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Argument: &lt;code&gt;-executionpolicy bypass -file "Full path to the script"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm running this every day at 8 AM via cron on an Ubuntu VPS box.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
