Ticker Module Documentation

Ticker

A class representing a Ticker object.

__new__

Create a new Ticker object.

Parameters:

  • symbol (str): The ticker symbol of the asset.
  • start_date (Optional[str]): Optional start date for historical data, defaults to None.
  • end_date (Optional[str]): Optional end date for historical data, defaults to None.
  • interval (Optional[str]): Optional data interval (2m, 5m, 15m, 30m, 1h, 1d, 1wk, 1mo, 3mo), defaults to None.
  • benchmark_symbol (Optional[str]): Optional benchmark symbol, defaults to None.
  • confidence_level (Optional[float]): Optional confidence level for statistics, defaults to None.
  • risk_free_rate (Optional[float]): Optional risk-free rate for calculations, defaults to None.

Returns:

  • Ticker: A Ticker object.

Example:

from finalytics import Ticker

ticker = Ticker(symbol="AAPL", 
                start_date="2023-01-01", 
                end_date="2024-01-01", 
                interval="1d",
                benchmark_symbol="^GSPC",
                confidence_level=0.95,
                risk_free_rate=0.02)
get_quote

Get the current ticker quote stats.

Returns:

  • dict: Dictionary containing current ticker quote stats.

Example:

quote = ticker.get_quote()
print(quote)
{'Symbol': 'AAPL', 'Name': 'Apple Inc.', 'Exchange': 'NasdaqGS', 'Currency': 'USD', 'Timestamp': 1723233601, 'Current Price': 216.24, '24H Volume': 41126391.0, '24H Open': 212.08, '24H High': 216.78, '24H Low': 211.98, '24H Close': 213.31}
get_summary_stats

Get summary technical and fundamental statistics for the ticker.

Returns:

  • dict: Dictionary containing summary statistics.

Example:

summary_stats = ticker.get_summary_stats()
print(summary_stats)
{'Symbol': 'AAPL', 'Name': 'Apple Inc.', 'Exchange': 'NasdaqGS', 'Currency': 'USD', 'Timestamp': 1723233601, 'Current Price': 216.24, '24H Change': 1.3735914, '24H Volume': 41126391.0, '24H Open': 212.08, '24H High': 216.78, '24H Low': 211.98, '24H Close': 213.31, '52 Week High': 237.23, '52 Week Low': 164.08, '52 Week Change': 0.0, '50 Day Average': 214.756, '200 Day Average': 190.42924, 'Trailing EPS': 6.57, 'Current EPS': 6.7, 'Forward EPS': 7.47, 'Trailing P/E': 32.913242, 'Current P/E': 32.274628, 'Forward P/E': 28.947792, 'Dividend Rate': 0.0, 'Dividend Yield': 0.0, 'Book Value': 4.382, 'Price to Book': 49.347332, 'Market Cap': 3287734812672.0, 'Shares Outstanding': 15204100096.0, 'Average Analyst Rating': ''}
get_price_history

Get the OHLCV data for the ticker for a given time period.

Returns:

  • DataFrame: Polars DataFrame containing OHLCV data.

Example:

price_history = ticker.get_price_history()
print(price_history)
shape: (250, 7)
┌──────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ timestamp    ┆ open       ┆ high       ┆ low        ┆ close      ┆ volume     ┆ adjclose   │
│ ---          ┆ ---        ┆ ---        ┆ ---        ┆ ---        ┆ ---        ┆ ---        │
│ datetime[ms] ┆ f64        ┆ f64        ┆ f64        ┆ f64        ┆ f64        ┆ f64        │
╞══════════════╪════════════╪════════════╪════════════╪════════════╪════════════╪════════════╡
│ 2023-01-03   ┆ 130.279999 ┆ 130.899994 ┆ 124.169998 ┆ 125.07     ┆ 1.121175e8 ┆ 124.04805  │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-01-04   ┆ 126.889999 ┆ 128.660004 ┆ 125.080002 ┆ 126.360001 ┆ 8.91136e7  ┆ 125.327507 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-01-05   ┆ 127.129997 ┆ 127.769997 ┆ 124.760002 ┆ 125.019997 ┆ 8.09627e7  ┆ 123.998459 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-01-06   ┆ 126.010002 ┆ 130.289993 ┆ 124.889999 ┆ 129.619995 ┆ 8.77547e7  ┆ 128.560883 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ …            ┆ …          ┆ …          ┆ …          ┆ …          ┆ …          ┆ …          │
│ 2023-12-26   ┆ 193.610001 ┆ 193.889999 ┆ 192.830002 ┆ 193.050003 ┆ 2.89193e7  ┆ 192.542816 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-12-27   ┆ 192.490005 ┆ 193.5      ┆ 191.089996 ┆ 193.149994 ┆ 4.80877e7  ┆ 192.642548 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-12-28   ┆ 194.139999 ┆ 194.660004 ┆ 193.169998 ┆ 193.580002 ┆ 3.40499e7  ┆ 193.071426 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
│ 2023-12-29   ┆ 193.899994 ┆ 194.399994 ┆ 191.729996 ┆ 192.529999 ┆ 4.26288e7  ┆ 192.024185 │
│ 00:00:00     ┆            ┆            ┆            ┆            ┆            ┆            │
└──────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
get_options_chain

Get the options chain for the ticker.

Returns:

  • DataFrame: Polars DataFrame containing the options chain.

Example:

options_chain = ticker.get_options_chain()
print(options_chain)
shape: (1_645, 16)
┌────────────┬───────────┬──────┬────────────┬───┬────────────┬────────────┬───────────┬───────────┐
│ expiration ┆ ttm       ┆ type ┆ contractSy ┆ … ┆ contractSi ┆ lastTradeD ┆ impliedVo ┆ inTheMone │
│ ---        ┆ ---       ┆ ---  ┆ mbol       ┆   ┆ ze         ┆ ate        ┆ latility  ┆ y         │
│ str        ┆ f64       ┆ str  ┆ ---        ┆   ┆ ---        ┆ ---        ┆ ---       ┆ ---       │
│            ┆           ┆      ┆ str        ┆   ┆ str        ┆ datetime[m ┆ f64       ┆ bool      │
│            ┆           ┆      ┆            ┆   ┆            ┆ s]         ┆           ┆           │
╞════════════╪═══════════╪══════╪════════════╪═══╪════════════╪════════════╪═══════════╪═══════════╡
│ 2024-08-16 ┆ 0.164258  ┆ call ┆ AAPL240816 ┆ … ┆ REGULAR    ┆ 2024-08-05 ┆ 14.250001 ┆ true      │
│            ┆           ┆      ┆ C00005000  ┆   ┆            ┆ 17:41:05   ┆           ┆           │
│ 2024-08-16 ┆ 0.164258  ┆ call ┆ AAPL240816 ┆ … ┆ REGULAR    ┆ 2024-07-16 ┆ 12.261721 ┆ true      │
│            ┆           ┆      ┆ C00015000  ┆   ┆            ┆ 16:16:43   ┆           ┆           │
│ 2024-08-16 ┆ 0.164258  ┆ call ┆ AAPL240816 ┆ … ┆ REGULAR    ┆ 2024-06-13 ┆ 12.944338 ┆ true      │
│            ┆           ┆      ┆ C00050000  ┆   ┆            ┆ 19:47:00   ┆           ┆           │
│ 2024-08-16 ┆ 0.164258  ┆ call ┆ AAPL240816 ┆ … ┆ REGULAR    ┆ 2024-07-11 ┆ 4.458989  ┆ true      │
│            ┆           ┆      ┆ C00080000  ┆   ┆            ┆ 15:06:40   ┆           ┆           │
│ …          ┆ …         ┆ …    ┆ …          ┆ … ┆ …          ┆ …          ┆ …         ┆ …         │
│ 2026-12-18 ┆ 28.219448 ┆ put  ┆ AAPL261218 ┆ … ┆ REGULAR    ┆ 2024-07-12 ┆ 0.164681  ┆ true      │
│            ┆           ┆      ┆ P00310000  ┆   ┆            ┆ 15:19:38   ┆           ┆           │
│ 2026-12-18 ┆ 28.219448 ┆ put  ┆ AAPL261218 ┆ … ┆ REGULAR    ┆ 2024-07-26 ┆ 0.184029  ┆ true      │
│            ┆           ┆      ┆ P00330000  ┆   ┆            ┆ 14:51:20   ┆           ┆           │
│ 2026-12-18 ┆ 28.219448 ┆ put  ┆ AAPL261218 ┆ … ┆ REGULAR    ┆ 2024-08-06 ┆ 0.193459  ┆ true      │
│            ┆           ┆      ┆ P00340000  ┆   ┆            ┆ 16:45:16   ┆           ┆           │
│ 2026-12-18 ┆ 28.219448 ┆ put  ┆ AAPL261218 ┆ … ┆ REGULAR    ┆ 2024-08-05 ┆ 0.202523  ┆ true      │
│            ┆           ┆      ┆ P00350000  ┆   ┆            ┆ 16:42:56   ┆           ┆           │
└────────────┴───────────┴──────┴────────────┴───┴────────────┴────────────┴───────────┴───────────┘
get_news

Get the historical news headlines for the given ticker.

Returns:

  • DataFrame: Polars DataFrame containing news headlines.

Example:

news = ticker.get_news()
print(news)
shape: (3_231, 5)
┌────────────────┬─────────────────────┬────────────────────┬────────────────────┬─────────────────┐
│ Published Date ┆ Source              ┆ Title              ┆ Link               ┆ Sentiment Score │
│ ---            ┆ ---                 ┆ ---                ┆ ---                ┆ ---             │
│ datetime[ms]   ┆ str                 ┆ str                ┆ str                ┆ f64             │
╞════════════════╪═════════════════════╪════════════════════╪════════════════════╪═════════════════╡
│ 2023-01-03     ┆ Reuters             ┆ Apple's stock      ┆ https://news.googl ┆ 0.33995         │
│ 08:00:00       ┆                     ┆ market value       ┆ e.com/rss/arti…    ┆                 │
│                ┆                     ┆ falls…             ┆                    ┆                 │
│ 2023-01-03     ┆ Al Jazeera English  ┆ Apple’s market     ┆ https://news.googl ┆ 0.33995         │
│ 08:00:00       ┆                     ┆ value drops below… ┆ e.com/rss/arti…    ┆                 │
│ 2023-01-04     ┆ Bloomberg           ┆ Apple’s (AAPL)     ┆ https://news.googl ┆ -0.70956        │
│ 08:00:00       ┆                     ┆ Stock Is Losing I… ┆ e.com/rss/arti…    ┆                 │
│ 2023-01-04     ┆ The Guardian        ┆ Death of the       ┆ https://news.googl ┆ -0.622427       │
│ 08:00:00       ┆                     ┆ narrator? Apple    ┆ e.com/rss/arti…    ┆                 │
│                ┆                     ┆ unv…               ┆                    ┆                 │
│ …              ┆ …                   ┆ …                  ┆ …                  ┆ …               │
│ 2024-01-01     ┆ Bloomberg           ┆ Baidu’s            ┆ https://news.googl ┆ 0.421464        │
│ 08:00:00       ┆                     ┆ Live-Streaming     ┆ e.com/rss/arti…    ┆                 │
│                ┆                     ┆ Hopes Hit…         ┆                    ┆                 │
│ 2023-12-30     ┆ Business Standard   ┆ Billionaire        ┆ https://news.googl ┆ 0.0             │
│ 08:00:00       ┆                     ┆ Gustavo Cisneros,  ┆ e.com/rss/arti…    ┆                 │
│                ┆                     ┆ wh…                ┆                    ┆                 │
│ 2023-12-30     ┆ Gulf News           ┆ The Apple Watch    ┆ https://news.googl ┆ 0.0             │
│ 08:00:00       ┆                     ┆ Series 9, Ultra …  ┆ e.com/rss/arti…    ┆                 │
│ 2024-01-01     ┆ Yahoo Finance       ┆ Buffett's          ┆ https://news.googl ┆ 0.0             │
│ 08:00:00       ┆                     ┆ Bullseye: Meet The ┆ e.com/rss/arti…    ┆                 │
│                ┆                     ┆ 4 S…               ┆                    ┆                 │
└────────────────┴─────────────────────┴────────────────────┴────────────────────┴─────────────────┘
get_income_statement

Get the Income Statement for the ticker.

Returns:

  • DataFrame: Polars DataFrame containing the Income Statement.

Example:

income_statement = ticker.get_income_statement()
print(income_statement)
shape: (13, 6)
┌──────────────────────────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                        ┆ 2023Q1    ┆ 2023Q2    ┆ 2023Q3    ┆ 2023Q4    ┆ 2024Q1    │
│ ---                          ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                          ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue                      ┆ 9.4836e10 ┆ 8.1797e10 ┆ 8.9498e10 ┆ 1.1958e11 ┆ 9.0753e10 │
│ Cost of Goods Sold           ┆ 5.2860e10 ┆ 4.5384e10 ┆ 4.9071e10 ┆ 6.4720e10 ┆ 4.8482e10 │
│ Gross Profit                 ┆ 4.1976e10 ┆ 3.6413e10 ┆ 4.0427e10 ┆ 5.4855e10 ┆ 4.2271e10 │
│ Operating Expenses           ┆ 1.3658e10 ┆ 1.3415e10 ┆ 1.3458e10 ┆ 1.4482e10 ┆ 1.4371e10 │
│ …                            ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Income Tax Expense           ┆ 4.2220e9  ┆ 2.8520e9  ┆ 4.0420e9  ┆ 6.4070e9  ┆ 4.4220e9  │
│ Net Income                   ┆ 2.4160e10 ┆ 1.9881e10 ┆ 2.2956e10 ┆ 3.3916e10 ┆ 2.3636e10 │
│ Earnings per Share - Basic   ┆ 1.53      ┆ 1.27      ┆ 1.47      ┆ 2.19      ┆ 1.53      │
│ Earnings per Share - Diluted ┆ 1.52      ┆ 1.26      ┆ 1.46      ┆ 2.18      ┆ 1.53      │
└──────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
get_balance_sheet

Get the Balance Sheet for the ticker.

Returns:

  • DataFrame: Polars DataFrame containing the Balance Sheet.

Example:

balance_sheet = ticker.get_balance_sheet()
print(balance_sheet)
shape: (21, 6)
┌──────────────────────────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                        ┆ 2023Q1    ┆ 2023Q2    ┆ 2023Q3    ┆ 2023Q4    ┆ 2024Q1    │
│ ---                          ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                          ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Cash and Cash Equivalents    ┆ 2.4687e10 ┆ 2.8408e10 ┆ 2.9965e10 ┆ 4.0760e10 ┆ 3.2695e10 │
│ Accounts Receivable          ┆ 1.7936e10 ┆ 1.9549e10 ┆ 2.9508e10 ┆ 2.3194e10 ┆ 2.1837e10 │
│ Inventories                  ┆ 7.4820e9  ┆ 7.3510e9  ┆ 6.3310e9  ┆ 6.5110e9  ┆ 6.2320e9  │
│ Other Current Assets         ┆ 1.3660e10 ┆ 1.3640e10 ┆ 1.4695e10 ┆ 1.3979e10 ┆ 1.3884e10 │
│ …                            ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Common Stock                 ┆ 6.9568e10 ┆ 7.0667e10 ┆ 7.3812e10 ┆ 7.5236e10 ┆ 7.8815e10 │
│ Retained Earnings            ┆ 4.3360e9  ┆ 1.4080e9  ┆ -2.1400e8 ┆ 8.2420e9  ┆ 4.3390e9  │
│ Total Equity                 ┆ 6.2158e10 ┆ 6.0274e10 ┆ 6.2146e10 ┆ 7.4100e10 ┆ 7.4194e10 │
│ Total Liabilities and Equity ┆ 6.2158e10 ┆ 6.0274e10 ┆ 6.2146e10 ┆ 7.4100e10 ┆ 7.4194e10 │
└──────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
get_cashflow_statement

Get the Cashflow Statement for the ticker.

Returns:

  • DataFrame: Polars DataFrame containing the Cashflow Statement.

Example:

cashflow_statement = ticker.get_cashflow_statement()
print(cashflow_statement)
shape: (26, 6)
┌─────────────────────────────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ Items                           ┆ 2023Q1     ┆ 2023Q2     ┆ 2023Q3     ┆ 2023Q4     ┆ 2024Q1     │
│ ---                             ┆ ---        ┆ ---        ┆ ---        ┆ ---        ┆ ---        │
│ str                             ┆ f64        ┆ f64        ┆ f64        ┆ f64        ┆ f64        │
╞═════════════════════════════════╪════════════╪════════════╪════════════╪════════════╪════════════╡
│ Net Income from Continuing      ┆ 2.4160e10  ┆ 1.9881e10  ┆ 2.2956e10  ┆ 3.3916e10  ┆ 2.3636e10  │
│ Opera…                          ┆            ┆            ┆            ┆            ┆            │
│ Depreciation, Amortization, and ┆ 2.8980e9   ┆ 3.0520e9   ┆ 2.6530e9   ┆ 2.8480e9   ┆ 2.8360e9   │
│ …                               ┆            ┆            ┆            ┆            ┆            │
│ Stock-Based Compensation        ┆ 2.6860e9   ┆ 2.6170e9   ┆ 2.6250e9   ┆ 2.9970e9   ┆ 2.9640e9   │
│ Changes in Working Capital      ┆ 2.31e8     ┆ 7.49e8     ┆ -6.0600e9  ┆ 1.1230e9   ┆ -5.7640e9  │
│ …                               ┆ …          ┆ …          ┆ …          ┆ …          ┆ …          │
│ Investing Cash Flow             ┆ 2.3190e9   ┆ 4.37e8     ┆ 2.3940e9   ┆ 1.9270e9   ┆ -3.1000e8  │
│ Financing Cash Flow             ┆ -2.5724e10 ┆ -2.4048e10 ┆ -2.3153e10 ┆ -3.0585e10 ┆ -3.0433e10 │
│ Ending Cash Position            ┆ 2.7129e10  ┆ 2.9898e10  ┆ 3.0737e10  ┆ 4.1974e10  ┆ 3.3921e10  │
│ Free Cash Flow                  ┆ 2.5644e10  ┆ 2.4287e10  ┆ 1.9435e10  ┆ 3.7503e10  ┆ 2.0694e10  │
└─────────────────────────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
get_financial_ratios

Get the Financial Ratios for the ticker.

Returns:

  • DataFrame: Polars DataFrame containing the Financial Ratios.

Example:

financial_ratios = ticker.get_financial_ratios()
print(financial_ratios)
shape: (21, 6)
┌─────────────────────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Items                   ┆ 2023Q1   ┆ 2023Q2   ┆ 2023Q3   ┆ 2023Q4   ┆ 2024Q1   │
│ ---                     ┆ ---      ┆ ---      ┆ ---      ┆ ---      ┆ ---      │
│ str                     ┆ f64      ┆ f64      ┆ f64      ┆ f64      ┆ f64      │
╞═════════════════════════╪══════════╪══════════╪══════════╪══════════╪══════════╡
│ Gross Profit Margin     ┆ 0.442617 ┆ 0.445163 ┆ 0.451708 ┆ 0.45875  ┆ 0.465781 │
│ Operating Profit Margin ┆ 0.2986   ┆ 0.290121 ┆ 0.312856 ┆ 0.337637 ┆ 0.307428 │
│ Net Profit Margin       ┆ 0.254756 ┆ 0.243053 ┆ 0.256497 ┆ 0.283638 ┆ 0.260443 │
│ Return on Assets        ┆ 0.072736 ┆ 0.05934  ┆ 0.065108 ┆ 0.09594  ┆ 0.070051 │
│ …                       ┆ …        ┆ …        ┆ …        ┆ …        ┆ …        │
│ Price to Book           ┆ 2.561199 ┆ 2.627086 ┆ 2.53318  ┆ 2.283239 ┆ 2.237715 │
│ Price to Sales          ┆ 1.678677 ┆ 1.935829 ┆ 1.759    ┆ 1.414911 ┆ 1.829416 │
│ Price to Cashflow       ┆ 5.574195 ┆ 6.002464 ┆ 7.288962 ┆ 4.240832 ┆ 7.3171   │
│ Price to Free Cashflow  ┆ 6.208041 ┆ 6.519743 ┆ 8.10018  ┆ 4.511319 ┆ 8.022857 │
└─────────────────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
volatility_surface

Computes the implied volatility surface for the ticker options chain.

Returns:

  • DataFrame: Polars DataFrame containing the implied volatility surface.

Example:

volatility_surface = ticker.volatility_surface()
print(volatility_surface)
shape: (62, 11)
┌────────┬──────────┬──────────┬───────────┬───┬──────────┬──────────┬──────────┬──────────┐
│ strike ┆ 3.15M    ┆ 4.30M    ┆ 5.22M     ┆ … ┆ 16.26M   ┆ 17.18M   ┆ 22.21M   ┆ 28.22M   │
│ ---    ┆ ---      ┆ ---      ┆ ---       ┆   ┆ ---      ┆ ---      ┆ ---      ┆ ---      │
│ f64    ┆ f64      ┆ f64      ┆ f64       ┆   ┆ f64      ┆ f64      ┆ f64      ┆ f64      │
╞════════╪══════════╪══════════╪═══════════╪═══╪══════════╪══════════╪══════════╪══════════╡
│ 5.0    ┆ 1.0      ┆ 0.822109 ┆ 1.0       ┆ … ┆ 0.475996 ┆ 0.534971 ┆ 0.476963 ┆ 0.814375 │
│ 15.0   ┆ 1.0      ┆ 0.822109 ┆ 1.0       ┆ … ┆ 0.475996 ┆ 0.534971 ┆ 0.476963 ┆ 0.725671 │
│ 20.0   ┆ 1.0      ┆ 0.822109 ┆ 1.0       ┆ … ┆ 0.475996 ┆ 0.534971 ┆ 0.476963 ┆ 0.636968 │
│ 25.0   ┆ 1.0      ┆ 0.822109 ┆ 1.0       ┆ … ┆ 0.475996 ┆ 0.534971 ┆ 0.476963 ┆ 0.548264 │
│ …      ┆ …        ┆ …        ┆ …         ┆ … ┆ …        ┆ …        ┆ …        ┆ …        │
│ 340.0  ┆ 0.325176 ┆ 0.299072 ┆ 0.27877   ┆ … ┆ 0.254237 ┆ 0.242152 ┆ 0.243844 ┆ 0.246895 │
│ 350.0  ┆ 0.327109 ┆ 0.307773 ┆ 0.2884375 ┆ … ┆ 0.244327 ┆ 0.241457 ┆ 0.243542 ┆ 0.243119 │
│ 360.0  ┆ 0.353213 ┆ 0.307773 ┆ 0.2884375 ┆ … ┆ 0.244327 ┆ 0.241457 ┆ 0.243542 ┆ 0.243119 │
│ 370.0  ┆ 0.35998  ┆ 0.307773 ┆ 0.2884375 ┆ … ┆ 0.244327 ┆ 0.241457 ┆ 0.243542 ┆ 0.243119 │
└────────┴──────────┴──────────┴───────────┴───┴──────────┴──────────┴──────────┴──────────┘
performance_stats

Compute the performance statistics for the ticker.

Returns:

  • dict: Dictionary containing performance statistics.

Example:

performance_stats = ticker.performance_stats()
print(performance_stats)
{'Symbol': 'AAPL', 'Benchmark': '^GSPC', 'Start Date': '2023-01-01', 'End Date': '2024-01-01', 'Interval': '1d', 'Confidence Level': 0.95, 'Risk Free Rate': 0.02, 'Daily Return': 0.18275875540061556, 'Daily Volatility': 1.252020368619977, 'Total Return': 54.7982296328251, 'Annualized Return': 58.42826625594621, 'Annualized Volatility': 19.875207190535257, 'Alpha': 0.00467905225242686, 'Beta': 0.47675557932957147, 'Sharpe Ratio': 2.8391284536051447, 'Sortino Ratio': 4.602294629698171, 'Active Return': 25.745008299619478, 'Active Risk': 13.742876544849127, 'Information Ratio': 1.8733347575088848, 'Calmar Ratio': 6.153782779707574, 'Maximum Drawdown': 9.494691045744503, 'Value at Risk': -1.7253614349626107, 'Expected Shortfall': -2.5631177996522334, 'Security Prices': shape: (250,)
Series: '' [f64]
[
    124.04805
    125.327507
    123.998459
    128.560883
    129.086548
    129.661774
    132.399261
    132.319916
    133.658859
    134.829239
    134.105209
    134.164719
    …
    194.198471
    197.439926
    197.589523
    197.050949
    195.375366
    196.422607
    194.318146
    194.168518
    193.091385
    192.542816
    192.642548
    193.071426
    192.024185
], 'Security Returns': shape: (250,)
Series: '' [f64]
[
    0.0
    1.031421
    -1.06046
    3.67942
    0.408884
    0.445613
    2.111253
    -0.059929
    1.011899
    0.875647
    -0.536997
    0.044375
    …
    0.79201
    1.669146
    0.075768
    -0.272572
    -0.85033
    0.536015
    -1.071395
    -0.077001
    -0.554741
    -0.284098
    0.051797
    0.222629
    -0.542411
], 'Benchmark Returns': shape: (250,)
Series: '' [f64]
[
    0.0
    0.753897
    -1.164553
    2.284078
    -0.076763
    0.697823
    1.284942
    0.341591
    0.399686
    -0.203049
    -1.55626
    -0.763835
    …
    0.459936
    1.365068
    0.264706
    -0.007625
    0.452834
    0.586641
    -1.468427
    1.030147
    0.166006
    0.423169
    0.143046
    0.037017
    -0.282648
]}
performance_chart

Display the performance chart for the ticker.

Parameters:

  • height (Optional[int]): Optional height of the plot in pixels, defaults to None.
  • width (Optional[int]): Optional width of the plot in pixels, defaults to None.

Returns:

  • Plot: Plot object containing the performance chart.

Example:

performance_chart = ticker.performance_chart()
performance_chart.show()
candlestick_chart

Display the candlestick chart for the ticker.

Parameters:

  • height (Optional[int]): Optional height of the plot in pixels, defaults to None.
  • width (Optional[int]): Optional width of the plot in pixels, defaults to None.

Returns:

  • Plot: Plot object containing the candlestick chart.

Example:

candlestick_chart = ticker.candlestick_chart()
candlestick_chart.show()
news_sentiment_chart

Display the News Sentiment chart for the ticker.

Parameters:

  • height (Optional[int]): Optional height of the plot in pixels, defaults to None.
  • width (Optional[int]): Optional width of the plot in pixels, defaults to None.

Returns:

  • Plot: Plot object containing the news sentiment chart.

Example:

news_sentiment_chart = ticker.news_sentiment_chart()
news_sentiment_chart.show()
options_chart

Display the options volatility surface, smile and term structure charts for the ticker.

Parameters:

  • chart_type (str): Type of options chart (surface, smile, term_structure).
  • height (Optional[int]): Optional height of the plot in pixels, defaults to None.
  • width (Optional[int]): Optional width of the plot in pixels, defaults to None.

Returns:

  • Plot: Plot object containing the options chart.

Example:

options_chart = ticker.options_chart(chart_type="surface", )
options_chart.show()