Tickers Module Documentation

Tickers

A class representing a Tickers object.

__new__

Create a new Tickers object.

Parameters:

  • symbols (List[str]): A list of ticker symbols.
  • start_date (str): The start date of the time period in the format YYYY-MM-DD.
  • end_date (str): The end date of the time period in the format YYYY-MM-DD.
  • interval (str): The interval of the data (2m, 5m, 15m, 30m, 1h, 1d, 1wk, 1mo, 3mo).
  • benchmark_symbol (str): The ticker symbol of the benchmark to compare against.
  • confidence_level (float): The confidence level for the VaR and ES calculations.
  • risk_free_rate (float): The risk free rate to use in the calculations.

Returns:

  • Tickers: A Tickers object.

Example:

from finalytics import Tickers

tickers = Tickers(symbols=["AAPL", "GOOG", "MSFT", "NVDA", "BTC-USD"],
                  start_date="2020-01-01",
                  end_date="2024-01-01",
                  interval="1d",
                  benchmark_symbol="^GSPC",
                  confidence_level=0.95,
                  risk_free_rate=0.02)
get_summary_stats

Fetch the Ticker Summary Stats Data for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing summary statistics.

Example:

summary_stats = tickers.get_summary_stats()
print(summary_stats)
shape: (5, 53)
┌─────────┬──────────┬────────────┬────────────┬───┬───────────┬───────────┬───────────┬───────────┐
│ Symbol  ┆ Currency ┆ Current    ┆ Day Range  ┆ … ┆ High/Low  ┆ Analyst   ┆ Circulati ┆ CoinMarke │
│ ---     ┆ ---      ┆ Price      ┆ ---        ┆   ┆ Target    ┆ Count     ┆ ng Supply ┆ tCap Link │
│ str     ┆ str      ┆ ---        ┆ str        ┆   ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│         ┆          ┆ str        ┆            ┆   ┆ str       ┆ str       ┆ str       ┆ str       │
╞═════════╪══════════╪════════════╪════════════╪═══╪═══════════╪═══════════╪═══════════╪═══════════╡
│ AAPL    ┆ USD      ┆ 271.35     ┆ 275.94 -   ┆ … ┆ 350.00 -  ┆ 42        ┆           ┆           │
│         ┆          ┆            ┆ 268.14     ┆   ┆ 215.00    ┆           ┆           ┆           │
│ GOOG    ┆ USD      ┆ 381.94     ┆ 382.63 -   ┆ … ┆ 405.00 -  ┆ 18        ┆           ┆           │
│         ┆          ┆            ┆ 363.09     ┆   ┆ 185.00    ┆           ┆           ┆           │
│ MSFT    ┆ USD      ┆ 407.78     ┆ 414.42 -   ┆ … ┆ 730.00 -  ┆ 54        ┆           ┆           │
│         ┆          ┆            ┆ 398.01     ┆   ┆ 392.00    ┆           ┆           ┆           │
│ NVDA    ┆ USD      ┆ 199.57     ┆ 210.30 -   ┆ … ┆ 380.00 -  ┆ 57        ┆           ┆           │
│         ┆          ┆            ┆ 198.70     ┆   ┆ 140.00    ┆           ┆           ┆           │
│ BTC-USD ┆ USD      ┆            ┆ 77,467.06  ┆ … ┆  -        ┆           ┆ 20,023,07 ┆ https://c │
│         ┆          ┆            ┆ -          ┆   ┆           ┆           ┆ 8.00      ┆ oinmarket │
│         ┆          ┆            ┆ 76,306.55  ┆   ┆           ┆           ┆           ┆ cap.com/c │
│         ┆          ┆            ┆            ┆   ┆           ┆           ┆           ┆ urr…      │
└─────────┴──────────┴────────────┴────────────┴───┴───────────┴───────────┴───────────┴───────────┘
get_price_history

Fetch the OHLCV Data for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing OHLCV data.

Example:

price_history = tickers.get_price_history()
print(price_history)
shape: (5_485, 8)
┌────────────┬─────────┬────────────┬────────────┬────────────┬────────────┬───────────┬───────────┐
│ timestamp  ┆ symbol  ┆ open       ┆ high       ┆ low        ┆ close      ┆ volume    ┆ adjclose  │
│ ---        ┆ ---     ┆ ---        ┆ ---        ┆ ---        ┆ ---        ┆ ---       ┆ ---       │
│ datetime[m ┆ str     ┆ f64        ┆ f64        ┆ f64        ┆ f64        ┆ f64       ┆ f64       │
│ s]         ┆         ┆            ┆            ┆            ┆            ┆           ┆           │
╞════════════╪═════════╪════════════╪════════════╪════════════╪════════════╪═══════════╪═══════════╡
│ 2020-01-02 ┆ AAPL    ┆ 74.059998  ┆ 75.150002  ┆ 73.797501  ┆ 75.087502  ┆ 1.354804e ┆ 72.400543 │
│ 00:00:00   ┆         ┆            ┆            ┆            ┆            ┆ 8         ┆           │
│ 2020-01-03 ┆ AAPL    ┆ 74.287498  ┆ 75.144997  ┆ 74.125     ┆ 74.357498  ┆ 1.463228e ┆ 71.69664  │
│ 00:00:00   ┆         ┆            ┆            ┆            ┆            ┆ 8         ┆           │
│ 2020-01-06 ┆ AAPL    ┆ 73.447502  ┆ 74.989998  ┆ 73.1875    ┆ 74.949997  ┆ 1.183872e ┆ 72.267937 │
│ 00:00:00   ┆         ┆            ┆            ┆            ┆            ┆ 8         ┆           │
│ 2020-01-07 ┆ AAPL    ┆ 74.959999  ┆ 75.224998  ┆ 74.370003  ┆ 74.597504  ┆ 1.08872e8 ┆ 71.928062 │
│ 00:00:00   ┆         ┆            ┆            ┆            ┆            ┆           ┆           │
│ 2020-01-08 ┆ AAPL    ┆ 74.290001  ┆ 76.110001  ┆ 74.290001  ┆ 75.797501  ┆ 1.320792e ┆ 73.085121 │
│ 00:00:00   ┆         ┆            ┆            ┆            ┆            ┆ 8         ┆           │
│ …          ┆ …       ┆ …          ┆ …          ┆ …          ┆ …          ┆ …         ┆ …         │
│ 2023-12-27 ┆ BTC-USD ┆ 42518.4687 ┆ 43683.1601 ┆ 42167.5820 ┆ 43442.8554 ┆ 2.5261e10 ┆ 43442.855 │
│ 00:00:00   ┆         ┆ 5          ┆ 56         ┆ 31         ┆ 69         ┆           ┆ 469       │
│ 2023-12-28 ┆ BTC-USD ┆ 43468.1992 ┆ 43804.7812 ┆ 42318.5507 ┆ 42627.8554 ┆ 2.2992e10 ┆ 42627.855 │
│ 00:00:00   ┆         ┆ 19         ┆ 5          ┆ 81         ┆ 69         ┆           ┆ 469       │
│ 2023-12-29 ┆ BTC-USD ┆ 42614.6445 ┆ 43124.3242 ┆ 41424.0625 ┆ 42099.4023 ┆ 2.6000e10 ┆ 42099.402 │
│ 00:00:00   ┆         ┆ 31         ┆ 19         ┆            ┆ 44         ┆           ┆ 344       │
│ 2023-12-30 ┆ BTC-USD ┆ 42091.7539 ┆ 42584.125  ┆ 41556.2265 ┆ 42156.9023 ┆ 1.6014e10 ┆ 42156.902 │
│ 00:00:00   ┆         ┆ 06         ┆            ┆ 62         ┆ 44         ┆           ┆ 344       │
│ 2023-12-31 ┆ BTC-USD ┆ 42152.0976 ┆ 42860.9375 ┆ 41998.2539 ┆ 42265.1875 ┆ 1.6397e10 ┆ 42265.187 │
│ 00:00:00   ┆         ┆ 56         ┆            ┆ 06         ┆            ┆           ┆ 5         │
└────────────┴─────────┴────────────┴────────────┴────────────┴────────────┴───────────┴───────────┘
get_options_chain

Fetch the Options Chain Data for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing the options chain.

Example:

options_chain = tickers.get_options_chain()
print(options_chain)
shape: (11_892, 17)
┌────────────┬───────────┬──────┬────────┬───┬─────────────┬─────────────┬────────────┬────────────┐
│ expiration ┆ ttm       ┆ type ┆ symbol ┆ … ┆ contractSiz ┆ lastTradeDa ┆ impliedVol ┆ inTheMoney │
│ ---        ┆ ---       ┆ ---  ┆ ---    ┆   ┆ e           ┆ te          ┆ atility    ┆ ---        │
│ str        ┆ f64       ┆ str  ┆ str    ┆   ┆ ---         ┆ ---         ┆ ---        ┆ bool       │
│            ┆           ┆      ┆        ┆   ┆ str         ┆ datetime[ms ┆ f64        ┆            │
│            ┆           ┆      ┆        ┆   ┆             ┆ ]           ┆            ┆            │
╞════════════╪═══════════╪══════╪════════╪═══╪═════════════╪═════════════╪════════════╪════════════╡
│ 2026-05-01 ┆ 0.0       ┆ call ┆ AAPL   ┆ … ┆ REGULAR     ┆ 2026-04-28  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 15:31:58    ┆            ┆            │
│ 2026-05-01 ┆ 0.0       ┆ call ┆ AAPL   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 19:42:52    ┆            ┆            │
│ 2026-05-01 ┆ 0.0       ┆ call ┆ AAPL   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 19:49:19    ┆            ┆            │
│ 2026-05-01 ┆ 0.0       ┆ call ┆ AAPL   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 19:41:59    ┆            ┆            │
│ 2026-05-01 ┆ 0.0       ┆ call ┆ AAPL   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 19:50:13    ┆            ┆            │
│ …          ┆ …         ┆ …    ┆ …      ┆ … ┆ …           ┆ …           ┆ …          ┆ …          │
│ 2028-12-15 ┆ 31.504599 ┆ put  ┆ NVDA   ┆ … ┆ REGULAR     ┆ 2026-04-28  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 17:30:50    ┆            ┆            │
│ 2028-12-15 ┆ 31.504599 ┆ put  ┆ NVDA   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 18:11:49    ┆            ┆            │
│ 2028-12-15 ┆ 31.504599 ┆ put  ┆ NVDA   ┆ … ┆ REGULAR     ┆ 2026-04-28  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 19:48:47    ┆            ┆            │
│ 2028-12-15 ┆ 31.504599 ┆ put  ┆ NVDA   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 13:56:11    ┆            ┆            │
│ 2028-12-15 ┆ 31.504599 ┆ put  ┆ NVDA   ┆ … ┆ REGULAR     ┆ 2026-04-30  ┆ 0.00001    ┆ true       │
│            ┆           ┆      ┆        ┆   ┆             ┆ 13:56:11    ┆            ┆            │
└────────────┴───────────┴──────┴────────┴───┴─────────────┴─────────────┴────────────┴────────────┘
No Options Data for BTC-USD
get_news

Fetch the Historical News Headlines for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing news headlines.

Example:

news = tickers.get_news()
print(news)
get_income_statement

Fetch the income statement for all tickers.

Parameters:

  • frequency (str): The frequency of the data (annual or quarterly).
  • formatted (optional[bool]): Whether to return the data in a formatted manner, defaults to True.

Returns:

  • DataFrame: Polars DataFrame containing the income statement.

Example:

income_statement = tickers.get_income_statement(frequency="quarterly")
print(income_statement)
Error Fetching Data for BTC-USD: fetching income statement for ticker 'BTC-USD' (Quarterly): not found: "asOfDate" not found
Unable to stack shape: (13, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                       ┆ symbol ┆ 2025Q1    ┆ 2025Q2    ┆ 2025Q3    ┆ 2025Q4    ┆ 2026Q1    │
│ ---                         ┆ ---    ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                         ┆ str    ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue                     ┆ MSFT   ┆ 7.0066e10 ┆ 7.6441e10 ┆ 7.7673e10 ┆ 8.1273e10 ┆ 8.2886e10 │
│ Cost of Goods Sold          ┆ MSFT   ┆ 2.1919e10 ┆ 2.4014e10 ┆ 2.4043e10 ┆ 2.5978e10 ┆ 2.6828e10 │
│ Gross Profit                ┆ MSFT   ┆ 4.8147e10 ┆ 5.2427e10 ┆ 5.3630e10 ┆ 5.5295e10 ┆ 5.6058e10 │
│ Operating Expenses          ┆ MSFT   ┆ 1.6147e10 ┆ 1.8104e10 ┆ 1.5669e10 ┆ 1.7020e10 ┆ 1.7660e10 │
│ EBITDA                      ┆ MSFT   ┆ 3.9705e10 ┆ 4.4434e10 ┆ 4.8060e10 ┆ 5.8180e10 ┆ 5.0285e10 │
│ …                           ┆ …      ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Interest Expense            ┆ MSFT   ┆ 5.94e8    ┆ 6.15e8    ┆ 6.98e8    ┆ 7.36e8    ┆ 7.78e8    │
│ Income Tax Expense          ┆ MSFT   ┆ 5.5530e9  ┆ 5.3830e9  ┆ 6.5540e9  ┆ 9.7880e9  ┆ 7.5620e9  │
│ Net Income                  ┆ MSFT   ┆ 2.5824e10 ┆ 2.7233e10 ┆ 2.7747e10 ┆ 3.8458e10 ┆ 3.1778e10 │
│ Earnings per Share - Basic  ┆ MSFT   ┆ 3.47      ┆ 3.66      ┆ 3.73      ┆ 5.18      ┆ 4.28      │
│ Earnings per Share -        ┆ MSFT   ┆ 3.46      ┆ 3.65      ┆ 3.72      ┆ 5.16      ┆ 4.27      │
│ Diluted                     ┆        ┆           ┆           ┆           ┆           ┆           │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q4" and "2025Q1"
shape: (37, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                       ┆ symbol ┆ 2024Q4    ┆ 2025Q1    ┆ 2025Q2    ┆ 2025Q3    ┆ 2025Q4    │
│ ---                         ┆ ---    ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                         ┆ str    ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue                     ┆ AAPL   ┆ 1.2430e11 ┆ 9.5359e10 ┆ 9.4036e10 ┆ 1.0247e11 ┆ 1.4376e11 │
│ Cost of Goods Sold          ┆ AAPL   ┆ 6.6025e10 ┆ 5.0492e10 ┆ 5.0318e10 ┆ 5.4125e10 ┆ 7.4525e10 │
│ Gross Profit                ┆ AAPL   ┆ 5.8275e10 ┆ 4.4867e10 ┆ 4.3718e10 ┆ 4.8341e10 ┆ 6.9231e10 │
│ Operating Expenses          ┆ AAPL   ┆ 1.5443e10 ┆ 1.5278e10 ┆ 1.5516e10 ┆ 1.5914e10 ┆ 1.8379e10 │
│ EBITDA                      ┆ AAPL   ┆ 4.5912e10 ┆ 3.2250e10 ┆ 3.1032e10 ┆ 3.5554e10 ┆ 5.4066e10 │
│ …                           ┆ …      ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Interest Expense            ┆ NVDA   ┆ 6.1e7     ┆ 6.3e7     ┆ 6.2e7     ┆ 6.1e7     ┆ 7.3e7     │
│ Income Tax Expense          ┆ NVDA   ┆ 3.1260e9  ┆ 3.1350e9  ┆ 4.7840e9  ┆ 6.0260e9  ┆ 7.4380e9  │
│ Net Income                  ┆ NVDA   ┆ 2.2091e10 ┆ 1.8775e10 ┆ 2.6422e10 ┆ 3.1910e10 ┆ 4.2960e10 │
│ Earnings per Share - Basic  ┆ NVDA   ┆ 0.9       ┆ 0.77      ┆ 1.08      ┆ 1.31      ┆ 1.77      │
│ Earnings per Share -        ┆ NVDA   ┆ 0.89      ┆ 0.76      ┆ 1.08      ┆ 1.3       ┆ 1.76      │
│ Diluted                     ┆        ┆           ┆           ┆           ┆           ┆           │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
get_balance_sheet

Fetch the balance sheet for all tickers.

Parameters:

  • frequency (str): The frequency of the data (annual or quarterly).
  • formatted (optional[bool]): Whether to return the data in a formatted manner, defaults to True.

Returns:

  • DataFrame: Polars DataFrame containing the balance sheet.

Example:

balance_sheet = tickers.get_balance_sheet(frequency="quarterly")
print(balance_sheet)
shape: (64, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                       ┆ symbol ┆ 2024Q4    ┆ 2025Q1    ┆ 2025Q2    ┆ 2025Q3    ┆ 2025Q4    │
│ ---                         ┆ ---    ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                         ┆ str    ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Cash and Cash Equivalents   ┆ AAPL   ┆ 3.0299e10 ┆ 2.8162e10 ┆ 3.6269e10 ┆ 3.5934e10 ┆ 4.5317e10 │
│ Accounts Receivable         ┆ AAPL   ┆ 2.9639e10 ┆ 2.6136e10 ┆ 2.7557e10 ┆ 3.9777e10 ┆ 3.9921e10 │
│ Inventories                 ┆ AAPL   ┆ 6.9110e9  ┆ 6.2690e9  ┆ 5.9250e9  ┆ 5.7180e9  ┆ 5.8750e9  │
│ Other Current Assets        ┆ AAPL   ┆ 1.3248e10 ┆ 1.4109e10 ┆ 1.4359e10 ┆ 1.4585e10 ┆ 1.5002e10 │
│ Total Current Assets        ┆ AAPL   ┆ 1.3324e11 ┆ 1.1867e11 ┆ 1.2249e11 ┆ 1.4796e11 ┆ 1.5810e11 │
│ …                           ┆ …      ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Total Liabilities           ┆ NVDA   ┆ 3.2274e10 ┆ 4.1411e10 ┆ 4.0609e10 ┆ 4.2251e10 ┆ 4.9510e10 │
│ Common Stock                ┆ NVDA   ┆ 2.4e7     ┆ 2.4e7     ┆ 2.4e7     ┆ 2.4e7     ┆ 2.4e7     │
│ Retained Earnings           ┆ NVDA   ┆ 6.8038e10 ┆ 7.2158e10 ┆ 8.8737e10 ┆ 1.0791e11 ┆ 1.4697e11 │
│ Total Equity                ┆ NVDA   ┆ 7.9327e10 ┆ 8.3843e10 ┆ 1.0013e11 ┆ 1.1890e11 ┆ 1.5729e11 │
│ Total Liabilities and       ┆ NVDA   ┆ 7.9327e10 ┆ 8.3843e10 ┆ 1.0013e11 ┆ 1.1890e11 ┆ 1.5729e11 │
│ Equity                      ┆        ┆           ┆           ┆           ┆           ┆           │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
Error Fetching Data for BTC-USD: fetching balance sheet for ticker 'BTC-USD' (Quarterly): not found: "asOfDate" not found
Unable to stack shape: (22, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items                       ┆ symbol ┆ 2025Q1    ┆ 2025Q2    ┆ 2025Q3    ┆ 2025Q4    ┆ 2026Q1    │
│ ---                         ┆ ---    ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                         ┆ str    ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Cash and Cash Equivalents   ┆ MSFT   ┆ 2.8828e10 ┆ 3.0242e10 ┆ 2.8849e10 ┆ 2.4296e10 ┆ 3.2105e10 │
│ Accounts Receivable         ┆ MSFT   ┆ 5.1700e10 ┆ 6.9905e10 ┆ 5.2894e10 ┆ 5.6535e10 ┆ 6.0041e10 │
│ Inventories                 ┆ MSFT   ┆ 8.48e8    ┆ 9.38e8    ┆ 1.1300e9  ┆ 1.0590e9  ┆ 1.2190e9  │
│ Other Current Assets        ┆ MSFT   ┆ 2.4478e10 ┆ 2.5723e10 ┆ 3.3030e10 ┆ 3.3134e10 ┆ 3.5797e10 │
│ Total Current Assets        ┆ MSFT   ┆ 1.5664e11 ┆ 1.9113e11 ┆ 1.8907e11 ┆ 1.8019e11 ┆ 1.7533e11 │
│ …                           ┆ …      ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ Total Liabilities           ┆ MSFT   ┆ 2.4073e11 ┆ 2.7552e11 ┆ 2.7328e11 ┆ 2.7443e11 ┆ 2.7986e11 │
│ Common Stock                ┆ MSFT   ┆ 1.0696e11 ┆ 1.0910e11 ┆ 1.1096e11 ┆ 1.1279e11 ┆ 1.1507e11 │
│ Retained Earnings           ┆ MSFT   ┆ 2.1976e11 ┆ 2.3773e11 ┆ 2.5487e11 ┆ 2.8079e11 ┆ 3.0253e11 │
│ Total Equity                ┆ MSFT   ┆ 3.2189e11 ┆ 3.4348e11 ┆ 3.6308e11 ┆ 3.9088e11 ┆ 4.1437e11 │
│ Total Liabilities and       ┆ MSFT   ┆ 3.2189e11 ┆ 3.4348e11 ┆ 3.6308e11 ┆ 3.9088e11 ┆ 4.1437e11 │
│ Equity                      ┆        ┆           ┆           ┆           ┆           ┆           │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q4" and "2025Q1"
get_cashflow_statement

Fetch the cash flow statement for all tickers.

Parameters:

  • frequency (str): The frequency of the data (annual or quarterly).
  • formatted (optional[bool]): Whether to return the data in a formatted manner, defaults to True.

Returns:

  • DataFrame: Polars DataFrame containing the cash flow statement.

Example:

cashflow_statement = tickers.get_cashflow_statement(frequency="quarterly")
print(cashflow_statement)
shape: (82, 7)
┌────────────────────────┬────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ Items                  ┆ symbol ┆ 2024Q4     ┆ 2025Q1     ┆ 2025Q2     ┆ 2025Q3     ┆ 2025Q4     │
│ ---                    ┆ ---    ┆ ---        ┆ ---        ┆ ---        ┆ ---        ┆ ---        │
│ str                    ┆ str    ┆ f64        ┆ f64        ┆ f64        ┆ f64        ┆ f64        │
╞════════════════════════╪════════╪════════════╪════════════╪════════════╪════════════╪════════════╡
│ Net Income from        ┆ AAPL   ┆ 3.6330e10  ┆ 2.4780e10  ┆ 2.3434e10  ┆ 2.7466e10  ┆ 4.2097e10  │
│ Continuing Ope…        ┆        ┆            ┆            ┆            ┆            ┆            │
│ Depreciation,          ┆ AAPL   ┆ 3.0800e9   ┆ 2.6610e9   ┆ 2.8300e9   ┆ 3.1270e9   ┆ 3.2140e9   │
│ Amortization, an…      ┆        ┆            ┆            ┆            ┆            ┆            │
│ Stock-Based            ┆ AAPL   ┆ 3.2860e9   ┆ 3.2260e9   ┆ 3.1680e9   ┆ 3.1830e9   ┆ 3.5940e9   │
│ Compensation           ┆        ┆            ┆            ┆            ┆            ┆            │
│ Changes in Working     ┆ AAPL   ┆ -1.0752e10 ┆ -6.5070e9  ┆ -2.0340e9  ┆ -5.7070e9  ┆ 5.5480e9   │
│ Capital                ┆        ┆            ┆            ┆            ┆            ┆            │
│ Cash Flow from         ┆ AAPL   ┆ 2.9935e10  ┆ 2.3952e10  ┆ 2.7867e10  ┆ 2.9728e10  ┆ 5.3925e10  │
│ Continuing Oper…       ┆        ┆            ┆            ┆            ┆            ┆            │
│ …                      ┆ …      ┆ …          ┆ …          ┆ …          ┆ …          ┆ …          │
│ Operating Cash Flow    ┆ NVDA   ┆ 1.6629e10  ┆ 2.7414e10  ┆ 1.5365e10  ┆ 2.3751e10  ┆ 3.6188e10  │
│ Investing Cash Flow    ┆ NVDA   ┆ -7.1980e9  ┆ -5.2160e9  ┆ -7.1270e9  ┆ -9.0240e9  ┆ -3.0861e10 │
│ Financing Cash Flow    ┆ NVDA   ┆ -9.9490e9  ┆ -1.5553e10 ┆ -1.1833e10 ┆ -1.4880e10 ┆ -6.2080e9  │
│ Ending Cash Position   ┆ NVDA   ┆ 8.5890e9   ┆ 1.5234e10  ┆ 1.1639e10  ┆ 1.1486e10  ┆ 1.0605e10  │
│ Free Cash Flow         ┆ NVDA   ┆ 1.5552e10  ┆ 2.6187e10  ┆ 1.3470e10  ┆ 2.2115e10  ┆ 3.4904e10  │
└────────────────────────┴────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
Error Fetching Data for BTC-USD: fetching cashflow statement for ticker 'BTC-USD' (Quarterly): not found: "asOfDate" not found
Unable to stack shape: (31, 6)
┌─────────────────────────────────┬────────┬────────┬────────┬────────┬────────┐
│ Items                           ┆ symbol ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 ┆ 2025Q2 │
│ ---                             ┆ ---    ┆ ---    ┆ ---    ┆ ---    ┆ ---    │
│ str                             ┆ str    ┆ f64    ┆ f64    ┆ f64    ┆ f64    │
╞═════════════════════════════════╪════════╪════════╪════════╪════════╪════════╡
│ Net Income from Continuing Ope… ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Depreciation, Amortization, an… ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Stock-Based Compensation        ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Deferred Income Tax             ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Changes in Working Capital      ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ …                               ┆ …      ┆ …      ┆ …      ┆ …      ┆ …      │
│ Operating Cash Flow             ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Investing Cash Flow             ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Financing Cash Flow             ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Ending Cash Position            ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
│ Free Cash Flow                  ┆ MSFT   ┆ 0.0    ┆ 0.0    ┆ 0.0    ┆ 0.0    │
└─────────────────────────────────┴────────┴────────┴────────┴────────┴────────┘: lengths don't match: unable to append to a DataFrame of width 7 with a DataFrame of width 6
get_financial_ratios

Fetch the financial ratios for all tickers.

Parameters:

  • frequency (str): The frequency of the data (annual or quarterly).

Returns:

  • DataFrame: Polars DataFrame containing the financial ratios.

Example:

financial_ratios = tickers.get_financial_ratios(frequency="quarterly")
print(financial_ratios)
Error Fetching Data for MSFT: fetching financial ratios for ticker 'MSFT' (Quarterly): lengths don't match: could not create a new DataFrame: height of column 'Quick Ratio' (4) does not match height of column 'date' (5)
Error Fetching Data for BTC-USD: fetching financial ratios for ticker 'BTC-USD' (Quarterly): not found: "asOfDate" not found
shape: (63, 7)
┌─────────────────────────┬────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Items                   ┆ symbol ┆ 2024Q4   ┆ 2025Q1   ┆ 2025Q2   ┆ 2025Q3   ┆ 2025Q4   │
│ ---                     ┆ ---    ┆ ---      ┆ ---      ┆ ---      ┆ ---      ┆ ---      │
│ str                     ┆ str    ┆ f64      ┆ f64      ┆ f64      ┆ f64      ┆ f64      │
╞═════════════════════════╪════════╪══════════╪══════════╪══════════╪══════════╪══════════╡
│ Gross Profit Margin     ┆ AAPL   ┆ 0.468825 ┆ 0.470506 ┆ 0.464907 ┆ 0.471776 ┆ 0.481587 │
│ Operating Profit Margin ┆ AAPL   ┆ 0.344586 ┆ 0.310291 ┆ 0.299906 ┆ 0.316466 ┆ 0.353738 │
│ Net Profit Margin       ┆ AAPL   ┆ 0.292277 ┆ 0.25986  ┆ 0.249202 ┆ 0.26805  ┆ 0.292836 │
│ Return on Assets        ┆ AAPL   ┆ 0.105584 ┆ 0.074811 ┆ 0.070692 ┆ 0.076456 ┆ 0.110987 │
│ Return on Equity        ┆ AAPL   ┆ 0.544204 ┆ 0.37098  ┆ 0.355978 ┆ 0.372506 ┆ 0.477344 │
│ …                       ┆ …      ┆ …        ┆ …        ┆ …        ┆ …        ┆ …        │
│ Price to Earnings       ┆ NVDA   ┆ 3.974017 ┆ 4.916485 ┆ 4.110098 ┆ 3.960044 ┆ 3.835242 │
│ Price to Book           ┆ NVDA   ┆ 1.106685 ┆ 1.100951 ┆ 1.084549 ┆ 1.062811 ┆ 1.047485 │
│ Price to Sales          ┆ NVDA   ┆ 2.232082 ┆ 2.094934 ┆ 2.323278 ┆ 2.216696 ┆ 2.418454 │
│ Price to Cashflow       ┆ NVDA   ┆ 5.279331 ┆ 3.367148 ┆ 7.067816 ┆ 5.320408 ┆ 4.552946 │
│ Price to Free Cashflow  ┆ NVDA   ┆ 5.644933 ┆ 3.524917 ┆ 8.062138 ┆ 5.713995 ┆ 4.720433 │
└─────────────────────────┴────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
returns

Compute the returns for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing the returns.

Example:

returns = tickers.returns()
print(returns)
shape: (1_460, 6)
┌─────────────────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ timestamp           ┆ AAPL      ┆ GOOG      ┆ MSFT      ┆ NVDA      ┆ BTC-USD   │
│ ---                 ┆ ---       ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│ str                 ┆ f64       ┆ f64       ┆ f64       ┆ f64       ┆ f64       │
╞═════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ 2020-01-02 00:00:00 ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ -0.029819 │
│ 2020-01-03 00:00:00 ┆ -0.009722 ┆ -0.004907 ┆ -0.012452 ┆ -0.016006 ┆ 0.051452  │
│ 2020-01-04 00:00:00 ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.008955  │
│ 2020-01-05 00:00:00 ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.000089  │
│ 2020-01-06 00:00:00 ┆ 0.007968  ┆ 0.024657  ┆ 0.002585  ┆ 0.004194  ┆ 0.048291  │
│ …                   ┆ …         ┆ …         ┆ …         ┆ …         ┆ …         │
│ 2023-12-27 00:00:00 ┆ 0.000518  ┆ -0.009662 ┆ -0.001575 ┆ 0.0028    ┆ 0.021694  │
│ 2023-12-28 00:00:00 ┆ 0.002226  ┆ -0.001131 ┆ 0.003235  ┆ 0.002125  ┆ -0.01876  │
│ 2023-12-29 00:00:00 ┆ -0.005424 ┆ -0.002477 ┆ 0.002025  ┆ 0.0       ┆ -0.012397 │
│ 2023-12-30 00:00:00 ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.001366  │
│ 2023-12-31 00:00:00 ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.0       ┆ 0.002569  │
└─────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
performance_stats

Compute the performance stats for all tickers.

Returns:

  • DataFrame: Polars DataFrame containing the performance stats.

Example:

performance_stats = tickers.performance_stats()
print(performance_stats)
shape: (5, 17)
┌─────────┬────────────┬───────────┬───────────┬───┬───────────┬───────────┬───────────┬───────────┐
│ Symbol  ┆ Daily      ┆ Daily Vol ┆ Cumulativ ┆ … ┆ Calmar    ┆ Maximum   ┆ Value at  ┆ Expected  │
│ ---     ┆ Return     ┆ atility   ┆ e Return  ┆   ┆ Ratio     ┆ Drawdown  ┆ Risk      ┆ Shortfall │
│ str     ┆ ---        ┆ ---       ┆ ---       ┆   ┆ ---       ┆ ---       ┆ ---       ┆ ---       │
│         ┆ str        ┆ str       ┆ str       ┆   ┆ str       ┆ str       ┆ str       ┆ str       │
╞═════════╪════════════╪═══════════╪═══════════╪═══╪═══════════╪═══════════╪═══════════╪═══════════╡
│ AAPL    ┆ 0.00118656 ┆ 0.0211459 ┆ 1.6318924 ┆ … ┆ 1.1070598 ┆ 0.3142726 ┆ -0.032405 ┆ -0.046854 │
│         ┆ 6850365219 ┆ 259594542 ┆ 845126603 ┆   ┆ 349836818 ┆ 810924572 ┆ 508478040 ┆ 813670815 │
│         ┆            ┆ 27        ┆           ┆   ┆           ┆           ┆ 36        ┆ 725       │
│ GOOG    ┆ 0.00094234 ┆ 0.0210803 ┆ 1.0613296 ┆ … ┆ 0.6000157 ┆ 0.4460184 ┆ -0.031889 ┆ -0.047746 │
│         ┆ 3635566264 ┆ 787569822 ┆ 874606246 ┆   ┆ 747702262 ┆ 350698127 ┆ 474979566 ┆ 540783610 │
│         ┆ 1          ┆ 38        ┆           ┆   ┆           ┆ 6         ┆ 99        ┆ 084       │
│ MSFT    ┆ 0.00109462 ┆ 0.0205458 ┆ 1.4295204 ┆ … ┆ 0.8536311 ┆ 0.3714848 ┆ -0.029481 ┆ -0.045188 │
│         ┆ 7430786214 ┆ 031177071 ┆ 571347915 ┆   ┆ 048592007 ┆ 217046439 ┆ 746711654 ┆ 332855100 │
│         ┆ 4          ┆ 2         ┆           ┆   ┆           ┆           ┆ 32        ┆ 787       │
│ NVDA    ┆ 0.00268455 ┆ 0.0341607 ┆ 7.2890281 ┆ … ┆ 1.4532078 ┆ 0.6633509 ┆ -0.051182 ┆ -0.069626 │
│         ┆ 057813385  ┆ 050166645 ┆ 08118632  ┆   ┆ 66307739  ┆ 955832535 ┆ 721681628 ┆ 392088001 │
│         ┆            ┆ 6         ┆           ┆   ┆           ┆           ┆ 67        ┆ 73        │
│ BTC-USD ┆ 0.00183248 ┆ 0.0347987 ┆ 4.8700228 ┆ … ┆ 1.2407104 ┆ 0.7663456 ┆ -0.051000 ┆ -0.079813 │
│         ┆ 8513521362 ┆ 535807811 ┆ 13710888  ┆   ┆ 197326326 ┆ 370856909 ┆ 981516212 ┆ 265012581 │
│         ┆ 8          ┆ 9         ┆           ┆   ┆           ┆           ┆ 96        ┆ 07        │
└─────────┴────────────┴───────────┴───────────┴───┴───────────┴───────────┴───────────┴───────────┘
returns_chart

Display the cumulative returns chart for all tickers.

Returns:

  • Plot: Plot object containing the returns chart.

Example:

returns_chart = tickers.returns_chart()
returns_chart.show()
returns_matrix

Display the returns correlation matrix for all tickers.

Returns:

  • Plot: Plot object containing the returns chart.

Example:

returns_matrix = tickers.returns_matrix(height=600, width=800)
returns_matrix.show()
report

Generate a report for all tickers.

Parameters:

  • report_type (Optional[str]): The type of report to generate (“performance”).
  • display (Optional[str]): The display mode for the report. set to “notebook” for Jupyter Notebook display, defaults to “browser”.

Example:

tickers.report("performance")
get_ticker

Fetch the Ticker object for a specific ticker symbol.

Parameters:

  • symbol (str): The ticker symbol.

Returns:

  • Ticker: A Ticker object.

Example:

ticker = tickers.get_ticker(symbol="AAPL")
ticker.performance_chart().show()
optimize

Optimizes the tickers given the objective function and constraints.

Parameters:

  • objective_function (Optional[str]): The objective function for optimization:
    • max_sharpe: Maximize return per unit of risk.
    • min_vol: Minimize overall volatility.
    • max_return: Maximize expected return.
    • min_var: Minimize Value-at-Risk (VaR).
    • min_cvar: Minimize Conditional Value-at-Risk (CVaR).
    • min_drawdown: Minimize maximum portfolio drawdown.
  • asset_constraints (Optional[List[Tuple[float, float]]]): List of tuples with the lower and upper bounds for the ticker weights.
  • categorical_constraints (Optional[List[Tuple[str, List[str], List[Tuple[str, float, float]]]]]): Category-based constraints. Each tuple has the form:
    • category_name (str): Name of the constraint group (e.g., "AssetClass").
    • category_per_symbol (List[str]): Assigns each ticker to a category, in the same order as ticker_symbols.
    • weight_per_category (List[Tuple[str, float, float]]): Tuples of (category_label, min_weight, max_weight) specifying bounds for each category.
  • weights (Optional[List[float]]): Weights for asset allocation. If provided, overrides the optimization process.

Returns:

  • Portfolio: A Portfolio object.

Example:

portfolio = tickers.optimize(objective_function="max_sharpe")
portfolio.performance_chart().show()