Skip to main content

A comprehensive library for financial analysis

Project description

StockDataManager

This Python library offers a combination of technical analysis tools and fundamental data retrieval functionalities, designed to support investors, researchers, and enthusiasts in the financial markets.

This Python library provides a comprehensive suite of tools for both technical and fundamental analysis, along with more advanced options analysis features. Utilizing the yfinance library, it provides easy access to historical stock data, financial statements, and key financial metrics from Yahoo Finance, alongside a suite of technical indicators for market analysis as well as options analysis tools.

Features

  • Technical Analysis (IndicatorCalculator Class): Over 30 technical indicators, including Moving Averages, MACD, Bollinger Bands, RSI, Ichimoku Cloud, and more, to dissect stock market trends and volatility.
  • Fundamental Analysis (Fetcher Class): Fetch historical stock data, income statements, balance sheets, cash flows, and key financial ratios (e.g., P/E, ROE, current ratio) for in-depth fundamental analysis.
  • Options Analysis (Greeks and OptionPricing Classes): Calculate options greeks and simulate option prices using various models. Supports both European and American options.

Installation

pip install stockdatamanager

Quick Start

from stockdatamanager import Fetcher, IndicatorCalculator
from stockdatamanager.options import Greeks, OptionPricing

# Fetching stock data and financial statements
fetcher = Fetcher(ticker='AAPL')
print(fetcher.get_pe_ratio())

# Applying technical analysis
indicators = IndicatorCalculator(dataframe=fetcher.df)
df_with_rsi = indicators.calculate_RSI()

# Calculating options Greeks
greeks = Greeks(ticker = 'AAPL', call = True, identification = 0)
delta = greeks.calculate_delta()

# Pricing an American-style option using the binomial tree method
option_pricing = OptionPricing(ticker='MSFT', call=False, american=True, risk_free_rate='13 weeks', identification=0, use_yfinance_volatility=True)
option_price = option_pricing.calculate_option_price(method='binomial', describe=False)
print(f"Option Price: {option_price}")

Usage

Fetching Data

fetcher = Fetcher(ticker='AAPL')
income_statement = fetcher.get_income_statement()

Calculating Technical Indicators

transform = Transform(ticker='AAPL')
df_with_macd = transform.calculate_MACD()

Option Analysis

Calculate the Delta of an option:

greeks = Greeks(ticker='AAPL', call=True, identification='AAPL220121C00100000')
print(greeks.calculate_delta())

Simulate option pricing using the Crank-Nicholson method:

option_pricing = OptionPricing(ticker='MSFT', call=False, american=True, risk_free_rate='13 weeks', identification='AAPL220121C00100000', use_yfinance_volatility=True)
option_price = option_pricing.calculate_option_price(method='crank-nicolson', describe=False)
print(f"Crank-Nicolson Method Option Price: {option_price}")

Contributions

Contributions are welcome! Feel free to open an issue or submit a pull request for improvements or new features.


License

stockdatamanager is made available under the MIT License. See the LICENSE file for more details.

Contacts

Email: giorgio.micaletto@studbocconi.it

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

stockdatamanager-0.10.3.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

stockdatamanager-0.10.3-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file stockdatamanager-0.10.3.tar.gz.

File metadata

  • Download URL: stockdatamanager-0.10.3.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for stockdatamanager-0.10.3.tar.gz
Algorithm Hash digest
SHA256 14b8dffd191e602b474810645e1e8714e7b1201004b93d37a673db65641f4ed8
MD5 9002a4133deb7d903fbd6de0fedc0f21
BLAKE2b-256 471b979481a50b4630fff43e527d5a61b88cc87701cc039e0985c299ab3b0b28

See more details on using hashes here.

File details

Details for the file stockdatamanager-0.10.3-py3-none-any.whl.

File metadata

File hashes

Hashes for stockdatamanager-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c53acec938e1e69a26af07a6bd400dc048d852f5fa9405ffee9f13d74f53fbef
MD5 0c46aee782891e773932b7c3a9479c42
BLAKE2b-256 9872ac817df71ac906ddc659b90514917698f29c8a587db41332828fae2d66d0

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