Skip to content

This repository contains the implementation of a trading bot for financial markets

License

Notifications You must be signed in to change notification settings

TheStoneMX/MLFlow-RL-Finance-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MLFlow-RL-Finance-Bot

This repository contains the implementation of a trading bot for financial markets, leveraging machine learning techniques and the MLflow platform to manage the entire machine learning lifecycle. The project includes data preprocessing, training, validation, and backtesting of trading strategies using a custom TradingBot class and various financial indicators. The integration with MLflow allows for comprehensive experiment tracking, model management, and performance monitoring.

Features

•	Financial Data Handling: Preprocessing and managing financial data with custom indicators and features.
•	TradingBot: Implementation of a reinforcement learning-based trading bot.
•	Training & Validation: Scripts to train and validate the trading bot using historical data.
•	Backtesting: Both vectorized and event-based backtesting methods to evaluate trading strategies.
•	MLflow Integration: Comprehensive experiment tracking, model logging, and performance metrics with MLflow.
•	Visualization: Plotting tools to visualize trading performance and financial indicators.

git clone https://github.com/yourusername/TradingBot-MLflow.git cd TradingBot-MLflow

2. Install Dependencies:

Ensure you have Python 3.9 or later. Install the required Python packages: pip install -r requirements.txt

3. Set Up MLflow Tracking Server:

If you don’t have an MLflow server running, you can start one locally: mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./mlruns --host 0.0.0.0 --port 5000

Usage

1.	Prepare Financial Data:
Ensure you have the financial data required for training. The data should be in the format expected by the Finance class.
2.	Train and Validate the Trading Bot:
Run the training script to train and validate the trading bot. This script logs parameters, metrics, and the trained model using MLflow.
python train.py
  1. Backtest the Trading Bot: Use the backtesting scripts to evaluate the performance of your trading strategies on unseen data. python backtest.py
4.	Visualize Results:
The scripts include plotting functions to visualize the performance of the trading bot and various financial indicators.

Directory Structure

TradingBot-MLflow/ ├── data/ # Directory to store financial data

├── finance.py # Module for financial data handling and feature engineering

├── tradingbot.py # TradingBot class and related functions ├── train.py # Main script for training the trading bot

├── requirements.txt # Required Python packages

└── README.md # Project description and usage instructions

Contributing

Contributions are welcome! Please create a pull request or open an issue to discuss any changes or improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any inquiries or support, please contact Oscar Rangel at [email protected]

About

This repository contains the implementation of a trading bot for financial markets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages