Skip to main content

Kiwano Portfolio

The purpose of this project is to provide an interface with Binance now, and more exchanges to come, to be able to backtest, livetest and livetrade your trading algorithms on crypto-currencies. We thought we could let you focus all your creativity and effort on your trading strategies, and let us handle the rest, since this part is simpler but necessary.

The code is composed of two classes, a portfolio manager that tracks the progress over time and provides useful statistics on the performance of the trading algorithm. And the inheriting class strategy that plays the trading algo.

Functionalities

To understand how to use this repository, have a look at the main.py file. The typical way to use the code is the following:

  1. Create portfolio;
  2. Add a strategy;
  3. Run in one of the three modes (see below);
  4. Obtain log and plots displaying the performance of your trading strategy.

The three modes are:

  • Backtesting (or FastBacktesting if the strategy loops already in time): will run your algorithm on historical data, and will provide the performance that your algorithm would have had if it was trading in the past.
  • Livetesting: will run your algorithm on real-time data, and will provide the performance that your algorithm would have had if it was trading live, but without actually trading with real money.
  • Livetrading: will run your algorithm on real-time data, and will provide the performance that your algorithm is having while trading live, with real money.

The workflow of strategy is:

  1. Compute the metrics on data
  2. Compute the first layer strategy to create order
  3. Compute the second layer strategy to make the order effective in the portfolio

Requirements

Install the content of the requirements.txt file with pip install -r requirements.txt. You will then need to create an API key and secret on Binance to be able to use the code. Go to API Management in Settings on Binance, and click on Create API. Select System generated API key, name the API, and once you pass the authentication, you have to edit restriction and tick Enable Spot and Margin Trading if you want to livetrade with your algorithm. This is not necessary if you only want to backtest or livetest. You can then copy the API key and secret in a config.py file and define the variables as strings with the following names:

api_key = 'your key as a string'
api_secret = 'your secret as a string'

For an example check the config_template.py in the API/binance/ folder. You can finally save the file in the API/binance folder or pass the filepath as the api_keys_location argument when creating the portfolio. Then you are ready to go!

ToDo

  • [CLEAN] Code + simplify strategy class [DONE]
  • [CODE] Add multiple crypto input [DONE]
  • [CODE] multiple crypto in output

Social media

Want to participate in the Kiwano adventure, join our Discord !

https://discord.gg/698CKv8t

Release files for kiwano-portfolio 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kiwano-portfolio 1.0.1
File Size Uploaded
kiwano_portfolio-1.0.1.tar.gz 33.6 kB Details

Release files / kiwano_portfolio-1.0.1.tar.gz

Download URL kiwano_portfolio-1.0.1.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
abb82e150a1d611af776a269bea8077abdd0a1e7db506f9ca991b952f1758af0
BLAKE2b-256 checksum
How to use checksums
a15ff61e4cbb99ecc11681ab2eca31967dc906e96804885a458e0d544a639982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page