Skip to content

Save strategies as part of the backtest report #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[flake8]
exclude =
investing_algorithm_framework/domain/utils/backtesting.py
investing_algorithm_framework/infrastructure/database/sql_alchemy.py
examples
66 changes: 52 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<br/>
<div align="center">
<h1><a href="https://investing-algorithm-framework.com" target="_blank">Investing Algorithm Framework</a></h4>
</div>
<br/>

<div align="center">
<b>Rapidly build and deploy quantitative strategies and trading bots</b>
</div>
<br/>

<p align="center">
<a target="_blank" href="https://investing-algorithm-framework.com">View Docs</a>
<a href="https://investing-algorithm-framework.com/Getting%20Started/installation)">Getting Started</a>
</p>

---

<a href=https://investing-algorithm-framework.com><img src="https://img.shields.io/badge/docs-website-brightgreen"></a>
[![Build](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml/badge.svg)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml)
[![Tests](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml)
Expand All @@ -6,10 +24,6 @@
<a href="https://www.reddit.com/r/InvestingBots/"><img src="https://img.shields.io/reddit/subreddit-subscribers/investingbots?style=social"></a> <br/>
[![GitHub stars](https://img.shields.io/github/stars/coding-kitties/investing-algorithm-framework.svg?style=social&label=Star&maxAge=1)](https://github.com/SeaQL/sea-orm/stargazers/) If you like what we do, consider starring, sharing and contributing!

# [Investing Algorithm Framework](https://github.com/coding-kitties/investing-algorithm-framework)

The Investing Algorithm Framework is a Python framework that enables swift and elegant development of trading bots.

## Sponsors

<a href="https://www.finterion.com/" target="_blank">
Expand All @@ -22,7 +36,7 @@ The Investing Algorithm Framework is a Python framework that enables swift and e

## Features and planned features:

- [x] **Based on Python 3.9+**: Windows, macOS and Linux.
- [x] **Based on Python 3.10+**: Windows, macOS and Linux.
- [x] **Documentation**: [Documentation](https://investing-algorithm-framework.com)
- [x] **Persistence of portfolios, orders, positions and trades**: Persistence is achieved through sqlite.
- [x] **Limit orders**: Create limit orders for buying and selling.
Expand All @@ -33,7 +47,7 @@ The Investing Algorithm Framework is a Python framework that enables swift and e
- [x] **Live trading**: Live trading.
- [x] **Backtesting and performance analysis reports** [example](./examples/backtest_example)
- [x] **Backtesting multiple algorithms with different backtest date ranges** [example](./examples/backtests_example)
- [x] **Backtest comparison and experiments**: Compare multiple backtests and run experiments.
- [x] **Backtesting and results evaluation**: Compare multiple backtests and run experiments. Save and load backtests. Save strategies as part of the backtest. [docs](https://investing-algorithm-framework.com/Getting%20Started/backtesting)
- [x] **Order execution**: Currently support for a wide range of crypto exchanges through [ccxt](https://github.com/ccxt/ccxt) (Support for traditional asset brokers is planned).
- [x] **Web API**: Rest API for interacting with your deployed trading bot
- [x] **PyIndicators**: Works natively with [PyIndicators](https://github.com/coding-kitties/PyIndicators) for technical analysis on your Pandas and Polars dataframes.
Expand All @@ -45,6 +59,38 @@ The Investing Algorithm Framework is a Python framework that enables swift and e
- [ ] **AWS Lambda support (Planned)**: Stateless running for cloud function deployments in AWS.
- [ ] **Azure App services support (Planned)**: deployments in Azure app services with Web UI.

## Quickstart

1. First install the framework using `pip`. The Investing Algorithm Framework is hosted on [PyPi](https://pypi.org/project/Blankly/).

```bash
$ pip install investing-algorithm-framework
```

2. Next, just run:

```bash
$ investing-algorithm-framewor init
```

or if you want the web version:

```bash
$ investing-algorithm-framework init --web
```
> You can always change the app to the web version by changing the `app.py` file.

The command will create the file `app.py` and an example script called `strategy.py`.

From there, you start building your trading bot in the `strategy.py`.

More information can be found on our [docs](https://docs.blankly.finance)

> Make sure you leave the `app.py` file as is, as it is the entry point for the framework.
> You can change the `bot.py` file to your liking and add other files to the working directory.
> The framework will automatically pick up the files in the working directory.
```

## Example implementation

The following algorithm connects to binance and buys BTC every 2 hours.
Expand Down Expand Up @@ -262,14 +308,6 @@ app.add_portfolio_configuration(
We are continuously working on improving the performance of the framework. If
you have any suggestions, please let us know.

## How to install

You can download the framework with pypi.

```bash
pip install investing-algorithm-framework
```

## Installation for local development

The framework is built with poetry. To install the framework for local development, you can run the following commands:
Expand Down
49 changes: 0 additions & 49 deletions examples/app.py

This file was deleted.

Loading
Loading