How I Made Some Crypto Trading Bots

in #cryptocurrency7 years ago

coinflashtrend.com will notify you when Google trends is trending up for your crypto of choice.


I made it after seeing this tweet from Chris Burniske:

It looked like Google trends is correlated with the price of Bitcoin. Cool. The first thing I needed was clean Google trend data. I figured Google Trends would have an API but they don’t, so it’s a little tricky grabbing information from them. If you want to grab a JSON-esque version of a trend up until close to today, use this URL:
https://trends.google.com/trends/fetchComponent?hl=en-US&q=YOUR_QUERRY&date=now%20DAYS_BACKd&cid=TIMESERIES_GRAPH_0&export=3
replacing <> with your variables.

Here’s the URL I used, you see it returns a JSON-esque version of this graph. One of the main problems I have is that the data is always at least 4 weeks old using this method, today is August 30th but the last date is for the 12th.

If you want the latest up to date trend data you’ll need to use this Google Trend URL and you can get a CSV but you have to click on the export CSV button. I have not figured a way to automate this yet. Tried Java’s HttpURLConnection and HTMLUnit but couldn’t figure it out. Any ideas?

The strategy I use in the ‘Backtest’ section will buy on the first upswing, then sell on the first downswing. Someone on Reddit actually suggested to never sell, just buy on any upswing and then compare this to a strategy where you just buy every week. So that’s on the horizon. But right now, you’ll get notified when an upswing starts in Google Trends through an email. I have a cron job that gets the updated Google trend data every day.

I also made some other bot strategies, like one that is based on Reddit posts. You can find it here:
https://coinflashapp.com/botanalysis.html

The Reddit bot gets the top post from the subreddits ethtrader, bitcoin and litcoinmarkets and runs the title of that post through Google’s sentiment analyzer. This sentiment analyzer API returns a score -1 to 1 depending on if the text you feed is determined to be emotionally positive or negative. You can actually test it out on the Google link above, it’s really cool. I was hoping positive articles about coins is correlated with rising price but that was not the case as you can see above. The sentiment analyzer kind of works but the reddit posts are sometimes about price and other times about more personnel stuff:

You can hover over each point to see the title of the Reddit post and click on the point to see the actual Reddit post. I also have two other strategies on that site, one that buys on every dip detected (slope changes from negative to positive) and sells when the slope of the price goes from positive to negative. I used a simple linear regression javascript function to do this. Finally, I have a strategy that buys or sells based on investing.com. I built a web scraper that grabs whether the site gives a Summary ‘Buy’ or ‘Sell’ for that day under the ‘Daily’ heading.

I was inspired by Dimitry’s daily update on his site coinsheet.com for that investing.com strategy. Would any of you ever put any money into these bots if I connected the Coinbase API to it? Follow me on twitter or email me if you wanna talk crypto at [email protected]. And check out Coinflash which automatically invests your spare change into cryptocurrency like Bitcoin and Ethereum. I built it:)

Sort:  

I will check it out. Thanks

Cool, hit me up if you have questions!

Thanks, I will!

Thanks dude!

Hey, man.

Did you give up on it?

Last update seems to be from on 08/16/2017 :(

https://coinflashapp.com/googlebot.html

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.029
BTC 76307.65
ETH 2926.29
USDT 1.00
SBD 2.64