simonpotel / QTSBE

Quantitative Trading Strategy Backtesting Environment
MIT License
0 stars 0 forks source link
backtesting-trading-strategies blockchain

QTSBE - Quantitative Trading Strategy Backtesting Environment

QTSBE is an open-source project aimed at providing a robust environment for backtesting quantitative trading strategies. It includes an API developed in Python using Flask and an interface built with Python.

Features

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/simonpotel/QTSBE
  2. Install dependencies:

    cd QTSBE
    pip install -r requirements.txt

Usage

  1. Create Your Strategy:

    • Create your strategy based on the default structure found in api/strategies/default.py, or use the simple base example in api/strategies/rsi_example.
    • Implement your strategy by creating a new Python file and defining the analyse function that returns the required data. You can choose to use indicators within the code without passing them in the JSON response.
  2. Start the API:

    • Run the API using api/api.py.
    python api/api.py
  3. Access the API:

    • Get the API response in your web browser: http://127.0.0.1:5000/QTSBE/<data_set>/<your_strategy_name>.
  4. Visualize Results:

    • Start the GUI for visualizing the API response by running display/python/main_gui.py.
    python display/python/main_gui.py
    • The display tool allows you to select your strategy and the dataset to apply it to.

    Example of the default strategy:

    image

  5. Real Strategy Stats:

    • Example of a simple strategy based on Bollinger Bands:

      • Full menu view:

      image

      • Price Chart:

      image

      • Trade Ratio and Cumulative Returns:

      image

      • RSI and MACD Graphs:

      image

Scanner

BinanceScanner

Powerful tool for analyzing Binance trading pairs within the quantitative trading strategy backtesting environment. It conducts comprehensive scans of all Binance pairs, queries the API with the specified strategy, and consolidates the results into a single file.

Usage

To use the scanner, edit strategy_scanner/scan.py to specify your desired strategy and adjust any relevant arguments. Then, run the following command:

python strategy_scanner/scan.py

image

License

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

Acknowledgments

Librairies

Contact

For questions or inquiries, feel free to contact me on LinkedIn.