Skip to main content

A Python package for analyzing investment portfolios, including using quantitative methods like the efficient frontier for calculations an optimal asset allocation strategy.

Project description

trade_strategy

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install trade-strategy

How to Run allocations.py

To run the allocations.py module and see the portfolio allocation results, execute the following command from the project root directory:

python allocations.py

Before running, ensure the following parameters are set within allocations.py:

  • Assets: ["AAPL", "MSFT", "GOOG"]
  • Start Date: 2013-01-01
  • End Date: 2025-03-27

Expected Output

The script will output the lowest risk, highest returns, and highest Sharpe ratio allocations for the specified tickers and date range.

Lowest risk Allocation
Returns                    0.248073
Risk                       0.234054
Sharpe Ratio               1.059898
Weights         [0.347, 0.352, 0.3]
Name: 69, dtype: object
['AAPL', 'MSFT', 'GOOG']

Highest Returns Allocation
Returns                      0.268417
Risk                         0.262248
Sharpe Ratio                 1.023524
Weights         [0.003, 0.986, 0.011]
Name: 116, dtype: object
['AAPL', 'MSFT', 'GOOG']

Highest Sharpe Allocation
Returns                      0.258282
Risk                         0.238805
Sharpe Ratio                 1.081562
Weights         [0.301, 0.588, 0.111]
Name: 128, dtype: object
['AAPL', 'MSFT', 'GOOG']

License

trade-strategy is distributed under the terms of the MIT license.

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

trade_strategy-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trade_strategy-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file trade_strategy-0.1.0.tar.gz.

File metadata

  • Download URL: trade_strategy-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for trade_strategy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 598093bbaa9cd865e9176018619a0bc4b9e18bb2c8f70e105949bb4c4f0d1335
MD5 95befd4439571e23b7cdb8f0b867a358
BLAKE2b-256 7e3f85b96ffe40f26ee8759ce0610a245dd5bec5d45a02b3802a097c61659781

See more details on using hashes here.

File details

Details for the file trade_strategy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trade_strategy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for trade_strategy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e67bcfc6b535cb28fe6dde55645f452739033cfc7ee363d9aa84132f922267c0
MD5 10d669908c6fec7836119a72859d1387
BLAKE2b-256 ce5650627953189fbd8016f5649fb95f04da218a447b6cd3d3ea68d75375931c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page