from finalytics import Ticker
= Ticker(symbol="AAPL",
ticker ="2023-01-01",
start_date="2024-01-01",
end_date="1d",
interval="^GSPC",
benchmark_symbol=0.95,
confidence_level=0.02) risk_free_rate
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:
get_quote
Get the current ticker quote stats.
Returns:
dict
: Dictionary containing current ticker quote stats.
Example:
= ticker.get_quote()
quote print(quote)
{'Symbol': 'AAPL', 'Name': 'Apple Inc.', 'Exchange': 'NasdaqGS', 'Currency': 'USD', 'Timestamp': 1736370002, 'Current Price': 242.7, '24H Volume': 36473385.0, '24H Open': 241.97, '24H High': 243.7123, '24H Low': 240.05, '24H Close': 242.21}
get_summary_stats
Get summary technical and fundamental statistics for the ticker.
Returns:
dict
: Dictionary containing summary statistics.
Example:
= ticker.get_summary_stats()
summary_stats print(summary_stats)
{'Symbol': 'AAPL', 'Name': 'Apple Inc.', 'Exchange': 'NasdaqGS', 'Currency': 'USD', 'Timestamp': 1736370002, 'Current Price': 242.7, '24H Change': 0.20229974, '24H Volume': 36473385.0, '24H Open': 241.97, '24H High': 243.7123, '24H Low': 240.05, '24H Close': 242.21, '52 Week High': 260.1, '52 Week Low': 164.08, '52 Week Change': 0.0, '50 Day Average': 238.6438, '200 Day Average': 215.13354, 'Trailing EPS': 6.09, 'Current EPS': 7.38921, 'Forward EPS': 8.31, 'Trailing P/E': 39.852215, 'Current P/E': 32.84519, 'Forward P/E': 29.205774, 'Dividend Rate': 0.0, 'Dividend Yield': 0.0, 'Book Value': 3.767, 'Price to Book': 64.427925, 'Market Cap': 3668604616704.0, 'Shares Outstanding': 15115799552.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:
= ticker.get_price_history()
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 ┆ 123.768448 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-01-04 ┆ 126.889999 ┆ 128.660004 ┆ 125.080002 ┆ 126.360001 ┆ 8.91136e7 ┆ 125.045036 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-01-05 ┆ 127.129997 ┆ 127.769997 ┆ 124.760002 ┆ 125.019997 ┆ 8.09627e7 ┆ 123.718979 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-01-06 ┆ 126.010002 ┆ 130.289993 ┆ 124.889999 ┆ 129.619995 ┆ 8.77547e7 ┆ 128.271103 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-01-09 ┆ 130.470001 ┆ 133.410004 ┆ 129.889999 ┆ 130.149994 ┆ 7.07908e7 ┆ 128.795593 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ 2023-12-22 ┆ 195.179993 ┆ 195.410004 ┆ 192.970001 ┆ 193.600006 ┆ 3.71228e7 ┆ 192.656174 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-12-26 ┆ 193.610001 ┆ 193.889999 ┆ 192.830002 ┆ 193.050003 ┆ 2.89193e7 ┆ 192.108871 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-12-27 ┆ 192.490005 ┆ 193.5 ┆ 191.089996 ┆ 193.149994 ┆ 4.80877e7 ┆ 192.208359 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-12-28 ┆ 194.139999 ┆ 194.660004 ┆ 193.169998 ┆ 193.580002 ┆ 3.40499e7 ┆ 192.636276 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
│ 2023-12-29 ┆ 193.899994 ┆ 194.399994 ┆ 191.729996 ┆ 192.529999 ┆ 4.26288e7 ┆ 191.591385 │
│ 00:00:00 ┆ ┆ ┆ ┆ ┆ ┆ │
└──────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
get_options_chain
Get the options chain for the ticker.
Returns:
DataFrame
: Polars DataFrame containing the options chain.
Example:
= ticker.get_options_chain()
options_chain print(options_chain)
shape: (1_909, 16)
┌────────────┬───────────┬──────┬────────────┬───┬────────────┬────────────┬───────────┬───────────┐
│ expiration ┆ ttm ┆ type ┆ contractSy ┆ … ┆ contractSi ┆ lastTradeD ┆ impliedVo ┆ inTheMone │
│ --- ┆ --- ┆ --- ┆ mbol ┆ ┆ ze ┆ ate ┆ latility ┆ y │
│ str ┆ f64 ┆ str ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │
│ ┆ ┆ ┆ str ┆ ┆ str ┆ datetime[m ┆ f64 ┆ bool │
│ ┆ ┆ ┆ ┆ ┆ ┆ s] ┆ ┆ │
╞════════════╪═══════════╪══════╪════════════╪═══╪════════════╪════════════╪═══════════╪═══════════╡
│ 2025-01-10 ┆ 0.0 ┆ call ┆ AAPL250110 ┆ … ┆ REGULAR ┆ 2024-12-27 ┆ 4.718754 ┆ true │
│ ┆ ┆ ┆ C00105000 ┆ ┆ ┆ 16:41:06 ┆ ┆ │
│ 2025-01-10 ┆ 0.0 ┆ call ┆ AAPL250110 ┆ … ┆ REGULAR ┆ 2024-11-29 ┆ 10.428226 ┆ true │
│ ┆ ┆ ┆ C00110000 ┆ ┆ ┆ 17:01:29 ┆ ┆ │
│ 2025-01-10 ┆ 0.0 ┆ call ┆ AAPL250110 ┆ … ┆ REGULAR ┆ 2025-01-02 ┆ 4.242192 ┆ true │
│ ┆ ┆ ┆ C00115000 ┆ ┆ ┆ 17:37:35 ┆ ┆ │
│ 2025-01-10 ┆ 0.0 ┆ call ┆ AAPL250110 ┆ … ┆ REGULAR ┆ 2024-12-27 ┆ 4.589848 ┆ true │
│ ┆ ┆ ┆ C00120000 ┆ ┆ ┆ 16:29:00 ┆ ┆ │
│ 2025-01-10 ┆ 0.0 ┆ call ┆ AAPL250110 ┆ … ┆ REGULAR ┆ 2024-12-27 ┆ 4.539067 ┆ true │
│ ┆ ┆ ┆ C00125000 ┆ ┆ ┆ 17:03:06 ┆ ┆ │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ 2027-01-15 ┆ 24.145861 ┆ put ┆ AAPL270115 ┆ … ┆ REGULAR ┆ 2024-12-10 ┆ 0.215248 ┆ true │
│ ┆ ┆ ┆ P00400000 ┆ ┆ ┆ 14:30:05 ┆ ┆ │
│ 2027-01-15 ┆ 24.145861 ┆ put ┆ AAPL270115 ┆ … ┆ REGULAR ┆ 2024-12-10 ┆ 0.223213 ┆ true │
│ ┆ ┆ ┆ P00410000 ┆ ┆ ┆ 14:30:05 ┆ ┆ │
│ 2027-01-15 ┆ 24.145861 ┆ put ┆ AAPL270115 ┆ … ┆ REGULAR ┆ 2024-11-14 ┆ 0.00001 ┆ true │
│ ┆ ┆ ┆ P00430000 ┆ ┆ ┆ 16:22:45 ┆ ┆ │
│ 2027-01-15 ┆ 24.145861 ┆ put ┆ AAPL270115 ┆ … ┆ REGULAR ┆ 2025-01-07 ┆ 0.245552 ┆ true │
│ ┆ ┆ ┆ P00440000 ┆ ┆ ┆ 14:47:08 ┆ ┆ │
│ 2027-01-15 ┆ 24.145861 ┆ put ┆ AAPL270115 ┆ … ┆ REGULAR ┆ 2025-01-02 ┆ 0.252571 ┆ true │
│ ┆ ┆ ┆ P00450000 ┆ ┆ ┆ 18:38:36 ┆ ┆ │
└────────────┴───────────┴──────┴────────────┴───┴────────────┴────────────┴───────────┴───────────┘
get_news
Get the historical news headlines for the given ticker.
Returns:
DataFrame
: Polars DataFrame containing news headlines.
Example:
= ticker.get_news()
news print(news)
shape: (2_304, 5)
┌────────────────┬─────────────────────┬────────────────────┬────────────────────┬─────────────────┐
│ Published Date ┆ Source ┆ Title ┆ Link ┆ Sentiment Score │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ datetime[ms] ┆ str ┆ str ┆ str ┆ f64 │
╞════════════════╪═════════════════════╪════════════════════╪════════════════════╪═════════════════╡
│ 2023-01-03 ┆ Reuters ┆ Apple's stock ┆ <a href="https://n ┆ 0.33995 │
│ 08:00:00 ┆ ┆ market value fal… ┆ ews.google.c… ┆ │
│ 2023-01-03 ┆ Al Jazeera English ┆ Apple’s market ┆ <a href="https://n ┆ 0.33995 │
│ 08:00:00 ┆ ┆ value drops bel… ┆ ews.google.c… ┆ │
│ 2023-01-04 ┆ The Guardian ┆ Death of the ┆ <a href="https://n ┆ -0.622427 │
│ 08:00:00 ┆ ┆ narrator? Apple u… ┆ ews.google.c… ┆ │
│ 2023-01-03 ┆ Financial Times ┆ Apple’s market ┆ <a href="https://n ┆ 0.33995 │
│ 08:00:00 ┆ ┆ value falls bel… ┆ ews.google.c… ┆ │
│ 2023-01-04 ┆ Bloomberg ┆ Apple’s (AAPL) ┆ <a href="https://n ┆ -0.70956 │
│ 08:00:00 ┆ ┆ Stock Is Losing… ┆ ews.google.c… ┆ │
│ … ┆ … ┆ … ┆ … ┆ … │
│ 2023-12-31 ┆ Mint ┆ 5 things to know ┆ <a href="https://n ┆ 0.0 │
│ 08:00:00 ┆ ┆ about US stoc… ┆ ews.google.c… ┆ │
│ 2023-12-31 ┆ Analytics Insight ┆ Apple’s Innovation ┆ <a href="https://n ┆ 0.381819 │
│ 08:00:00 ┆ ┆ Journey: Ke… ┆ ews.google.c… ┆ │
│ 2023-12-30 ┆ Business Standard ┆ Billionaire ┆ <a href="https://n ┆ 0.0 │
│ 08:00:00 ┆ ┆ Gustavo Cisneros, ┆ ews.google.c… ┆ │
│ ┆ ┆ … ┆ ┆ │
│ 2024-01-01 ┆ Readly ┆ Beginner’s guide ┆ <a href="https://n ┆ 0.0 │
│ 08:00:00 ┆ ┆ to the health… ┆ ews.google.c… ┆ │
│ 2024-01-01 ┆ AppleInsider ┆ Save up to $150 on ┆ <a href="https://n ┆ 0.493915 │
│ 08:00:00 ┆ ┆ Apple's iPa… ┆ ews.google.c… ┆ │
└────────────────┴─────────────────────┴────────────────────┴────────────────────┴─────────────────┘
get_income_statement
Get the Income Statement for the ticker.
Parameters:
frequency
(str): frequency of the Income Statement (annual, quarterly).
Returns:
DataFrame
: Polars DataFrame containing the Income Statement.
Example:
= ticker.get_income_statement(frequency="quarterly")
income_statement print(income_statement)
shape: (13, 6)
┌──────────────────────────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ Items ┆ 2023Q3 ┆ 2023Q4 ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪═══════════╡
│ Revenue ┆ 8.9498e10 ┆ 1.1958e11 ┆ 9.0753e10 ┆ 8.5777e10 ┆ 9.4930e10 │
│ Cost of Goods Sold ┆ 4.9071e10 ┆ 6.4720e10 ┆ 4.8482e10 ┆ 4.6099e10 ┆ 5.1051e10 │
│ Gross Profit ┆ 4.0427e10 ┆ 5.4855e10 ┆ 4.2271e10 ┆ 3.9678e10 ┆ 4.3879e10 │
│ Operating Expenses ┆ 1.3458e10 ┆ 1.4482e10 ┆ 1.4371e10 ┆ 1.4326e10 ┆ 1.4288e10 │
│ EBITDA ┆ 3.0653e10 ┆ 4.3221e10 ┆ 3.0736e10 ┆ 2.8202e10 ┆ 3.2502e10 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Interest Expense ┆ 1.0020e9 ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │
│ Income Tax Expense ┆ 4.0420e9 ┆ 6.4070e9 ┆ 4.4220e9 ┆ 4.0460e9 ┆ 1.4874e10 │
│ Net Income ┆ 2.2956e10 ┆ 3.3916e10 ┆ 2.3636e10 ┆ 2.1448e10 ┆ 1.4736e10 │
│ Earnings per Share - Basic ┆ 1.47 ┆ 2.19 ┆ 1.53 ┆ 1.4 ┆ 0.97 │
│ Earnings per Share - Diluted ┆ 1.46 ┆ 2.18 ┆ 1.53 ┆ 1.4 ┆ 0.97 │
└──────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┘
get_balance_sheet
Get the Balance Sheet for the ticker.
Parameters:
frequency
(str): frequency of the Balance Sheet (annual, quarterly).
Returns:
DataFrame
: Polars DataFrame containing the Balance Sheet.
Example:
= ticker.get_balance_sheet(frequency="quarterly")
balance_sheet print(balance_sheet)
shape: (21, 6)
┌──────────────────────────────┬───────────┬───────────┬───────────┬───────────┬────────────┐
│ Items ┆ 2023Q3 ┆ 2023Q4 ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞══════════════════════════════╪═══════════╪═══════════╪═══════════╪═══════════╪════════════╡
│ Cash and Cash Equivalents ┆ 2.9965e10 ┆ 4.0760e10 ┆ 3.2695e10 ┆ 2.5565e10 ┆ 2.9943e10 │
│ Accounts Receivable ┆ 2.9508e10 ┆ 2.3194e10 ┆ 2.1837e10 ┆ 2.2795e10 ┆ 3.3410e10 │
│ Inventories ┆ 6.3310e9 ┆ 6.5110e9 ┆ 6.2320e9 ┆ 6.1650e9 ┆ 7.2860e9 │
│ Other Current Assets ┆ 1.4695e10 ┆ 1.3979e10 ┆ 1.3884e10 ┆ 1.4297e10 ┆ 1.4287e10 │
│ Total Current Assets ┆ 1.4357e11 ┆ 1.4369e11 ┆ 1.2842e11 ┆ 1.2544e11 ┆ 1.5299e11 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Total Liabilities ┆ 2.9044e11 ┆ 2.7941e11 ┆ 2.6322e11 ┆ 2.6490e11 ┆ 3.0803e11 │
│ Common Stock ┆ 7.3812e10 ┆ 7.5236e10 ┆ 7.8815e10 ┆ 7.9850e10 ┆ 8.3276e10 │
│ Retained Earnings ┆ -2.1400e8 ┆ 8.2420e9 ┆ 4.3390e9 ┆ -4.7260e9 ┆ -1.9154e10 │
│ Total Equity ┆ 6.2146e10 ┆ 7.4100e10 ┆ 7.4194e10 ┆ 6.6708e10 ┆ 5.6950e10 │
│ Total Liabilities and Equity ┆ 6.2146e10 ┆ 7.4100e10 ┆ 7.4194e10 ┆ 6.6708e10 ┆ 5.6950e10 │
└──────────────────────────────┴───────────┴───────────┴───────────┴───────────┴────────────┘
get_cashflow_statement
Get the Cashflow Statement for the ticker.
Parameters:
frequency
(str): frequency of the Cashflow Statement (annual, quarterly).
Returns:
DataFrame
: Polars DataFrame containing the Cashflow Statement.
Example:
= ticker.get_cashflow_statement(frequency="quarterly")
cashflow_statement print(cashflow_statement)
shape: (26, 6)
┌─────────────────────────────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ Items ┆ 2023Q3 ┆ 2023Q4 ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════════════╪════════════╪════════════╪════════════╪════════════╪════════════╡
│ Net Income from Continuing Ope… ┆ 2.2956e10 ┆ 3.3916e10 ┆ 2.3636e10 ┆ 2.1448e10 ┆ 1.4736e10 │
│ Depreciation, Amortization, an… ┆ 2.6530e9 ┆ 2.8480e9 ┆ 2.8360e9 ┆ 2.8500e9 ┆ 2.9110e9 │
│ Stock-Based Compensation ┆ 2.6250e9 ┆ 2.9970e9 ┆ 2.9640e9 ┆ 2.8690e9 ┆ 2.8580e9 │
│ Changes in Working Capital ┆ -6.0600e9 ┆ 1.1230e9 ┆ -5.7640e9 ┆ 1.6840e9 ┆ 6.6080e9 │
│ Cash Flow from Continuing Oper… ┆ 2.1598e10 ┆ 3.9895e10 ┆ 2.2690e10 ┆ 2.8858e10 ┆ 2.6811e10 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Operating Cash Flow ┆ 2.1598e10 ┆ 3.9895e10 ┆ 2.2690e10 ┆ 2.8858e10 ┆ 2.6811e10 │
│ Investing Cash Flow ┆ 2.3940e9 ┆ 1.9270e9 ┆ -3.1000e8 ┆ -1.2700e8 ┆ 1.4450e9 │
│ Financing Cash Flow ┆ -2.3153e10 ┆ -3.0585e10 ┆ -3.0433e10 ┆ -3.6017e10 ┆ -2.4948e10 │
│ Ending Cash Position ┆ 3.0737e10 ┆ 4.1974e10 ┆ 3.3921e10 ┆ 2.6635e10 ┆ 2.9943e10 │
│ Free Cash Flow ┆ 1.9435e10 ┆ 3.7503e10 ┆ 2.0694e10 ┆ 2.6707e10 ┆ 2.3903e10 │
└─────────────────────────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
get_financial_ratios
Get the Financial Ratios for the ticker.
Parameters:
frequency
(str): frequency of the Financial Ratios (annual, quarterly).
Returns:
DataFrame
: Polars DataFrame containing the Financial Ratios.
Example:
= ticker.get_financial_ratios(frequency="quarterly")
financial_ratios print(financial_ratios)
shape: (21, 6)
┌─────────────────────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ Items ┆ 2023Q3 ┆ 2023Q4 ┆ 2024Q1 ┆ 2024Q2 ┆ 2024Q3 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════════════════╪══════════╪══════════╪══════════╪══════════╪══════════╡
│ Gross Profit Margin ┆ 0.451708 ┆ 0.45875 ┆ 0.465781 ┆ 0.462572 ┆ 0.462225 │
│ Operating Profit Margin ┆ 0.312856 ┆ 0.337637 ┆ 0.307428 ┆ 0.295557 ┆ 0.311714 │
│ Net Profit Margin ┆ 0.256497 ┆ 0.283638 ┆ 0.260443 ┆ 0.250044 ┆ 0.15523 │
│ Return on Assets ┆ 0.065108 ┆ 0.09594 ┆ 0.070051 ┆ 0.064678 ┆ 0.040375 │
│ Return on Equity ┆ 0.369388 ┆ 0.457706 ┆ 0.31857 ┆ 0.321521 ┆ 0.258753 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ Price to Earnings ┆ 6.857771 ┆ 4.988442 ┆ 7.024243 ┆ 7.129056 ┆ 9.683768 │
│ Price to Book ┆ 2.53318 ┆ 2.283239 ┆ 2.237715 ┆ 2.292139 ┆ 2.505707 │
│ Price to Sales ┆ 1.759 ┆ 1.414911 ┆ 1.829416 ┆ 1.782576 ┆ 1.503213 │
│ Price to Cashflow ┆ 7.288962 ┆ 4.240832 ┆ 7.3171 ┆ 5.298496 ┆ 5.322442 │
│ Price to Free Cashflow ┆ 8.10018 ┆ 4.511319 ┆ 8.022857 ┆ 5.725241 ┆ 5.969962 │
└─────────────────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
volatility_surface
Computes the implied volatility surface for the ticker options chain.
Returns:
DataFrame
: Polars DataFrame containing the implied volatility surface.
Example:
= ticker.volatility_surface()
volatility_surface print(volatility_surface)
shape: (66, 11)
┌────────┬──────────┬──────────┬──────────┬───┬──────────┬──────────┬──────────┬──────────┐
│ strike ┆ 3.19M ┆ 5.29M ┆ 6.21M ┆ … ┆ 12.19M ┆ 17.21M ┆ 23.23M ┆ 24.15M │
│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │
│ f64 ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞════════╪══════════╪══════════╪══════════╪═══╪══════════╪══════════╪══════════╪══════════╡
│ 100.0 ┆ 0.641318 ┆ 0.576543 ┆ 0.475029 ┆ … ┆ 0.442158 ┆ 0.400586 ┆ 0.366869 ┆ 0.364573 │
│ 105.0 ┆ 0.641318 ┆ 0.557207 ┆ 0.475029 ┆ … ┆ 0.428623 ┆ 0.390555 ┆ 0.357926 ┆ 0.354784 │
│ 110.0 ┆ 0.641318 ┆ 0.546572 ┆ 0.475029 ┆ … ┆ 0.415934 ┆ 0.364694 ┆ 0.351038 ┆ 0.34717 │
│ 115.0 ┆ 0.643735 ┆ 0.520952 ┆ 0.475029 ┆ … ┆ 0.401915 ┆ 0.356718 ┆ 0.333273 ┆ 0.33853 │
│ 120.0 ┆ 0.590078 ┆ 0.498716 ┆ 0.475029 ┆ … ┆ 0.387051 ┆ 0.357684 ┆ 0.334965 ┆ 0.329889 │
│ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │
│ 310.0 ┆ 0.228496 ┆ 0.220883 ┆ 0.22046 ┆ … ┆ 0.227862 ┆ 0.244584 ┆ 0.243648 ┆ 0.244614 │
│ 315.0 ┆ 0.242515 ┆ 0.222514 ┆ 0.231155 ┆ … ┆ 0.227967 ┆ 0.245362 ┆ 0.243867 ┆ 0.242756 │
│ 320.0 ┆ 0.239614 ┆ 0.224146 ┆ 0.226683 ┆ … ┆ 0.228073 ┆ 0.24614 ┆ 0.244086 ┆ 0.240898 │
│ 325.0 ┆ 0.246865 ┆ 0.227469 ┆ 0.224025 ┆ … ┆ 0.228043 ┆ 0.243028 ┆ 0.242424 ┆ 0.239622 │
│ 330.0 ┆ 0.250732 ┆ 0.230792 ┆ 0.22475 ┆ … ┆ 0.228013 ┆ 0.239916 ┆ 0.240762 ┆ 0.238345 │
└────────┴──────────┴──────────┴──────────┴───┴──────────┴──────────┴──────────┴──────────┘
performance_stats
Compute the performance statistics for the ticker.
Returns:
dict
: Dictionary containing performance statistics.
Example:
= ticker.performance_stats()
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.18275880020995097, 'Daily Volatility': 1.2520208167929032, 'Total Return': 54.79824476726207, 'Annualized Return': 58.42828411295602, 'Annualized Volatility': 19.875214305059902, 'Alpha': 0.004679085878397896, 'Beta': 0.47675527844626747, 'Sharpe Ratio': 2.8391283357679473, 'Sortino Ratio': 4.602295224026221, 'Active Return': 25.745022485784364, 'Active Risk': 13.742885671742904, 'Information Ratio': 1.8733345456492705, 'Calmar Ratio': 3.7562229976482917, 'Maximum Drawdown': 15.555062665219022, 'Value at Risk': -1.725372938133524, 'Expected Shortfall': -2.5631187071765393, 'Security Prices': shape: (250,)
Series: '' [f64]
[
123.768448
125.045036
123.718979
128.271103
128.795593
…
192.656174
192.108871
192.208359
192.636276
191.591385
], 'Security Returns': shape: (250,)
Series: '' [f64]
[
0.0
1.031433
-1.060464
3.679406
0.408892
…
-0.55475
-0.284082
0.051787
0.222632
-0.542417
], 'Benchmark Returns': shape: (250,)
Series: '' [f64]
[
0.0
0.753897
-1.164553
2.284078
-0.076763
…
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:
= ticker.performance_chart()
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:
= ticker.candlestick_chart()
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:
= ticker.news_sentiment_chart()
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:
= ticker.options_chart(chart_type="surface")
options_chart options_chart.show()
report
Generate a report for the ticker.
Parameters:
report_type
(str): Type of report to generate (performance, financials, options, news_sentiment).
Example:
="performance") ticker.report(report_type