Using TensorTrade for Making a Simple Trading Algorithm
In this tutorial, I’m going to show how to use Ray with TensorTrade (TT) in order to create a profitable algorithm on a predictable sine curve. You may be asking yourself, why use something so simple when the real world is much more difficult to predict? This is a very good question, and there is a simple answer.
“The man who moves a mountain begins by carrying away small stones.”
- Confucius
Before trying to jump into the world of complex trading environments, a simple sine curve can be used to perform a sanity check on your trading algorithm. The reward and action scheme used should be able to make money on a predictable pattern. If it doesn’t, then there is no possibility success will be found on a more complex environment.
There are some questions to ask before wasting time and resources in developing an algorithm. Primarily, does the reward function correctly specify the goal? In this tutorial, I’ll show a reward and action scheme that can be used to train an agent to make profitable decisions on a sine curve.
Architecture
First, we need to install some libraries.
$ pip install tensortrade==1.0.1b0 ray[tune,rllib] symfit
Now let’s import everything we need to run our code.