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.3.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.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trade_strategy-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3841896570eba22b489cdea77bbd6b9fbec0aee74af42b679ba3ba392bb38123
MD5 9c827cb4850446568f566f8ca0dc71df
BLAKE2b-256 0d3dc6c0437197a3bb363e02ae0c445c41e5a4503fe58ac46d98571381f03554

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trade_strategy-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea2200749b89fcd6cf312e87aea181fe2309d7c7a7aebb2bfd0e267adc4780d6
MD5 ab59ca57d73f7a6a4056d33a80562308
BLAKE2b-256 d1d6c5c79676b0dd0c3935edb42e2e03305637e98ee4b5d9e10010a029ccd00d

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