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

To use the risk_return function, you can use the following Python code:

from trade_strategy import risk_return

tickers = ["AAPL", "MSFT", "GOOG"]
start_date = '2013-03-07'
end_date = '2025-04-05'

risk_return(tickers, start_date, end_date)
  • Assets: ["AAPL", "MSFT", "GOOG"]
  • Start Date: 2013-03-07
  • End Date: 2025-04-05

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.4.tar.gz (5.6 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.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trade_strategy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 63796b61448069093604286026184d2e359a650702ecede32eecda9bad94fad6
MD5 1f764820543f55ea982c264ac0244924
BLAKE2b-256 d7380370a097cf7dad196636499d8e3bb44deacc50d889ab15060736b589f3b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trade_strategy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 297ac08f23cfa61682b4107eb39f23b36caa523adc5c1c80e7e7def816aaac81
MD5 39317fbffcb5610b83ecb4567e9d3243
BLAKE2b-256 0f565f9e0fd47a7d9d64210336cc2e39e9c3992dc51ddc89de9df9ed5eeeb8a2

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