0% found this document useful (0 votes)
70 views

How I Created A Bitcoin Trading Algorithm Using Sentiment Analysis With A 29% Return

Biticoin bot

Uploaded by

FabioSantos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
70 views

How I Created A Bitcoin Trading Algorithm Using Sentiment Analysis With A 29% Return

Biticoin bot

Uploaded by

FabioSantos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
How I Created a Bitcoin Trading Algorithm Using Sentiment Analysis With a 29% Return Sa @D cots arn as TL;DR: I've created a formula that predicts whether you should buy or sell Bitcoin based on daily exchange price data and Google Trends keyword sentiment. The model produced a 29% return over 90 days for a $28,839 profit. ‘To what degree can Bitcoin (BTC) price be predicted? What if public! available data from Google ‘Trends can help forecast price fluctuations? nae Agate rg act Au 429% Auta | Mr Hoe car Pan In other words can we reliably build a formula that can outperform the market? These are the questions which I sought answers to. My goal was to try to make sense of a highly volatile, scary and seemingly unpredictable cryptocurreney market. ‘There are many traders that swear by technical analysis and others that go more the fundamental analysis route. The truth is that there is no magic trading strategy that always out-beats the market. There are far too many variables that even the best AI-based trading algorithms cannot consistently profit from. ‘The formula today is very basic and my intention is to present in its raw form and solicit feedback on how to make it better. This is a work-in- progress and by no means fool-proof so please use at your own risk. The truth is that there is no magic trading strategy that always out-beats the market. The Formula Moxinedinamectoreontomcnana-toi agar Zour esergantnetrsyle Dee sno tract ea an 0a ye Hou tne asi Ihave been testing formula of what I believe to be a relatively consistent indicator of BIC price performance. Specifically I was able to model a 29% profit over a 90-day period using $100,000 as the initial investment. Note that this does not take into account exchange trading fees which I hope solutions such as decentralized exchanges will one day eliminate. My model was inspired by the initial work of Willy Woo who originally experimented with Google Trend data as a proxy of active Bitcoin price checking. Here is the process that I use 1, Isearched Google ‘Trends for “BTC USD” and “Buy Bitcoin” over the most recent 90-day period: Moxinedinamectoreontomcnana-toi agar Zour esergantnetrsyle Dee wo decreases. 3. Next I tested when the BTC price difference closes more than $80 above the prior day’s close price, this makes the pattern more consistent. $80 is an arbitrary value that performs well in this dataset. Here's a screenshot of what this looks like: nag pt a 2. Inoticed that when the “BTC USD” to “Buy Bitc« ~3:1 (specifically <35%) at the BTC price “close” for the day, the following day's close price increases. If more than a ~3:1 ratio (specifically >35%) (ie. 4:1 or 5:1) then its a signal to sell because the subsequent day's price fic | =ifwocciaoast,cte6), a", "SELLY © Bate [ate us0 |Buy Bizoin Price 2 Bmeoroe) 19] 6.57030] 20005 SELL 3 [ame-o7-o7] 52 9] 6.s56.00]s05¢% Buy 183 « (z0ve-07-00] 9) Zale 7rsae| 0.51% SEL 3 = /B016-07-09] zofe7ai.7s| 33.90% SEL 2 «© 2018-07-10) 8) 2i[esz65| 308% SELL 12 > ‘aore-o7-¥4] 59) 9]6.s9873]s605% SELL 65 = ame-or-va) 7 Zale zz. 23.50% SELL 65 © ao16-07-19) 7) Pale zas.s| 40.35% SEL 9 porate a5 2o[6.276.12| 4.4% SELL 38 1 aoeo7-16| 40 16.3504 son ae 2 aoeorse| 2 afe.a.75|37.10% BUY 342 © aoeorsr|—_e ‘ol? sot ou|e 15% SELL 572 1 ao1e.07-16) 96 267 570.76| 504% SELL 50 Moxiinedimamectoreontoncnna-stoitagaorirwareZouresergansnetrsossin 76 art Ace Wn 29% Ruy Me Hour [Haha aun ” ratio is less than ‘00,000 00.709 104,726 si3723 nae Abate rg art Acs Win 29% Ruby Me Hour [Haha au soar, Tp sel necoes eee emus 8 fous [rasta nove es poie-rai| sa[ froze aes Seu 8 era] sof al 78 noon seu soe sol 5 re or] 23 pov ae| ino! fae oom S78 sever so[ ar lener con seu foiesral ——so[ lst nro ae soiecat| ee sles cee ee pois] —ro| fess s| con seu 27 poiera| [ofan seu > seis sot fem nres eeu 33 ees iol sl rol ere ea 0 aoie-ne| —eo| ar] rena on seu poieag| sel ef 7.6m seu BTC USD: Daily indicator directly from Google Trends. Buy Bitcoin: Daily indicator directly from Google Trends. Price: Current day's close price from C Column E: “Buy Bitcoin"/"BTC USD” ratio Column F: The Buy/Sell decision formula. For example here is the formula for cell F20: in Market Cap. Moxiinedinamectoneonton cnet ragabiethraers Zour tesergantnetrsylesDse7¢ =if(AND(E20>35%,G20>80),”BUY”,”SELL”) . Note that “35%” is the threshold to Buy along with the price being greater than “$80”. nae Agate rg eet ra 2 0% Rane ty Me Hand can [Man Column G: Bitcoin price difference from prior day's close. Column H: Running total based on an initial $100,000 investment on 7/7/2018 (the first Buy). Results of the Model and Next Steps So over a 90-day period a $100K investment becomes $128,839 in my model — almost a 29% return. But this is far from an opt there are several things that I'd like to optimize. ized model and ‘The “>35%” and “>$80” are rather arbitrary based on what seems to work in this limited 90-day dataset. Is there a better formula that will yield a better Buy/Sell signal? These variables seem to work at the given $6k-8k BTC price level. I would like to test more historical data over the past year or two. The model would compare the total earnings from Buy/Sell signals using an array of (~3:1— ~5:1) and the “$80” would instead be a fixed percentage of the daily BTC Moxiinedinamectoneonton cnet ragabiethraers Zour tesergantnetrsylesDse7¢ a0 Moxiinedinamectoneonton cnet ragabiethraers Zour tesergantnetrsylesDse7¢ ow td ag Ao Ug Sree i 2% ey Mar Hoa eno Mem price so that it could account for major price spikes. For example perhaps the optimal model ends up being a 3.23-1 ratio at 0.014543229 of the daily price fluctuation. ‘The variable input matrix would look something like this: oot ants on os ona ons oe If You Are a Data Guru Let's Talk In other words I want to setup a test to find the optimal variables to plug-in that maximizes profit for the given dataset. This would involve regression testing against past price and sentiment data. My hypothesis is that there are optimal variables at different price levels. ‘osanoot oat ate Tg Rn Ue art Ace Wn 29% Ruy Me Hour [Haha aun Pm currently testing a “v2” of this algorithm and would love to collaborate with any data gurus with the R or Python chops to run a full regression and goal seeking script to optimize the algorithm. Feel free to drop mea comment or a private note and I will be in touch. ‘To the moon! @ UPDATE: Due to some excellent community feedback and some interesting new patterns found I'l be doing a follow-up series with my v2 edition. If you want to be the first to see my new formula follow me here on Medium. Sign up for Get Better Tech Emails via HackerNoon.com how hackers start thelr afternoons. the real shit is on hackernoon.com. Take a look Your email Moxiinedinamectoneonton cnet ragabiethraers Zour tesergantnetrsylesDse7¢ 0 ‘osanoot oat ate Tg Rn Ue art Ace Wn 29% Ruy Me Hour [Haha aun BtcoinCrypocurency Cryptocuroncy Investment Cureney Exchange DataScance Learn more. Make Medium yours. Share your thinking. Moxiinedinamectoneonton cnet ragabiethraers Zour tesergantnetrsylesDse7¢ oH

You might also like