A collection of common groups used on Composer symphonies. To be used in combination with composer-trade-py SDK
Project description
composer-trade-common
A collection of common groups used in Composer symphonies. Install with:
pip install composer-trade-common
Then import groups directly:
from composer_trade_common import safe_sectors_or_bonds
Usage
In this example we can import the defined group Safe Sectors or Bonds.
Input:
from composer.client import ComposerClient
from composer.models.common.symphony import *
from composer_trade_common import safe_sectors_or_bonds
import os
from dotenv import load_dotenv
load_dotenv()
symph = SymphonyDefinition(
name="Example Group Import",
description="Demonstrates importing a group from the shared collection",
rebalance="daily",
children=[
WeightCashEqual(
children=[
safe_sectors_or_bonds
]
),
],
)
client = ComposerClient(
api_key=os.getenv("COMPOSER_API_KEY"),
api_secret=os.getenv("COMPOSER_API_SECRET"),
)
res = client.backtest.run_v2(symphony=symph)
print(res)
Output:
BacktestResult(stats=Stats(sharpe=1.71, cumulative=7095.53%, drawdown=18.00%, ann_return=25.53%), final_value=719,553.16, days=6880)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file composer_trade_common-0.1.0.tar.gz.
File metadata
- Download URL: composer_trade_common-0.1.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1fc3a27a811c1183889132b07eff23c83e7d818247a952c67ce297e8cb1ae1e
|
|
| MD5 |
147b65bf3f75146d586a068a4e0fa5cd
|
|
| BLAKE2b-256 |
e6c7996247c796b0f29b28d469c386ebbe14b7825173b8867fb87bc85880cfc9
|
File details
Details for the file composer_trade_common-0.1.0-py3-none-any.whl.
File metadata
- Download URL: composer_trade_common-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac6c755a89bb575cfa6db99639b4d47354f2a6909e6e6ecad5ea268b7f55db1d
|
|
| MD5 |
ebce43b0bc7e0e3814829bc1bab277f6
|
|
| BLAKE2b-256 |
97b824bee7b7e758380aee3dc4572108f879062e9b4b20b0ef80fa59eedd80f6
|