Skip to content

A GUI for easy sigtech strat implementation based on conditional decision graphs

Notifications You must be signed in to change notification settings

salimtlemcani/conditional_decision_graph_based_strategies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Trading Strategy Builder

Welcome to the Trading Strategy Builder, a Streamlit-based application that allows users to create, visualize, and run custom trading strategies using a decision tree approach. This tool integrates with the SigTech platform to execute strategies and analyze their performance.

It specializes in path-dependent strategies (sig.DynamicStrategy) based on conditions set by indicators (such as RSI, cumulative returns, and others).

Table of Contents

Features

  • Interactive GUI: Use Streamlit to interactively manage conditions and actions for your trading strategy.
  • Decision Tree Visualization: Visualize your strategy's decision tree using Graphviz.
  • Strategy Execution: Run your strategy using historical data through the SigTech platform.
  • Performance Analysis: View and analyze the performance of your strategies with customizable plots.
  • Strategy Management: Save and load multiple strategies for comparison and further analysis.

Installation

Prerequisites

Steps

  1. Clone the Repository

    git clone https://github.com/salimtlemcani/conditional_decision_graph_based_strategies.git
    cd conditional_decision_graph_based_strategies
  2. Create a Virtual Environment

    python -m venv venv
  3. Activate the Virtual Environment

    • On Windows:

      venv\Scripts\activate
    • On macOS/Linux:

      source venv/bin/activate
  4. Install Dependencies

    pip install -r requirements.txt
  5. Set Up SigTech Environment

    • Ensure you have access to the SigTech platform.
    • Configure your SigTech credentials as per their documentation.

Getting Started

  1. Navigate to the Project Directory

    cd conditional_decision_graph_based_strategies
  2. Run the Streamlit Application

    streamlit run app.py
  3. Access the App

    • Open your web browser and go to the localhost port shown in your console (likely http://localhost:8501)

Usage

The application is divided into several sections accessible from the sidebar:

Manage Conditions

  • Add New Condition: Define new conditions based on indicators like RSI, Volatility, or Cumulative Return.
  • Edit Existing Conditions: Modify or update existing conditions.

Manage Actions

  • Add New Action: Define new actions specifying ETF allocations.
  • Edit Existing Actions: Modify or update existing actions.

View Specifications

  • Conditions: View all defined conditions in JSON format.
  • Actions: View all defined actions in JSON format.
  • Download Specifications: Download conditions and actions as JSON files.

Visualize Decision Tree

  • Decision Tree Visualization: Generate and view the decision tree based on your conditions and actions using Graphviz.

My Strategies

  • Run New Strategy: Execute your strategy over a specified date range and initial cash amount.
  • View Saved Strategies: View and analyze the performance of saved strategies.

Project Structure

conditional_decision_graph_based_strategies/
├── app.py                   # Main Streamlit application
├── modules/                 # Application modules (formerly 'pages')
│   ├── manage_conditions.py
│   ├── manage_actions.py
│   ├── view_specs.py
│   ├── visualize_decision_tree.py
│   └── my_strategies.py
├── utils/                   # Utility modules
│   ├── __init__.py
│   ├── data_utils.py
│   ├── decision_tree_utils.py
│   ├── helper.py            # Utility functions for indicators and comparisons
│   └── plotting_utils.py
├── strategy_builder.py      # Builds the decision tree from specifications
├── strategy_execution.py    # Contains the basket creation method
├── conditions.json          # JSON file storing condition specifications
├── actions.json             # JSON file storing action specifications
├── strategies/              # Directory to store saved strategy objects
├── requirements.txt         # Python dependencies
└── README.md                # Project documentation

Customization

  • Indicators: Extend utils/helper.py to include additional financial indicators as needed.
  • ETFs: Modify the list of ETFs in app.py or in the modules to include those relevant to your strategies.
  • Visualization: Customize the plotting functions in utils/plotting_utils.py to adjust the appearance of performance graphs.

Note: This application requires access to the SigTech platform. Ensure you have the necessary permissions and credentials to use their services.

About

A GUI for easy sigtech strat implementation based on conditional decision graphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published