CryptoCurrency Trading on HitBTC with a Python Bot

in #eos6 years ago

Trading cryptocurrencies is a rollercoaster, what happens to prices on the traditional stock markets occurs to crypto assets almost daily.

There is a pattern to be followed for sure and if increasing your token count is the goal, then watching the 30min ticker for your token of choice 24/7 /365 is an easy way to make money. Prices seem to follow an almost predefined flow, dropping and rising at certain times of the day, give or take a few hours, but staring at the screen and breaking away from other commitments is not always possible.

Missing these opportunities can be very frustrating and lead to you making an emotional trade which is never a good idea. What we need is a way to monitor and act upon these fluxations and capitalize no matter what time of day or where we might be. All we need is for something to tell us a threshold has hit, an action happened, why it occurred, log them all for review so that we can continually improve and then, of course, increase our token count.

I will be focusing on a coding logic that will add to our total token amount rather than merely increasing our dollar value. Although these sound the same, in my experience trading over the last few years, making more money is easy, increasing your token count seems harder. If you back the right horse (token) the money will grow exponentially faster than focusing on the dollar value in your account.

The problem is, us mere humans need sleep, so the options as I see it are :

  1. Team up with a globally dispersed set trusted people and split the profits.
  2. Create an API key and use one of the third party tools out there.
  3. Write a bot ourselves that can monitor the token(s) we want and make a trade based on metrics we control and configure.

None of these options are wrong, but they all come with their complications.

Well, as you may have guessed, we are going to opt for number 3. Over the next few months, I will be building a python script that will monitor EOS and take various actions to buy and sell based on price treading data. We will be able to leave this script running permanently as a daemon on a Unix machine and will build in logging, reporting and hopefully a way to interface to or bot via REST API. Just for fun, we may even store our progress on the EOS blockchain (private), so we can get more exposure to that seeing as I already have an ongoing project on SteemIT .

Why HitBTC

The API documentation for HitBTC is excellent. They have REST API access and also allow streaming of data via a single TCP connection. Streaming the data will give us considerable time-saving benefits as the REST API needs a new HTTP Post request every time which builds and tears down a new TCP session with their servers. HitBTC also offers an excellent swagger page to test commands and get a feel for the return values that will allow us to play offline with the result so we can manipulate the data without having to hit their servers repeatedly.

HitBTC swagger page

https://api.hitbtc.com/api/2/explore/

If we get enough interest in this project, I will post it on github so more people can contribute.

Coin Marketplace

STEEM 0.19
TRX 0.16
JST 0.032
BTC 63598.38
ETH 2746.61
USDT 1.00
SBD 2.65