Giter VIP home page Giter VIP logo

backtrader_copilot's Introduction

backtrader_copilot v0.1.0

Goal

The goal of backtrader_copilot is to leverage the power of AI to make powerful quantitative backtesting more efficient for professionals, as well as making it available to amateurs who have great ideas but lack the technical skills to test them.

Using backtrader_copilot allows users to interact with a complex backtesting framework via natural language. Although not achievied in this version, the big picture goal is to remove the requirement for deep understanding of the code base on the user side and allow them to focus on creativity, strategic decision making and planning.

I aim to achieve this by providing useful features revolving around extracting natural language descriptions of implemented backtests, generating visual flow charts of backtesting architecture and trading strategies based on code or descirptions, providing natural language feedback and suggestions for trading strategies and datasets, and generating backtesting code based on natural language descriptions provided by the user.

Introduction

backtrader_copilot is an AI enabled no-code tool to conduct quantitative backtests for trading strategies.

backtrader is a popular python framework that enables algorithmic traders to backtest complex trading strategies on historical data.

Setting up quantitative backtests is a complex task that involves data selection and cleaning, strategy ideation, backtest implementation, strategy optimisation and evaluation of KPI's.

Backtrader is an excellent tool to support this. However, I see several limitations

  • It's quite complex to set up backtests. Many concepts are not intuitively clear to beginners and there are many pitfalls.
  • Quantiative backtesting is computationally intense. Writing efficient code is crucial, but how to achieve this is not always obvious.
  • The speed at which trading strategy ideas can be translated into code is low.
  • It is hard to get feedback on trading stragies and developing new ideas based on existing strategies can be cumbersome.

backtrader_copilot leverages large language models (LLM's) to:

  • set up backtesting code according to natural language descriptions provided by the user
  • identifies issues with provided strategies
  • provides suggestions for improvements of strategies and data sources
  • provides an intuitive UI for non-technical traders to use backtrader_copilot

Here only the OpenAI API is implemented via LangChain. Future iterations will have endpoints for different LLM's available.

Features

  • Loading backtrader code
  • Generating natural language descriptions of implemented strategy rules
  • Generating a graph visualisation of the implemented backtest (required graphviz installed)
  • Generating feedback for implemented trading strategy
  • Generating backtrader backtest code based on natural language description for
    • data
    • strategies
    • analysers
    • (...) more to come
  • Autopilot that guides user through the process of setting up a backtest in backtrader by asking a series of questions.
  • Save generated code

Quick start guide

  • see main_example.py

Limitations

  • A lot of limitations, this is v0.1 with the aim of providing functioning basic infrastructure.
  • This version can only provide very limited and simple but functioning examples, this version is not production ready.
  • Simple prompt templates are implemented, these have a lot of potential for improvement.
  • No web-based UI yest (planned).
  • No custom indicators yet (planned).
  • Only a single shot implementation of the coding agent. More complex code implementation and testing strategies will be required (planned).
  • Autopilot is static and does not ask dynamic questions yet (planned)
  • No logging implemented (planned).

backtrader_copilot's People

Contributors

lukaswesemann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.