Python eos trade bot


Line 11 Starts a perpetual loop and will not stop until an interrupt or exception happens. We are not looking for the HTTP code, we want payload. Bear in mond that we have zero error checking built in here which is a terrible idea but at this stage we can ignore that. I assure you we will include it as we progress.

Now that we have the json returned to us we need to access it. Here is what we get back from HitBTC and saved to the json variable: We only want a few of these values, and as this is now stored as a dictionary, we simply pass the key value into our json variable to retrieve the key we want. Let's walk through the code When I reference line numbers I am not including empty lines Thankfully, most of the hard work has already been done for us by the python-dev team's, we just need to import all the libraries that will help us get the job done.

Line 7 as with anything that starts with a is a comment, so explains itself Line 8 is an empty dictionary that we will use and allocate later on in the code. The documentation for the request model can be found here Line 11 Starts a perpetual loop and will not stop until an interrupt or exception happens. 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. 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.