Skip to content

zhangguo2002/QTSBE

 
 

Repository files navigation

QTSBE - Quantitative Trading Strategy Backtesting Environment

QTSBE is a robust, open-source platform designed for backtesting quantitative trading strategies. At its core, it provides a powerful Python-based API built with Flask, offering extensive endpoints for seamless integration with existing trading systems and projects.

Key Features

  • Advanced Backtesting Engine: Powered by NumPy and Pandas for high-performance computations
  • Optimized API Architecture: Flask-based with an intelligent caching system for superior performance
  • Dynamic Visualization: Interactive strategy analysis using Plotly
  • Comprehensive Data Integration:
    • Real-time and historical data from Yahoo Finance
    • Cryptocurrency data through Binance API
  • Strategy Scanner: Powerful tool for analyzing multiple assets simultaneously
  • Extensive API Ecosystem: Rich set of endpoints for rapid strategy development and testing

Quick Start Guide

Installation

  1. Clone the repository:
git clone https://github.com/simonpotel/QTSBE
  1. Deploy with Docker:
docker-compose up

Implementation Guide

  1. Strategy Development

    • Base template: api/strategies/default.py
    • Example implementation: api/strategies/rsi_example
    • Create your strategy file with an analyse function
    • Implement technical indicators directly in your strategy code
  2. API Deployment

python api/api.py
  1. API Documentation

    • Access the Swagger UI documentation: http://127.0.0.1:5002/docs
    • Comprehensive endpoint documentation and testing interface
  2. Running Tests

Tip

Run fixtures of the API with : pytest tests/test_api_endpoints.py

  1. Visualization Tools

    a. Generate Plotly Charts:

    sh tests/integrations/plotly_unit.sh

    b. Discord Integration:

    • Configure: integrations/discord_chat_bot/bot.py
    • Launch:
    sh sh/discord_chat_bot.sh

    c. Custom Interface Development

    • Framework available for building custom web interfaces
    • Reference the Smartswap project for implementation examples
  2. Automated Data Collection

    • Configure: tools/auto_fetch/config.json
    • Launch collector:
    sh sh/auto_fetch.sh

Visualization Examples

License

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

Risk Disclaimer

Warning

This software is provided for research and educational purposes only. Users should:

  • Thoroughly review and test all code before implementation
  • Be aware that documentation may not reflect the latest updates
  • Understand that the developers assume no liability for financial losses or calculation errors
  • Conduct their own risk assessment before using in live trading

For professional inquiries and support, connect with me on LinkedIn.

About

Quantitative Trading Strategy Backtesting Environment

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 98.3%
  • Shell 1.4%
  • Dockerfile 0.3%