In this tutorial, we will continue developing a Bitcoin trading bot. We’ll integrate more technical indicators into our code, we try a newly proposed normalization technique, and of course, I’ll slightly modify the whole code that it could be much easier to test our trained models.

Welcome back to my 7th tutorial part with the Reinforcement Learning Bitcoin trading bot. To get to the point where we are now, I had to write thousands of code lines and spend thousands of hours while training my models. But if someone would be told me, that to get to the current 7th tutorial it would have cost me so much, I am not sure if I would be starting doing this tutorial series.

On the other hand, I’m proud of myself that I didn’t give up and no matter how hard it was or I didn’t know…

In this tutorial, we’ll learn what is the simplest way to download historical cryptocurrency OHCL market data via exchange APIs and we’ll use this data to train our Reinforcement Learning Bitcoin trading agent that could finally beat the market!

Algorithmic trading is a popular way to address the rapidly changing and volatile environment of cryptocurrency markets. However implementing an automated trading strategy is challenging and requires a lot of backtesting, which in turn requires a lot of historical data and computational power. While developing a Bitcoin RL trading bot I found out that it’s quite hard to get lower timeframe historical timeframe data. While there are many sources on the market that offer historical cryptocurrency data most of them have drawbacks. A lot of them require to pay for such data and are not that cheap, and sources…

In this tutorial, we’ll integrate a few most popular technical indicators into our Bitcoin trading bot to make it learn even better decisions while doing automated trades in the market.

In my previous tutorials, we already created a python custom Environment to trade Bitcoin, we wrote a Reinforcement Learning agent to do so. Also, we tested 3 different architectures (Dense, CNN, LSTM) and compared their performance, training durations, and tested their profitability. Actually, I thought that probably there are no traders or investors who would be doing blind trades without doing some kind of technical or fundamental analysis, more or less everyone uses technical indicators. So I thought ok if we can create a trading bot doing some kind of profitable trades just from Price Action, maybe we can…

Let’s improve our deep RL Bitcoin trading agent code to make even more money with a better reward strategy and by testing different model structures

In the last article, we used deep reinforcement learning to create a Bitcoin trading agent that could beat the market. Although our agent was profitable compared to random actions, the results weren’t all that impressive, so this time we’re going to step it up and we’ll try to implement few more improvements with the reward system and we’ll test how our profitability depends on Neural Network model structure. Although, we’ll test everything with our code and of course, you’ll be able to download everything from my Github repository.

Reward Optimization

Image for post
Image for post

I would like to mention, that while writing my reward strategy…

In this tutorial, we will continue developing a Bitcoin trading bot, but this time instead of doing trades randomly, we’ll use the power of reinforcement learning.

The purpose of the previous and this tutorial is to experiment with state-of-the-art deep reinforcement learning technologies to see if we can create a profitable Bitcoin trading bot. There are many articles on the internet, that states, that neural networks can’t beat the market. However, recent advances within the field have shown that RL agents are typically capable of learning rather more than supervised learning agents within similar problem domains. For this reason, I’m writing these tutorials to experiment if it’s possible, and if it is however profitable we are able to build these trading bots.

While I won’t…

In this part, we are going to extend the code written in my previous tutorial to render a visualization of the RL Bitcoin trading bot using Matplotlib and Python. If you haven't read my previous tutorial and you are not familiar with the code I wrote, I recommend first reading it before reading this tutorial further.

If you are unfamiliar with the matplotlib Python library, don’t worry. I will be going over the code step-by-step, so you could create your own custom visualization, or modify mine according to your needs. If you can’t understand everything, as always, this tutorial code is available on my GitHub repository.

Before moving forward, I will show you a short preview of what we are going to create in this tutorial:

Image for post
Image for post
gif by author generated with Matplotlib

At first look, it might look quite complicated, but actually, it’s not that hard. It’s just a couple of parameters updating on each environment step with some key information…

In this tutorial, we will write a step-by-step foundation for our custom Bitcoin trading environment where we could do further development, tests and experiments.

In my previous LunarLander-v2 and BipedalWalker-v3 tutorials, I was gathering experience in writing Proximal Policy Optimization algorithms, to get some background to start developing my own RL environment. The mentioned tutorials were written upon OpenAI’s gym package, which allows us to experiment with our own reinforcement learning algorithms upon a ton of free environments to experiment with.

These OpenAI environments are great for learning, but eventually, we will want to set up an agent to solve the custom problem. To do this, we would need to create a custom environment, specific to our problem domain. When we have our…

In this tutorial, we’ll learn more about continuous Reinforcement Learning agents and how to teach BipedalWalker-v3 to walk!

First of all, I should mention that this tutorial is a continuation of my previous tutorial, where I covered PPO with discrete actions.

To develop a continuous action space Proximal Policy Optimization algorithm, first, we must understand what is the difference between them. Because LunarLander-v2 environment has also and continuous environment called LunarLanderContinuous-v2, I’ll mention what is the difference between them:

  • LunarLander-v2 has a Discrete(4) action space. This means, there are 4 outputs (left engine, right engine, main engine, and do nothing) and we send to the environment which one we want to execute. …

Getting Started

Let’s code from scratch a discrete Reinforcement Learning rocket landing agent!

Image for post
Image for post
(GIF by author)

Welcome to another part of my step-by-step reinforcement learning tutorial with gym and TensorFlow 2. I’ll show you how to implement a Reinforcement Learning algorithm known as Proximal Policy Optimization (PPO) for teaching an AI agent how to land a rocket (Lunarlander-v2). By the end of this tutorial, you’ll get an idea of how to apply an on-policy learning method in an actor-critic framework in order to learn navigating any discrete game environment, next followed by this tutorial I will create a similar tutorial with a continuous environment. …

How I created YOLOv4 Object Detection Counter-Strike Global Offensive aimbot

Welcome to my last YOLOv4 custom object detection tutorial, from the whole series. After giving you a lot of explanations about YOLO I decided to create something fun and interesting, which would be a Counter-Strike Global Offensive game aimbot. What is aimbot? Actually idea is to create an enemy detector, aim at that enemy and shoot it. The same idea we could use in real life for some kind of security system, for example, detect and recognize people around our private house and if it’s an unknown person aim lights at that person or turn on some kind of…

Rokas Balsys

Welcome to my blog. This blog is focused on creating basic and advanced python tutorials for software developers, programmers, and engineers to learn.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store