Quant Science Profile picture
Develop profitable trading strategies, build a systematic trading process, and trade your ideas with Python—even if you’ve never done it before.

Jul 25, 9 tweets

🚨BREAKING: A new Python library for algorithmic trading.

Introducing TensorTrade: An open-source Python framework for trading using Reinforcement Learning (AI)

TensorTrade is an open source Python framework for building, training, evaluating, and deploying robust trading algorithms using reinforcement learning leveraging:

- numpy
- pandas
- gym
- keras
- tensorflow

Example: Using TensorTrade to Train and Evaluate with Reinforcement Learning

Step 1: Create training and evaluation sets

We'll start by creating a training and evaluation set as CSV files.

Step 2: Create a Configuration

Here we are using the config dictionary to store the CSV filename that we need to read.

Step 3: Initialize and run with Ray

Now it’s time to initialize and run Ray, passing all the parameters necessary, including the name of the environment creator function (create_env defined above).

Next Steps: Reward Agents

Reward Agents (AI) bring a new capability to allow Reinforcement Learning to integrate a reward system that allows the Agent to optimize the strategy to a reward (e.g. profit).

Performance:

Here's a performance chart of a reward-optimized example.

🚨 NEW WORKSHOP: How I built an automated algorithmic trading system with Python.

Hedge funds have better tools & faster execution.

That ends on August 7th.

👉 Register here to learn how to compete in an unfair game with Python (500 seats): learn.quantscience.io/become-a-pro-q…

That's a wrap!

If you enjoyed this thread:

1. Follow me @quantscience_ for more of these
2. RT the tweet below to share this thread with your audience

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling