from finalytics import Tickers
= Tickers(symbols=["AAPL", "GOOG", "MSFT", "NVDA", "BTC-USD"],
tickers ="2020-01-01",
start_date="2024-01-01",
end_date="1d",
interval="^GSPC",
benchmark_symbol=0.95,
confidence_level=0.02) risk_free_rate
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:
get_summary_stats
Fetch the Ticker Summary Stats Data for all tickers.
Returns:
DataFrame
: Polars DataFrame containing summary statistics.
Example:
= tickers.get_summary_stats()
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 ┆ 228.58 ┆ 229.94 - ┆ … ┆ 300.00 - ┆ 37 ┆ ┆ │
│ ┆ ┆ ┆ 227.10 ┆ ┆ 175.00 ┆ ┆ ┆ │
│ GOOG ┆ USD ┆ 202.68 ┆ 205.13 - ┆ … ┆ 237.00 - ┆ 19 ┆ ┆ │
│ ┆ ┆ ┆ 201.41 ┆ ┆ 185.00 ┆ ┆ ┆ │
│ MSFT ┆ USD ┆ 525.32 ┆ 527.59 - ┆ … ┆ 700.00 - ┆ 51 ┆ ┆ │
│ ┆ ┆ ┆ 522.71 ┆ ┆ 470.00 ┆ ┆ ┆ │
│ NVDA ┆ USD ┆ 180.91 ┆ 182.99 - ┆ … ┆ 250.00 - ┆ 56 ┆ ┆ │
│ ┆ ┆ ┆ 179.46 ┆ ┆ 100.00 ┆ ┆ ┆ │
│ BTC-USD ┆ USD ┆ ┆ 119,506.07 ┆ … ┆ - ┆ ┆ 19,905,28 ┆ https://c │
│ ┆ ┆ ┆ - ┆ ┆ ┆ ┆ 0.00 ┆ oinmarket │
│ ┆ ┆ ┆ 118,248.38 ┆ ┆ ┆ ┆ ┆ cap.com/c │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ urr… │
└─────────┴──────────┴────────────┴────────────┴───┴───────────┴───────────┴───────────┴───────────┘
get_price_history
Fetch the OHLCV Data for all tickers.
Returns:
DataFrame
: Polars DataFrame containing OHLCV data.
Example:
= tickers.get_price_history()
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.538521 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ 8 ┆ │
│ 2020-01-03 ┆ AAPL ┆ 74.287498 ┆ 75.144997 ┆ 74.125 ┆ 74.357498 ┆ 1.463228e ┆ 71.83329 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ 8 ┆ │
│ 2020-01-06 ┆ AAPL ┆ 73.447502 ┆ 74.989998 ┆ 73.1875 ┆ 74.949997 ┆ 1.183872e ┆ 72.40567 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ 8 ┆ │
│ 2020-01-07 ┆ AAPL ┆ 74.959999 ┆ 75.224998 ┆ 74.370003 ┆ 74.597504 ┆ 1.08872e8 ┆ 72.06514 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2020-01-08 ┆ AAPL ┆ 74.290001 ┆ 76.110001 ┆ 74.290001 ┆ 75.797501 ┆ 1.320792e ┆ 73.224419 │
│ 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:
= tickers.get_options_chain()
options_chain print(options_chain)
shape: (11_512, 17)
┌────────────┬───────────┬──────┬────────┬───┬─────────────┬─────────────┬────────────┬────────────┐
│ expiration ┆ ttm ┆ type ┆ symbol ┆ … ┆ contractSiz ┆ lastTradeDa ┆ impliedVol ┆ inTheMoney │
│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ e ┆ te ┆ atility ┆ --- │
│ str ┆ f64 ┆ str ┆ str ┆ ┆ --- ┆ --- ┆ --- ┆ bool │
│ ┆ ┆ ┆ ┆ ┆ str ┆ datetime[ms ┆ f64 ┆ │
│ ┆ ┆ ┆ ┆ ┆ ┆ ] ┆ ┆ │
╞════════════╪═══════════╪══════╪════════╪═══╪═════════════╪═════════════╪════════════╪════════════╡
│ 2025-08-15 ┆ 0.098555 ┆ call ┆ AAPL ┆ … ┆ REGULAR ┆ 2025-08-11 ┆ 4.20313 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 19:26:37 ┆ ┆ │
│ 2025-08-15 ┆ 0.098555 ┆ call ┆ AAPL ┆ … ┆ REGULAR ┆ 2025-08-11 ┆ 4.050786 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 14:02:05 ┆ ┆ │
│ 2025-08-15 ┆ 0.098555 ┆ call ┆ AAPL ┆ … ┆ REGULAR ┆ 2025-08-11 ┆ 3.644532 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 19:28:31 ┆ ┆ │
│ 2025-08-15 ┆ 0.098555 ┆ call ┆ AAPL ┆ … ┆ REGULAR ┆ 2025-08-08 ┆ 3.082034 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 17:57:07 ┆ ┆ │
│ 2025-08-15 ┆ 0.098555 ┆ call ┆ AAPL ┆ … ┆ REGULAR ┆ 2025-08-08 ┆ 3.427736 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 18:42:39 ┆ ┆ │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ 2027-12-17 ┆ 28.153745 ┆ put ┆ NVDA ┆ … ┆ REGULAR ┆ 2025-08-11 ┆ 0.218086 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 18:17:27 ┆ ┆ │
│ 2027-12-17 ┆ 28.153745 ┆ put ┆ NVDA ┆ … ┆ REGULAR ┆ 2025-07-30 ┆ 0.211922 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 16:43:40 ┆ ┆ │
│ 2027-12-17 ┆ 28.153745 ┆ put ┆ NVDA ┆ … ┆ REGULAR ┆ 2025-08-05 ┆ 0.199593 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 14:00:00 ┆ ┆ │
│ 2027-12-17 ┆ 28.153745 ┆ put ┆ NVDA ┆ … ┆ REGULAR ┆ 2025-08-05 ┆ 0.300727 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 19:11:43 ┆ ┆ │
│ 2027-12-17 ┆ 28.153745 ┆ put ┆ NVDA ┆ … ┆ REGULAR ┆ 2025-08-11 ┆ 0.266365 ┆ true │
│ ┆ ┆ ┆ ┆ ┆ ┆ 18:00: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:
= tickers.get_news()
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:
= tickers.get_income_statement(frequency="quarterly")
income_statement print(income_statement)
Error Fetching Data for BTC-USD: not found: "asOfDate" not found
Unable to stack shape: (13, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ symbol ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue ┆ NVDA ┆ 2.6044e10 ┆ 3.0040e10 ┆ 3.5082e10 ┆ 3.9331e10 ┆ 4.4062e10 │
│ Cost of Goods Sold ┆ NVDA ┆ 5.6380e9 ┆ 7.4660e9 ┆ 8.9260e9 ┆ 1.0608e10 ┆ 1.7394e10 │
│ Gross Profit ┆ NVDA ┆ 2.0406e10 ┆ 2.2574e10 ┆ 2.6156e10 ┆ 2.8723e10 ┆ 2.6668e10 │
│ Operating Expenses ┆ NVDA ┆ 3.4970e9 ┆ 3.9320e9 ┆ 4.2870e9 ┆ 4.6890e9 ┆ 5.0300e9 │
│ EBITDA ┆ NVDA ┆ 1.7753e10 ┆ 1.9708e10 ┆ 2.2855e10 ┆ 2.5821e10 ┆ 2.2584e10 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Interest Expense ┆ NVDA ┆ 6.4e7 ┆ 6.1e7 ┆ 6.1e7 ┆ 6.1e7 ┆ 6.3e7 │
│ Income Tax Expense ┆ NVDA ┆ 2.3980e9 ┆ 2.6150e9 ┆ 3.0070e9 ┆ 3.1260e9 ┆ 3.1350e9 │
│ Net Income �� NVDA ┆ 1.4881e10 ┆ 1.6599e10 ┆ 1.9309e10 ┆ 2.2091e10 ┆ 1.8775e10 │
│ Earnings per Share - Basic ┆ NVDA ┆ 0.6 ┆ 0.68 ┆ 0.79 ┆ 0.9 ┆ 0.77 │
│ Earnings per Share - ┆ NVDA ┆ 0.6 ┆ 0.67 ┆ 0.78 ┆ 0.89 ┆ 0.76 │
│ Diluted ┆ ┆ ┆ ┆ ┆ ┆ │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q2" and "2024Q1"
shape: (37, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ symbol ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 ┆ 2025Q2 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue ┆ AAPL ┆ 8.5777e10 ┆ 9.4930e10 ┆ 1.2430e11 ┆ 9.5359e10 ┆ 9.4036e10 │
│ Cost of Goods Sold ┆ AAPL ┆ 4.6099e10 ┆ 5.1051e10 ┆ 6.6025e10 ┆ 5.0492e10 ┆ 5.0318e10 │
│ Gross Profit ┆ AAPL ┆ 3.9678e10 ┆ 4.3879e10 ┆ 5.8275e10 ┆ 4.4867e10 ┆ 4.3718e10 │
│ Operating Expenses ┆ AAPL ┆ 1.4326e10 ┆ 1.4288e10 ┆ 1.5443e10 ┆ 1.5278e10 ┆ 1.5516e10 │
│ EBITDA ┆ AAPL ┆ 2.8202e10 ┆ 3.2502e10 ┆ 4.5912e10 ┆ 3.2250e10 ┆ 3.1032e10 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Interest Expense ┆ MSFT ┆ 7.01e8 ┆ 5.82e8 ┆ 5.94e8 ┆ 5.94e8 ┆ 6.15e8 │
│ Income Tax Expense ┆ MSFT ┆ 5.2140e9 ┆ 5.6020e9 ┆ 5.2570e9 ┆ 5.5530e9 ┆ 5.3830e9 │
│ Net Income ┆ MSFT ┆ 2.2036e10 ┆ 2.4667e10 ┆ 2.4108e10 ┆ 2.5824e10 ┆ 2.7233e10 │
│ Earnings per Share - Basic ┆ MSFT ┆ 2.96 ┆ 3.32 ┆ 3.24 ┆ 3.47 ┆ 3.66 │
│ Earnings per Share - ┆ MSFT ┆ 2.95 ┆ 3.3 ┆ 3.23 ┆ 3.46 ┆ 3.65 │
│ 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:
= tickers.get_balance_sheet(frequency="quarterly")
balance_sheet print(balance_sheet)
shape: (64, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ symbol ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 ┆ 2025Q2 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Cash and Cash Equivalents ┆ AAPL ┆ 2.5565e10 ┆ 2.9943e10 ┆ 3.0299e10 ┆ 2.8162e10 ┆ 3.6269e10 │
│ Accounts Receivable ┆ AAPL ┆ 2.2795e10 ┆ 3.3410e10 ┆ 2.9639e10 ┆ 2.6136e10 ┆ 2.7557e10 │
│ Inventories ┆ AAPL ┆ 6.1650e9 ┆ 7.2860e9 ┆ 6.9110e9 ┆ 6.2690e9 ┆ 5.9250e9 │
│ Other Current Assets ┆ AAPL ┆ 1.4297e10 ┆ 1.4287e10 ┆ 1.3248e10 ┆ 1.4109e10 ┆ 1.4359e10 │
│ Total Current Assets ┆ AAPL ┆ 1.2544e11 ┆ 1.5299e11 ┆ 1.3324e11 ┆ 1.1867e11 ┆ 1.2249e11 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Total Liabilities ┆ MSFT ┆ 2.4369e11 ┆ 2.3529e11 ┆ 2.3120e11 ┆ 2.4073e11 ┆ 2.7552e11 │
│ Common Stock ┆ MSFT ┆ 1.0092e11 ┆ 1.0298e11 ┆ 1.0483e11 ┆ 1.0696e11 ┆ 1.0910e11 │
│ Retained Earnings ┆ MSFT ┆ 1.7314e11 ┆ 1.8893e11 ┆ 2.0348e11 ┆ 2.1976e11 ┆ 2.3773e11 │
│ Total Equity ┆ MSFT ┆ 2.6848e11 ┆ 2.8772e11 ┆ 3.0270e11 ┆ 3.2189e11 ┆ 3.4348e11 │
│ Total Liabilities and ┆ MSFT ┆ 2.6848e11 ┆ 2.8772e11 ┆ 3.0270e11 ┆ 3.2189e11 ┆ 3.4348e11 │
│ Equity ┆ ┆ ┆ ┆ ┆ ┆ │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
Error Fetching Data for BTC-USD: not found: "asOfDate" not found
Unable to stack shape: (22, 7)
┌─────────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ symbol ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Cash and Cash Equivalents ┆ NVDA ┆ 7.5870e9 ┆ 8.5630e9 ┆ 9.1070e9 ┆ 8.5890e9 ┆ 1.5234e10 │
│ Accounts Receivable ┆ NVDA ┆ 1.2365e10 ┆ 1.4132e10 ┆ 1.7693e10 ┆ 2.3065e10 ┆ 2.2132e10 │
│ Inventories ┆ NVDA ┆ 5.8640e9 ┆ 6.6750e9 ┆ 7.6540e9 ┆ 1.0080e10 ┆ 1.1333e10 │
│ Other Current Assets ┆ NVDA ┆ 4.0620e9 ┆ 4.0260e9 ┆ 3.8060e9 ┆ 3.7710e9 ┆ 2.7790e9 │
│ Total Current Assets ┆ NVDA ┆ 5.3729e10 ┆ 5.9633e10 ┆ 6.7640e10 ┆ 8.0126e10 ┆ 8.9935e10 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Total Liabilities ┆ NVDA ┆ 2.7930e10 ┆ 2.7070e10 ┆ 3.0114e10 ┆ 3.2274e10 ┆ 4.1411e10 │
│ Common Stock ┆ NVDA ┆ 2e6 ┆ 2.5e7 ┆ 2.5e7 ┆ 2.4e7 ┆ 2.4e7 │
│ Retained Earnings �� NVDA ┆ 3.6598e10 ┆ 4.5961e10 ┆ 5.3950e10 ┆ 6.8038e10 ┆ 7.2158e10 │
│ Total Equity ┆ NVDA ┆ 4.9142e10 ┆ 5.8157e10 ┆ 6.5899e10 ┆ 7.9327e10 ┆ 8.3843e10 │
│ Total Liabilities and ┆ NVDA ┆ 4.9142e10 ┆ 5.8157e10 ┆ 6.5899e10 ┆ 7.9327e10 ┆ 8.3843e10 │
│ Equity ┆ ┆ ┆ ┆ ┆ ┆ │
└─────────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q2" and "2024Q1"
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:
= tickers.get_cashflow_statement(frequency="quarterly")
cashflow_statement print(cashflow_statement)
shape: (86, 7)
┌────────────────────────┬────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ Items ┆ symbol ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 ┆ 2025Q2 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞════════════════════════╪════════╪════════════╪════════════╪════════════╪════════════╪════════════╡
│ Net Income from ┆ AAPL ┆ 2.1448e10 ┆ 1.4736e10 ┆ 3.6330e10 ┆ 2.4780e10 ┆ 2.3434e10 │
│ Continuing Ope… ┆ ┆ ┆ ┆ ┆ ┆ │
│ Depreciation, ┆ AAPL ┆ 2.8500e9 ┆ 2.9110e9 ┆ 3.0800e9 ┆ 2.6610e9 ┆ 2.8300e9 │
│ Amortization, an… ┆ ┆ ┆ ┆ ┆ ┆ │
│ Stock-Based ┆ AAPL ┆ 2.8690e9 ┆ 2.8580e9 ┆ 3.2860e9 ┆ 3.2260e9 ┆ 3.1680e9 │
│ Compensation ┆ ┆ ┆ ┆ ┆ ┆ │
│ Changes in Working ┆ AAPL ┆ 1.6840e9 ┆ 6.6080e9 ┆ -1.0752e10 ┆ -6.5070e9 ┆ -2.0340e9 │
│ Capital ┆ ┆ ┆ ┆ ┆ ┆ │
│ Cash Flow from ┆ AAPL ┆ 2.8858e10 ┆ 2.6811e10 ┆ 2.9935e10 ┆ 2.3952e10 ┆ 2.7867e10 │
│ Continuing Oper… ┆ ┆ ┆ ┆ ┆ ┆ │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Operating Cash Flow ┆ MSFT ┆ 3.7195e10 ┆ 3.4180e10 ┆ 2.2291e10 ┆ 3.7044e10 ┆ 4.2647e10 │
│ Investing Cash Flow ┆ MSFT ┆ -1.4848e10 ┆ -1.5201e10 ┆ -1.4112e10 ┆ -1.2714e10 ┆ -3.0572e10 │
│ Financing Cash Flow ┆ MSFT ┆ -2.3563e10 ┆ -1.6576e10 ┆ -1.1243e10 ┆ -1.3036e10 ┆ -1.0844e10 │
│ Ending Cash Position ┆ MSFT ┆ 1.8315e10 ┆ 2.0840e10 ┆ 1.7482e10 ┆ 2.8828e10 ┆ 3.0242e10 │
│ Free Cash Flow ┆ MSFT ┆ 2.3322e10 ┆ 1.9257e10 ┆ 6.4870e9 ┆ 2.0299e10 ┆ 2.5568e10 │
└────────────────────────┴────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
Error Fetching Data for BTC-USD: not found: "asOfDate" not found
Unable to stack shape: (27, 7)
┌──────────────────────────┬────────┬───────────┬────────────┬────────────┬───────────┬────────────┐
│ Items ┆ symbol ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞══════════════════════════╪════════╪═══════════╪════════════╪════════════╪═══════════╪════════════╡
│ Net Income from ┆ NVDA ┆ 1.4881e10 ┆ 1.6599e10 ┆ 1.9309e10 ┆ 2.2091e10 ┆ 1.8775e10 │
│ Continuing Ope… ┆ ┆ ┆ ┆ ┆ ┆ │
│ Depreciation, ┆ NVDA ┆ 4.1e8 ┆ 4.33e8 ┆ 4.78e8 ┆ 5.43e8 ┆ 6.11e8 │
│ Amortization, an… ┆ ┆ ┆ ┆ ┆ ┆ │
│ Stock-Based Compensation ┆ NVDA ┆ 1.0110e9 ┆ 1.1530e9 ┆ 1.2520e9 ┆ 1.3210e9 ┆ 1.4740e9 │
│ Deferred Income Tax ┆ NVDA ┆ -1.5770e9 ┆ -1.6990e9 ┆ -6.0300e8 ┆ -5.9800e8 ┆ -2.1770e9 │
│ Changes in Working ┆ NVDA ┆ 8.34e8 ┆ -1.6600e9 ┆ -2.6940e9 ┆ -5.8630e9 ┆ 8.6540e9 │
│ Capital ┆ ┆ ┆ ┆ ┆ ┆ │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Operating Cash Flow ┆ NVDA ┆ 1.5345e10 ┆ 1.4488e10 ┆ 1.7627e10 ┆ 1.6629e10 ┆ 2.7414e10 │
│ Investing Cash Flow ┆ NVDA ┆ -5.6930e9 ┆ -3.1840e9 ┆ -4.3460e9 ┆ -7.1980e9 ┆ -5.2160e9 │
│ Financing Cash Flow ┆ NVDA ┆ -9.3450e9 ┆ -1.0320e10 ┆ -1.2745e10 ┆ -9.9490e9 ┆ -1.5553e10 │
│ Ending Cash Position ┆ NVDA ┆ 7.5870e9 ┆ 8.5710e9 ┆ 9.1070e9 ┆ 8.5890e9 ┆ 1.5234e10 │
│ Free Cash Flow ┆ NVDA ┆ 1.4976e10 ┆ 1.3511e10 ┆ 1.6814e10 ┆ 1.5552e10 ┆ 2.6187e10 │
└──────────────────────────┴────────┴───────────┴────────────┴────────────┴───────────┴────────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q2" and "2024Q1"
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:
= tickers.get_financial_ratios(frequency="quarterly")
financial_ratios print(financial_ratios)
shape: (63, 7)
┌─────────────────────────┬────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ symbol ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 ┆ 2025Q2 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════╪════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Gross Profit Margin ┆ AAPL ┆ 0.462572 ┆ 0.462225 ┆ 0.468825 ┆ 0.470506 ┆ 0.464907 │
│ Operating Profit Margin ┆ AAPL ┆ 0.295557 ┆ 0.311714 ┆ 0.344586 ┆ 0.310291 ┆ 0.299906 │
│ Net Profit Margin ┆ AAPL ┆ 0.250044 ┆ 0.15523 ┆ 0.292277 ┆ 0.25986 ┆ 0.249202 │
│ Return on Assets ┆ AAPL ┆ 0.064678 ┆ 0.040375 ┆ 0.105584 ┆ 0.074811 ┆ 0.070692 │
│ Return on Equity ┆ AAPL ┆ 0.321521 ┆ 0.258753 ┆ 0.544204 ┆ 0.37098 ┆ 0.355978 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Price to Earnings ┆ MSFT ┆ 14.120757 ┆ 13.402157 ┆ 14.203459 ┆ 14.009178 ┆ 14.08699 │
│ Price to Book ┆ MSFT ┆ 1.159001 ┆ 1.148991 ┆ 1.131228 ┆ 1.123899 ┆ 1.116898 │
│ Price to Sales ┆ MSFT ┆ 4.807345 ┆ 5.04065 ┆ 4.917524 ┆ 5.163317 ┆ 5.018655 │
│ Price to Cashflow ┆ MSFT ┆ 8.365775 ┆ 9.67206 ┆ 15.361222 ┆ 9.766035 ┆ 8.995498 │
│ Price to Free Cashflow ┆ MSFT ┆ 13.342123 ┆ 17.167316 ┆ 52.785109 ┆ 17.822208 ┆ 15.004341 │
└─────────────────────────┴────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
Error Fetching Data for BTC-USD: not found: "asOfDate" not found
Unable to stack shape: (21, 7)
┌─────────────────────────┬────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Items ┆ symbol ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 ┆ 2024Q4 ┆ 2025Q1 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════╪════════╪══════════╪══════════╪══════════╪══════════╪══════════╡
│ Gross Profit Margin ┆ NVDA ┆ 0.78352 ┆ 0.751465 ┆ 0.745568 ┆ 0.730289 ┆ 0.605238 │
│ Operating Profit Margin ┆ NVDA ┆ 0.665912 ┆ 0.641644 ┆ 0.637848 ┆ 0.642699 ┆ 0.498684 │
│ Net Profit Margin ┆ NVDA ┆ 0.571379 ┆ 0.552563 ┆ 0.550396 ┆ 0.561669 ┆ 0.426104 │
│ Return on Assets ┆ NVDA ┆ 0.193079 ┆ 0.194762 ┆ 0.201108 ┆ 0.197946 ┆ 0.149895 │
│ Return on Equity ┆ NVDA ┆ 0.302816 ┆ 0.285417 ┆ 0.293009 ┆ 0.27848 ┆ 0.22393 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Price to Earnings ┆ NVDA ┆ 3.870842 ┆ 4.013374 ┆ 3.851106 ┆ 3.974017 ┆ 4.916485 │
│ Price to Book ┆ NVDA ┆ 1.172154 ┆ 1.145485 ┆ 1.128409 ┆ 1.106685 ┆ 1.100951 │
│ Price to Sales ┆ NVDA ┆ 2.211719 ┆ 2.217643 ┆ 2.119634 ┆ 2.232082 ┆ 2.094934 │
│ Price to Cashflow ┆ NVDA ┆ 3.753796 ┆ 4.59815 ┆ 4.218585 ┆ 5.279331 ┆ 3.367148 │
│ Price to Free Cashflow ┆ NVDA ┆ 3.846287 ┆ 4.930649 ┆ 4.422565 ┆ 5.644933 ┆ 3.524917 │
└─────────────────────────┴────────┴──────────┴──────────┴──────────┴──────────┴──────────┘: lengths don't match: unable to vstack, column names don't match: "2024Q2" and "2024Q1"
returns
Compute the returns for all tickers.
Returns:
DataFrame
: Polars DataFrame containing the returns.
Example:
= tickers.returns()
returns print(returns)
shape: (1_461, 6)
┌─────────────────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ timestamp ┆ AAPL ┆ GOOG ┆ MSFT ┆ NVDA ┆ BTC-USD │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ 2020-01-01 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │
│ 2020-01-02 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ -2.981929 │
│ 2020-01-03 00:00:00 ┆ -0.972215 ┆ -0.490725 ┆ -1.245172 ┆ -1.600602 ┆ 5.145166 │
│ 2020-01-04 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.895487 │
│ 2020-01-05 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.008915 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ 2023-12-27 00:00:00 ┆ 0.051803 ┆ -0.966238 ┆ -0.157459 ┆ 0.28004 ┆ 2.169436 │
│ 2023-12-28 00:00:00 ┆ 0.222626 ┆ -0.113124 ┆ 0.32345 ┆ 0.212486 ┆ -1.876028 │
│ 2023-12-29 00:00:00 ┆ -0.542419 ┆ -0.247745 ┆ 0.202522 ┆ 0.0 ┆ -1.23969 │
│ 2023-12-30 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.136582 │
│ 2023-12-31 00:00:00 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.256862 │
└─────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
performance_stats
Compute the performance stats for all tickers.
Returns:
DataFrame
: Polars DataFrame containing the performance stats.
Example:
= tickers.performance_stats()
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.11853875 ┆ 2.1124921 ┆ 163.18933 ┆ … ┆ 1.0362996 ┆ 33.534604 ┆ -3.243676 ┆ -4.714313 │
│ ┆ 316439175 ┆ 374554164 ┆ 495334144 ┆ ┆ 087960261 ┆ 95897686 ┆ 692274868 ┆ 174575061 │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 8 ┆ │
│ GOOG ┆ 0.09414068 ┆ 2.1059432 ┆ 106.13297 ┆ … ┆ 0.5105194 ┆ 52.362250 ┆ -3.194601 ┆ -4.806254 │
│ ┆ 814520443 ┆ 547258057 ┆ 145127274 ┆ ┆ 147187577 ┆ 18080071 ┆ 700883718 ┆ 311329883 │
│ MSFT ┆ 0.10935394 ┆ 2.0525392 ┆ 142.95209 ┆ … ┆ 0.7723260 ┆ 41.012558 ┆ -2.951155 ┆ -4.550189 │
│ ┆ 148249847 ┆ 507092386 ┆ 724482433 ┆ ┆ 029173278 ┆ 05238269 ┆ 744262347 ┆ 39634677 │
│ NVDA ┆ 0.26818823 ┆ 3.4126849 ┆ 728.90273 ┆ … ┆ 1.0561096 ┆ 91.152605 ┆ -5.126370 ┆ -6.999368 │
│ ┆ 686706145 ┆ 41160901 ┆ 0599302 ┆ ┆ 996451254 ┆ 93004216 ┆ 07303044 ┆ 083651968 │
│ BTC-USD ┆ 0.18312342 ┆ 3.4774959 ┆ 487.00228 ┆ … ┆ 0.7734174 ┆ 122.82135 ┆ -5.098586 ┆ -7.981326 │
│ ┆ 434915735 ┆ 999729025 ┆ 137108877 ┆ ┆ 145027587 ┆ 584673281 ┆ 481791351 ┆ 501258104 │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 5 │
└─────────┴────────────┴───────────┴───────────┴───┴───────────┴───────────┴───────────┴───────────┘
returns_chart
Display the cumulative returns chart for all tickers.
Returns:
Plot
: Plot object containing the returns chart.
Example:
= tickers.returns_chart()
returns_chart returns_chart.show()
returns_matrix
Display the returns correlation matrix for all tickers.
Returns:
Plot
: Plot object containing the returns chart.
Example:
= tickers.returns_matrix(height=600, width=800)
returns_matrix 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:
"performance") tickers.report(
get_ticker
Fetch the Ticker object for a specific ticker symbol.
Parameters:
symbol
(str): The ticker symbol.
Returns:
Ticker
: A Ticker object.
Example:
= tickers.get_ticker(symbol="AAPL")
ticker 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.
constraints
(Optional[List[Tuple[float, float]]]): List of constraints for optimization.weights
(Optional[List[float]]): Weights for asset allocation. If provided, overrides the optimization process.
Returns:
Portfolio
: A Portfolio object.
Example:
= tickers.optimize(objective_function="max_sharpe", constraints=[(0, 1), (0, 1), (0, 1), (0, 1), (0,1)])
portfolio portfolio.performance_chart().show()