Tools to manage portfolio risk analysis
Project description
invest-tools
Tools to manage portfolio risk analysis
Installation
As a python package this should be installable through:
pip install invest-tools
Or:
poetry add invest-tools
Dependencies
The dependencies of this project can be seen in the pyproject.toml
file. However for completeness there is a dependcy on pandas
, statsmodels
and matplotlib
as the basics.
Data Inputs
There are three data inputs which should be present for the package to work as expected.
The path strings to the csvs can be passed in.
- Portfolio price data as a CSV
TIDM | Date | Open | High | Low | Close | Volume | Adjustment |
---|---|---|---|---|---|---|---|
EG | 01/01/2023 | 1 | 1 | 1 | 1 | 1 | 1 |
EG2 | 01/01/2023 | 1 | 1 | 1 | 1 | 1 | 1 |
- Currency data as a CSV
Date | Open | High | Low | Close | Adj Close | Volume |
---|---|---|---|---|---|---|
01/01/2023 | 1 | 1 | 1 | 1 | 1 | 1 |
Example
Build a portfolio of two securities called EG
and EG2
with the weighting split 50:50 between the two. One is denominated in GBP and one in USD.
This will output the mean returns of such a portfolio.
import numpy as np
from invest_tools import portfolio
portfolio_definition = {
"EG": {
"weight": 0.5,
"currency": "gbp"
},
"EG2": {
"weight": 0.5,
"currency": "usd"
}
}
port = portfolio.Portfolio(portfolio_definition, portfolio.Currency.GBP)
port.get_usd_converter("path/to/csv")
port.get_prices("path/to/csv")
port.build()
port.analyse()
print(port.analysis)
port.plot_correlation_heatmap()
port.plot_returns_data()
License
Contact
Just open an issue I guess?
Project details
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
File details
Details for the file invest_tools-0.3.0.tar.gz
.
File metadata
- Download URL: invest_tools-0.3.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.4 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c05c441cd3af9847af34e5e4a95e1c881f24291ce7de4b4aeb5cc783c0abbdab |
|
MD5 | 5fee6e1020e475e0de8332f55466261d |
|
BLAKE2b-256 | 6c36db888531c044466a7cd34fb7357194c9bf1986cc67dbd6d7144bcb3ffd60 |
File details
Details for the file invest_tools-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: invest_tools-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.4 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501855e1ad6c31bd6a3348cc1633d8235f8087e617a9fbc1de22a28cde8bb838 |
|
MD5 | 6b85e3c7d60ffd48291836b8f24939a1 |
|
BLAKE2b-256 | 1e4cfe0bfa4200777608e306d5a19f76f2d736d92e96967e97df482232cfe8f4 |