06-29-2021, 02:48 AM
I configured a crypto trading bot to buy crypto based on Reddit post sentiment from
<!-- SC_OFF --><div class="md"><p>I mainly built this for fun, and as a coding challenge, as I'm not sure how viable it would be to base my investing decisions based on the Reddit hive-mind. But having said that, I will test the tool out and see what it can do - who knows, maybe among all the shills and moon-farmers is where insight truly lives.</p> <p>​</p> <p><strong>Here's a little bit about how it works:</strong> </p> <p>It's a trading bot that analyses reddit post sentiment and automatically buys the coins mentioned in the post. So it checks if the post title and body talk positively about x coin, and if that's the case it goes ham on that coin.</p> <p>But it only does this for coins I tell it to look out for: by default it will only check BTC and ETH but you can add any number of keywords. This is built in to discourage shill exploits.</p> <p>​</p> <p>It also comes with several customisation options so you can choose how you want to use this:</p> <ol> <li>Which subreddits it should look for (by default it checks <a href="https://www.reddit.com/r/Cryptocurrency/">r/Cryptocurrency</a> and a couple others)</li> <li>How to sort posts (hot by default)</li> <li>How many posts from each sub will be analysed (by default 10)</li> <li>What keywords it should be looking out for (default: Bitcoin and Ethereum)</li> <li>​</li> </ol> <p>You can also specify how often to check for posts, as well as the size of each trade placed.</p> <p>I added a test mode so it can just simulate trades, so you can see how it would work in a live market, but without using real funds.</p> <p>​</p> <p>I just let it run in test mode now and here's the output:</p> <p><code>New posts detected, fetching new posts...</code></p> <p><code>Found matching keywords with the following sentiments: {'BTC': 0.01482083333333333, 'ADA': 0.0}</code></p> <p><code>BTC sentiment is positive: 0.01482083333333333, preparing to buy...</code></p> <p><code>PLACING TEST ORDER</code></p> <p><code>Order created with 0.000439 on BTC</code></p> <p><code>Sentiment for ADA is negative or ADA is currently in portfolio</code></p> <p>Here's my test order stored locally so that I can track the results. It bought Bitcoin hah.</p> <p><code>{</code></p> <p><code>"BTC": {</code></p> <p><code>"symbol": "BTCUSDT",</code></p> <p><code>"price": "34170.99000000",</code></p> <p><code>"volume": 0.000439,</code></p> <p><code>"time": 1624904258.977829</code></p> <p><code>}</code></p> <p><code>}</code></p> <p>You can also change the pairing to something other than USDT
</p> <p>​</p> <p>And here's an example of how posts are being stored:</p> <p><code>{"title": "SafeDollar \u2018stablecoin\u2019 drops to $0 following $248 million DeFi exploit on Polygon", "subreddit": "Cryptocurrency", "body": ""},</code></p> <p>It has no body as it's a link. Though you can see that it ignored SafeDollar and only picked BTC and ADA as these are two of the keywords I have chosen for it.</p> <p>​</p> <p>The bot will also stop from buying or analysing posts while the same posts are in top/hot, to avoid re-buying on the same signal.</p> <p>​</p> <p>Here's the GitHub repo for the project:</p> <p><a href="https://github.com/CyberPunkMetalHead/reddit-cryptocurrency-trading">https://github.com/CyberPunkMetalHead/reddit-cryptocurrency-trading</a></p> <p>And I also made a guide on how to set this up and get it running if you need more info:</p> <p><a href="https://www.cryptomaton.org/2021/06/27/cryptocurrency-binance-trading-bot-that-analyses-reddit-sentiment/">https://www.cryptomaton.org/2021/06/27/cryptocurrency-binance-trading-bot-that-analyses-reddit-sentiment/</a></p> </div><!-- SC_ON --> submitted by <a href="https://www.reddit.com/user/CyberPunkMetalHead"> /u/CyberPunkMetalHead </a> <br/> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/o9qasc/i_configured_a_crypto_trading_bot_to_buy_crypto/">[link]</a></span> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/o9qasc/i_configured_a_crypto_trading_bot_to_buy_crypto/">[comments]</a></span>Kind Regards R
<!-- SC_OFF --><div class="md"><p>I mainly built this for fun, and as a coding challenge, as I'm not sure how viable it would be to base my investing decisions based on the Reddit hive-mind. But having said that, I will test the tool out and see what it can do - who knows, maybe among all the shills and moon-farmers is where insight truly lives.</p> <p>​</p> <p><strong>Here's a little bit about how it works:</strong> </p> <p>It's a trading bot that analyses reddit post sentiment and automatically buys the coins mentioned in the post. So it checks if the post title and body talk positively about x coin, and if that's the case it goes ham on that coin.</p> <p>But it only does this for coins I tell it to look out for: by default it will only check BTC and ETH but you can add any number of keywords. This is built in to discourage shill exploits.</p> <p>​</p> <p>It also comes with several customisation options so you can choose how you want to use this:</p> <ol> <li>Which subreddits it should look for (by default it checks <a href="https://www.reddit.com/r/Cryptocurrency/">r/Cryptocurrency</a> and a couple others)</li> <li>How to sort posts (hot by default)</li> <li>How many posts from each sub will be analysed (by default 10)</li> <li>What keywords it should be looking out for (default: Bitcoin and Ethereum)</li> <li>​</li> </ol> <p>You can also specify how often to check for posts, as well as the size of each trade placed.</p> <p>I added a test mode so it can just simulate trades, so you can see how it would work in a live market, but without using real funds.</p> <p>​</p> <p>I just let it run in test mode now and here's the output:</p> <p><code>New posts detected, fetching new posts...</code></p> <p><code>Found matching keywords with the following sentiments: {'BTC': 0.01482083333333333, 'ADA': 0.0}</code></p> <p><code>BTC sentiment is positive: 0.01482083333333333, preparing to buy...</code></p> <p><code>PLACING TEST ORDER</code></p> <p><code>Order created with 0.000439 on BTC</code></p> <p><code>Sentiment for ADA is negative or ADA is currently in portfolio</code></p> <p>Here's my test order stored locally so that I can track the results. It bought Bitcoin hah.</p> <p><code>{</code></p> <p><code>"BTC": {</code></p> <p><code>"symbol": "BTCUSDT",</code></p> <p><code>"price": "34170.99000000",</code></p> <p><code>"volume": 0.000439,</code></p> <p><code>"time": 1624904258.977829</code></p> <p><code>}</code></p> <p><code>}</code></p> <p>You can also change the pairing to something other than USDT
</p> <p>​</p> <p>And here's an example of how posts are being stored:</p> <p><code>{"title": "SafeDollar \u2018stablecoin\u2019 drops to $0 following $248 million DeFi exploit on Polygon", "subreddit": "Cryptocurrency", "body": ""},</code></p> <p>It has no body as it's a link. Though you can see that it ignored SafeDollar and only picked BTC and ADA as these are two of the keywords I have chosen for it.</p> <p>​</p> <p>The bot will also stop from buying or analysing posts while the same posts are in top/hot, to avoid re-buying on the same signal.</p> <p>​</p> <p>Here's the GitHub repo for the project:</p> <p><a href="https://github.com/CyberPunkMetalHead/reddit-cryptocurrency-trading">https://github.com/CyberPunkMetalHead/reddit-cryptocurrency-trading</a></p> <p>And I also made a guide on how to set this up and get it running if you need more info:</p> <p><a href="https://www.cryptomaton.org/2021/06/27/cryptocurrency-binance-trading-bot-that-analyses-reddit-sentiment/">https://www.cryptomaton.org/2021/06/27/cryptocurrency-binance-trading-bot-that-analyses-reddit-sentiment/</a></p> </div><!-- SC_ON --> submitted by <a href="https://www.reddit.com/user/CyberPunkMetalHead"> /u/CyberPunkMetalHead </a> <br/> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/o9qasc/i_configured_a_crypto_trading_bot_to_buy_crypto/">[link]</a></span> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/o9qasc/i_configured_a_crypto_trading_bot_to_buy_crypto/">[comments]</a></span>Kind Regards R
