Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -292,23 +292,23 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(), title="Bullish Minds AI - Stock
|
|
| 292 |
chart_output = gr.HTML(get_tradingview_embed("AAPL"))
|
| 293 |
with gr.TabItem("🎓 Lessons"):
|
| 294 |
with gr.Tabs():
|
| 295 |
-
with gr.TabItem("Lesson 1:
|
| 296 |
-
gr.Markdown(
|
| 297 |
-
"
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
#### Why this matters
|
| 301 |
Before you place any trade, it helps to know where your order goes and who it interacts with. Understanding market venues explains why a fill is fast or slow, why prices “jump,” and why a limit order protects you.
|
| 302 |
-
|
| 303 |
-
|
|
|
|
| 304 |
By the end of this lesson, you will be able to:
|
| 305 |
- Define exchanges, dark pools (ATS), auction markets, and dealer markets.
|
| 306 |
- Explain how orders interact on a central limit order book versus with a dealer/market maker.
|
| 307 |
- Describe what happens during opening/closing auctions and why they matter.
|
| 308 |
- List pros/cons of lit exchanges and dark pools for typical retail traders.
|
| 309 |
- Choose a suitable order type (market vs. limit) based on venue dynamics.
|
| 310 |
-
|
| 311 |
-
|
|
|
|
| 312 |
- **Exchange (lit venue):** A registered marketplace where bids/offers are displayed ("lit") and orders match by rules (e.g., price–time priority).
|
| 313 |
- **Central Limit Order Book (CLOB):** The public queue of buy/sell limit orders at each price.
|
| 314 |
- **NBBO:** National Best Bid and Offer; the best quoted prices across exchanges (US concept).
|
|
@@ -318,14 +318,148 @@ By the end of this lesson, you will be able to:
|
|
| 318 |
- **Dark pool / ATS:** Alternative Trading System where quotes are not displayed; orders often execute at or within NBBO.
|
| 319 |
- **Price improvement:** Getting a better price than the displayed NBBO.
|
| 320 |
- **Slippage:** Getting a worse execution price than expected due to fast moves or thin liquidity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
|
| 322 |
-
|
| 323 |
-
[...scroll for more: Big picture, scenarios, review, glossary ...]
|
| 324 |
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
with gr.Tabs():
|
| 330 |
with gr.TabItem("Order Book Simulator"):
|
| 331 |
lesson1_order = gr.Interface(
|
|
@@ -335,11 +469,11 @@ By the end of this lesson, you will be able to:
|
|
| 335 |
gr.Dropdown(["Market", "Limit"], label="Order Type"),
|
| 336 |
gr.Number(value=100.00, label="Order Price (for limit)"),
|
| 337 |
gr.Slider(1, 100, value=10, step=1, label="Order Size"),
|
| 338 |
-
gr.Number(value=123, label="Seed (optional, for replay)")
|
| 339 |
],
|
| 340 |
outputs=[
|
| 341 |
gr.Dataframe(label="Order Book (randomized)"),
|
| 342 |
-
gr.Textbox(label="Result / Fill Message")
|
| 343 |
],
|
| 344 |
live=False,
|
| 345 |
allow_flagging="never"
|
|
@@ -350,16 +484,131 @@ By the end of this lesson, you will be able to:
|
|
| 350 |
inputs=[
|
| 351 |
gr.Dropdown(["Buy", "Sell"], label="Order Side"),
|
| 352 |
gr.Slider(1, 300, value=50, step=1, label="Order Size"),
|
| 353 |
-
gr.Number(value=123, label="Seed (for repeatability)")
|
| 354 |
],
|
| 355 |
outputs=[
|
| 356 |
gr.Textbox(label="Estimate"),
|
| 357 |
-
gr.Dataframe(label="Fill breakdown")
|
| 358 |
],
|
| 359 |
live=False,
|
| 360 |
allow_flagging="never"
|
| 361 |
)
|
| 362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
|
| 364 |
gr.Markdown("""
|
| 365 |
---
|
|
|
|
| 292 |
chart_output = gr.HTML(get_tradingview_embed("AAPL"))
|
| 293 |
with gr.TabItem("🎓 Lessons"):
|
| 294 |
with gr.Tabs():
|
| 295 |
+
with gr.TabItem("Lesson 1: Market Venues Explained"):
|
| 296 |
+
gr.Markdown("## Lesson 1 — Market Venues: Exchanges, Dark Pools, Auction vs. Dealer Markets")
|
| 297 |
+
with gr.Accordion("Why this matters", open=True):
|
| 298 |
+
gr.Markdown("""
|
|
|
|
|
|
|
| 299 |
Before you place any trade, it helps to know where your order goes and who it interacts with. Understanding market venues explains why a fill is fast or slow, why prices “jump,” and why a limit order protects you.
|
| 300 |
+
""")
|
| 301 |
+
with gr.Accordion("Learning objectives", open=False):
|
| 302 |
+
gr.Markdown("""
|
| 303 |
By the end of this lesson, you will be able to:
|
| 304 |
- Define exchanges, dark pools (ATS), auction markets, and dealer markets.
|
| 305 |
- Explain how orders interact on a central limit order book versus with a dealer/market maker.
|
| 306 |
- Describe what happens during opening/closing auctions and why they matter.
|
| 307 |
- List pros/cons of lit exchanges and dark pools for typical retail traders.
|
| 308 |
- Choose a suitable order type (market vs. limit) based on venue dynamics.
|
| 309 |
+
""")
|
| 310 |
+
with gr.Accordion("Key terms (quick definitions)", open=False):
|
| 311 |
+
gr.Markdown("""
|
| 312 |
- **Exchange (lit venue):** A registered marketplace where bids/offers are displayed ("lit") and orders match by rules (e.g., price–time priority).
|
| 313 |
- **Central Limit Order Book (CLOB):** The public queue of buy/sell limit orders at each price.
|
| 314 |
- **NBBO:** National Best Bid and Offer; the best quoted prices across exchanges (US concept).
|
|
|
|
| 318 |
- **Dark pool / ATS:** Alternative Trading System where quotes are not displayed; orders often execute at or within NBBO.
|
| 319 |
- **Price improvement:** Getting a better price than the displayed NBBO.
|
| 320 |
- **Slippage:** Getting a worse execution price than expected due to fast moves or thin liquidity.
|
| 321 |
+
""")
|
| 322 |
+
with gr.Accordion("1) Big picture: Where can your order go?", open=False):
|
| 323 |
+
gr.Markdown("""
|
| 324 |
+
Your broker’s smart order router can send your order to:
|
| 325 |
+
- Lit exchanges (NYSE, Nasdaq, Cboe, IEX, etc.) — orders join the public book.
|
| 326 |
+
- Wholesalers/internalizers (dealer firms handling retail flow) — they fill against their inventory/quotes.
|
| 327 |
+
- Dark pools (ATS) — non‑displayed venues where orders may match at midpoint or within the spread.
|
| 328 |
|
| 329 |
+
You → Broker/Router → { Lit Exchange | Wholesaler/Dealer | Dark Pool }
|
|
|
|
| 330 |
|
| 331 |
+
Each path has trade‑offs in speed, price improvement, and transparency.
|
| 332 |
+
""")
|
| 333 |
+
with gr.Accordion("2) Exchanges (lit venues)", open=False):
|
| 334 |
+
gr.Markdown("""
|
| 335 |
+
What they are: Regulated marketplaces that publish quotes and trades. Orders line up on a public order book.
|
| 336 |
+
|
| 337 |
+
How matching works (simplified):
|
| 338 |
+
- Price–time priority: Best price first; earlier orders at the same price are ahead in the queue.
|
| 339 |
+
- Market orders cross the spread to fill immediately; limit orders wait in the book until hit/lifted.
|
| 340 |
+
|
| 341 |
+
**Auctions on exchanges:**
|
| 342 |
+
- Opening auction sets the first regular‑hours price by crossing all eligible orders at a single price.
|
| 343 |
+
- Closing auction sets the official closing price, often with large institutional volume.
|
| 344 |
+
- Benefits: concentrated liquidity, reduced slippage at the cross; transparent reference prices.
|
| 345 |
+
|
| 346 |
+
**Examples (conceptual):**
|
| 347 |
+
- NYSE is a hybrid: electronic CLOB plus designated market makers (DMMs) overseeing auctions.
|
| 348 |
+
- Nasdaq uses multiple market makers and an electronic book; it also runs opening/closing crosses.
|
| 349 |
+
|
| 350 |
+
**Pros for retail:**
|
| 351 |
+
- Transparent quotes (you can see the book’s top levels via Level I/II).
|
| 352 |
+
- Strong price discovery; reference prices (open/close) are widely used.
|
| 353 |
+
|
| 354 |
+
**Cons:**
|
| 355 |
+
- Quoted spreads can widen during news or at the open; fills may be partial if your limit is too tight.
|
| 356 |
+
""")
|
| 357 |
+
with gr.Accordion("3) Dark pools (ATS)", open=False):
|
| 358 |
+
gr.Markdown("""
|
| 359 |
+
What they are: Electronic venues where orders are not displayed. Often match at midpoint (between bid and ask) or within the spread.
|
| 360 |
+
|
| 361 |
+
Why they exist:
|
| 362 |
+
- Reduce market impact for larger orders (institutions don’t reveal hand).
|
| 363 |
+
- Offer potential price improvement vs. the displayed NBBO.
|
| 364 |
+
|
| 365 |
+
How they work (simplified):
|
| 366 |
+
- Orders reference the NBBO from lit exchanges but do not show size/price publicly.
|
| 367 |
+
- Your order may match passively (you rest and wait) or actively (you interact with liquidity inside).
|
| 368 |
+
|
| 369 |
+
**Pros:**
|
| 370 |
+
- Possible price improvement; lower signaling.
|
| 371 |
+
|
| 372 |
+
**Cons:**
|
| 373 |
+
- Less transparency; potential adverse selection (you trade when price is about to move against you).
|
| 374 |
+
- Limited size for thin names; not all orders get matched quickly.
|
| 375 |
+
|
| 376 |
+
**Myth buster:** “Dark” ≠ illegal. These are regulated ATS venues; they’re simply non‑displayed.
|
| 377 |
+
""")
|
| 378 |
+
with gr.Accordion("4) Auction vs. Dealer markets (and today’s hybrid reality)", open=False):
|
| 379 |
+
gr.Markdown("""
|
| 380 |
+
Auction market (concept):
|
| 381 |
+
- Price emerges from buyers and sellers competing on a book (continuous double auction).
|
| 382 |
+
- Open/close auctions are batch auctions that cross many orders at one price.
|
| 383 |
+
|
| 384 |
+
Dealer market (concept):
|
| 385 |
+
- Dealers/market makers post bid/ask and stand ready to trade from their inventory.
|
| 386 |
+
- Execution is against the dealer’s quote; multiple dealers may compete.
|
| 387 |
+
|
| 388 |
+
Hybrid reality:
|
| 389 |
+
- Modern US equities combine both: electronic order books and market makers. Nasdaq is dealer‑heavy with an order book; NYSE is auction‑centric with DMMs.
|
| 390 |
+
|
| 391 |
+
Why you care:
|
| 392 |
+
- In dealer interactions, you may see price improvement and fast fills; on auctions/books, you can seek transparent price with tighter control via limits.
|
| 393 |
+
""")
|
| 394 |
+
with gr.Accordion("5) Routing, best execution, and your order type", open=False):
|
| 395 |
+
gr.Markdown("""
|
| 396 |
+
Brokers must seek best execution (price, speed, likelihood of fill, etc.).
|
| 397 |
+
|
| 398 |
+
- Market orders aim for immediate fill but can be exposed to slippage in fast moves.
|
| 399 |
+
- Limit orders set a maximum buy or minimum sell price, protecting you from surprise fills.
|
| 400 |
+
|
| 401 |
+
For thin or volatile names, prefer limits; around the open/close, consider participating in auctions or waiting a few minutes for spreads to normalize.
|
| 402 |
+
""")
|
| 403 |
+
with gr.Accordion("6) Practical tips (beginner‑friendly)", open=False):
|
| 404 |
+
gr.Markdown("""
|
| 405 |
+
- Use limit orders by default for single‑name stocks, especially at the open.
|
| 406 |
+
- If placing larger orders, consider slicing (several smaller limits) to reduce impact.
|
| 407 |
+
- Avoid chasing during halts/news spikes; liquidity can vanish and spreads widen.
|
| 408 |
+
- For end‑of‑day execution, the closing auction can offer fair, liquid prices.
|
| 409 |
+
""")
|
| 410 |
+
with gr.Accordion("7) Mini‑scenarios (choose one answer)", open=False):
|
| 411 |
+
gr.Markdown("""
|
| 412 |
+
You want 200 shares, the spread is wide, and the stock is jumping around. Best choice?
|
| 413 |
+
A) Market buy now
|
| 414 |
+
B) Place a limit buy near the mid or a level you’re happy with
|
| 415 |
+
|
| 416 |
+
You need the official benchmark price for a fund’s daily report. Which event?
|
| 417 |
+
A) Closing auction
|
| 418 |
+
B) First midpoint fill you see
|
| 419 |
+
|
| 420 |
+
Which venue hides quotes but can provide price improvement?
|
| 421 |
+
A) Lit exchange
|
| 422 |
+
B) Dark pool (ATS)
|
| 423 |
+
|
| 424 |
+
In which model do market makers quote and trade against you from inventory?
|
| 425 |
+
A) Auction market
|
| 426 |
+
B) Dealer market
|
| 427 |
+
|
| 428 |
+
You dislike surprises in fast markets. Which order type reduces risk of a bad fill?
|
| 429 |
+
A) Market order
|
| 430 |
+
B) Limit order
|
| 431 |
+
""")
|
| 432 |
+
with gr.Accordion("8) Review checklist", open=False):
|
| 433 |
+
gr.Markdown("""
|
| 434 |
+
I can explain the difference between lit exchanges and dark pools.
|
| 435 |
+
I know what NBBO means and why it matters.
|
| 436 |
+
I understand auction vs. dealer markets and today’s hybrid reality.
|
| 437 |
+
I can choose between market and limit orders based on conditions.
|
| 438 |
+
I know when opening/closing auctions might be useful.
|
| 439 |
+
""")
|
| 440 |
+
with gr.Accordion("9) App‑integration hooks", open=False):
|
| 441 |
+
gr.Markdown("""
|
| 442 |
+
Interactive: Order Book Simulator (queue position, partial fills); Auction Replay (open/close cross).
|
| 443 |
+
Calculator: Slippage estimator (expected fill vs. NBBO); Limit‑vs‑Market decision helper.
|
| 444 |
+
Checklist widget: “Before you submit an order” (spread, volatility, venue notes).
|
| 445 |
+
Glossary popovers: NBBO, CLOB, dealer, DMM, adverse selection.
|
| 446 |
+
""")
|
| 447 |
+
with gr.Accordion("10) Glossary (recap)", open=False):
|
| 448 |
+
gr.Markdown("""
|
| 449 |
+
CLOB: Central public queue of limit orders on an exchange.
|
| 450 |
+
Dealer/MM: Firm quoting bid/ask and trading from inventory.
|
| 451 |
+
Auction: Batch or continuous matching based on order interaction.
|
| 452 |
+
Dark pool/ATS: Non‑displayed matching venue, often at NBBO/midpoint.
|
| 453 |
+
NBBO: Best national bid and offer across exchanges.
|
| 454 |
+
Price improvement: Better execution than the displayed best price.
|
| 455 |
+
Slippage: Fill worse than expected due to movement/liquidity.
|
| 456 |
""")
|
| 457 |
+
with gr.Accordion("11) What’s next", open=False):
|
| 458 |
+
gr.Markdown("""
|
| 459 |
+
Proceed to Lesson 2: Order Types Deep Dive (market, limit, stop, stop‑limit, trailing, OCO), then Lesson 3: Reading the Tape (Level I/II, Time & Sales).
|
| 460 |
+
""")
|
| 461 |
+
gr.Markdown("---")
|
| 462 |
+
gr.Markdown("*Try the tools below to visualize order book mechanics and slippage:*")
|
| 463 |
with gr.Tabs():
|
| 464 |
with gr.TabItem("Order Book Simulator"):
|
| 465 |
lesson1_order = gr.Interface(
|
|
|
|
| 469 |
gr.Dropdown(["Market", "Limit"], label="Order Type"),
|
| 470 |
gr.Number(value=100.00, label="Order Price (for limit)"),
|
| 471 |
gr.Slider(1, 100, value=10, step=1, label="Order Size"),
|
| 472 |
+
gr.Number(value=123, label="Seed (optional, for replay)")
|
| 473 |
],
|
| 474 |
outputs=[
|
| 475 |
gr.Dataframe(label="Order Book (randomized)"),
|
| 476 |
+
gr.Textbox(label="Result / Fill Message")
|
| 477 |
],
|
| 478 |
live=False,
|
| 479 |
allow_flagging="never"
|
|
|
|
| 484 |
inputs=[
|
| 485 |
gr.Dropdown(["Buy", "Sell"], label="Order Side"),
|
| 486 |
gr.Slider(1, 300, value=50, step=1, label="Order Size"),
|
| 487 |
+
gr.Number(value=123, label="Seed (for repeatability)")
|
| 488 |
],
|
| 489 |
outputs=[
|
| 490 |
gr.Textbox(label="Estimate"),
|
| 491 |
+
gr.Dataframe(label="Fill breakdown")
|
| 492 |
],
|
| 493 |
live=False,
|
| 494 |
allow_flagging="never"
|
| 495 |
)
|
| 496 |
+
with gr.TabItem("Lesson 2: Tickers, Floats, Market Cap, Sectors, Indices"):
|
| 497 |
+
gr.Markdown("## Lesson 2 — Tickers, Floats, Market Cap, Sectors, Indices")
|
| 498 |
+
with gr.Accordion("Overview", open=True):
|
| 499 |
+
gr.Markdown("""
|
| 500 |
+
This lesson explains what stock tickers are, how share float affects trading, how to compute and interpret market capitalization, how sectors organize the market, and how indices track groups of companies. Simple formulas and examples are included for day-to-day use.
|
| 501 |
+
""")
|
| 502 |
+
with gr.Accordion("Tickers", open=False):
|
| 503 |
+
gr.Markdown("""
|
| 504 |
+
A **ticker** is the short symbol used to identify a publicly traded company on an exchange (e.g. `AAPL` for Apple). Each exchange manages unique symbols, and finance apps use tickers to retrieve data.
|
| 505 |
+
Tickers link directly to price, news, filings, and company fundamentals.
|
| 506 |
+
|
| 507 |
+
**Quick checks:**
|
| 508 |
+
- Confirm the exchange if companies share similar symbols (e.g., US vs. international).
|
| 509 |
+
- Use the ticker consistently in screeners, EDGAR filings, and news searches.
|
| 510 |
+
""")
|
| 511 |
+
with gr.Accordion("Float (Floating Shares)", open=False):
|
| 512 |
+
gr.Markdown(r"""
|
| 513 |
+
**Definition:**
|
| 514 |
+
Float = Shares Outstanding − Restricted or Insider Shares
|
| 515 |
+
|
| 516 |
+
Low float means fewer shares actively trade, which boosts volatility. High float dampens price swings.
|
| 517 |
+
|
| 518 |
+
**Why float matters:**
|
| 519 |
+
- **Liquidity:** Higher float usually narrows the bid-ask spread; low float can cause sharp jumps.
|
| 520 |
+
- **Corporate actions:** Buybacks, splits, and insider sales alter float and trading dynamics.
|
| 521 |
+
|
| 522 |
+
**Example:**
|
| 523 |
+
Company has 20M outstanding shares, 5M are insider-restricted.
|
| 524 |
+
Float = 20M − 5M = **15M** shares.
|
| 525 |
+
""")
|
| 526 |
+
with gr.Accordion("Market Capitalization", open=False):
|
| 527 |
+
gr.Markdown(r"""
|
| 528 |
+
**Definition:**
|
| 529 |
+
Market Cap = Share Price × Shares Outstanding
|
| 530 |
+
|
| 531 |
+
Market cap reflects the total equity value of a company.
|
| 532 |
+
|
| 533 |
+
**Size buckets:**
|
| 534 |
+
- Micro-cap: < $250M
|
| 535 |
+
- Small-cap: $250M – $2B
|
| 536 |
+
- Mid-cap: $2B – $10B
|
| 537 |
+
- Large-cap: $10B – $200B
|
| 538 |
+
- Mega-cap: > $200B
|
| 539 |
+
(Cutoffs may vary).
|
| 540 |
+
|
| 541 |
+
**Example:**
|
| 542 |
+
Company trades at $20 with 5M shares outstanding.
|
| 543 |
+
Market cap = $20 × 5,000,000 = **$100M** (small-cap).
|
| 544 |
+
""")
|
| 545 |
+
with gr.Accordion("Sectors", open=False):
|
| 546 |
+
gr.Markdown("""
|
| 547 |
+
**Sectors** are broad industry groups (e.g., Information Technology, Health Care, Financials) used by analysts and index providers.
|
| 548 |
+
Grouping by sector makes it easier to benchmark companies and build portfolios.
|
| 549 |
+
|
| 550 |
+
**Tips:**
|
| 551 |
+
- Analyze peers within the same sector for meaningful comparisons.
|
| 552 |
+
- Sector rotation strategies try to overweight sectors based on macro trends.
|
| 553 |
+
""")
|
| 554 |
+
with gr.Accordion("Indices", open=False):
|
| 555 |
+
gr.Markdown("""
|
| 556 |
+
An **index** tracks the performance of a basket of stocks (e.g., S&P 500, Dow Jones, Nasdaq-100, Russell 2000).
|
| 557 |
+
|
| 558 |
+
**Weighting methods:**
|
| 559 |
+
- **Market-cap-weighted:** Larger companies have more influence.
|
| 560 |
+
- **Equal-weighted:** All companies have the same weight.
|
| 561 |
+
- **Price-weighted:** High-priced stocks move the index more.
|
| 562 |
+
|
| 563 |
+
**Why indices matter:**
|
| 564 |
+
- **Benchmarks:** Used to compare portfolio returns.
|
| 565 |
+
- **Access:** Index funds/ETFs enable diversified investing.
|
| 566 |
+
""")
|
| 567 |
+
with gr.Accordion("Putting It Together", open=False):
|
| 568 |
+
gr.Markdown("""
|
| 569 |
+
- **Ticker →** the unique handle that links all research and trading data.
|
| 570 |
+
- **Float →** governs real trading volume, volatility, and liquidity.
|
| 571 |
+
- **Market Cap →** frames company size, growth, and risk.
|
| 572 |
+
- **Sectors →** context for analyzing peers and market cycles.
|
| 573 |
+
- **Indices →** anchor performance and guide diversified investing.
|
| 574 |
+
""")
|
| 575 |
+
with gr.Accordion("Mini-Formulas and Examples", open=False):
|
| 576 |
+
gr.Markdown(r"""
|
| 577 |
+
**Float:**
|
| 578 |
+
\( \text{Float} = \text{Outstanding} - \text{Restricted} \)
|
| 579 |
+
Example: \( 10M - 3M = 7M \) tradable shares.
|
| 580 |
+
|
| 581 |
+
**Market Cap:**
|
| 582 |
+
\( \text{Cap} = P \times N \)
|
| 583 |
+
Example: \( \$50 \times 5,000,000 = \$250M \) (micro/small-cap).
|
| 584 |
+
|
| 585 |
+
**Index weight (market-cap):**
|
| 586 |
+
\( \text{Weight} = \frac{\text{Company Cap}}{\text{Index Cap}} \)
|
| 587 |
+
""")
|
| 588 |
+
with gr.Accordion("Red Flags and Pro Tips", open=False):
|
| 589 |
+
gr.Markdown("""
|
| 590 |
+
- Low float stocks can swing wildly on news or social buzz—use limit orders!
|
| 591 |
+
- Don’t compare companies on share price alone—market cap tells true size.
|
| 592 |
+
- Match your benchmark index’s strategy and market cap to your investment style.
|
| 593 |
+
""")
|
| 594 |
+
with gr.Accordion("Quick Quiz", open=False):
|
| 595 |
+
gr.Markdown("""
|
| 596 |
+
**Q:** Company has 50M shares outstanding; 15M are restricted. What’s the float?
|
| 597 |
+
**A:** 35M
|
| 598 |
+
|
| 599 |
+
**Q:** Share price is $25; outstanding shares are 80M. Market cap?
|
| 600 |
+
**A:** $25 × 80M = $2B (mid-cap)
|
| 601 |
+
|
| 602 |
+
**Q:** Why might two companies with the same share price be different sizes?
|
| 603 |
+
**A:** Because number of outstanding shares differs—changing market cap.
|
| 604 |
+
|
| 605 |
+
**Q:** Name a reason sector classification is useful.
|
| 606 |
+
**A:** Peer comparison, sector ETFs.
|
| 607 |
+
|
| 608 |
+
**Q:** In a market-cap-weighted index, what do bigger companies mean?
|
| 609 |
+
**A:** They carry more weight—move the index more.
|
| 610 |
+
""")
|
| 611 |
+
# Add future lessons here as new gr.TabItem("Lesson X: ...")
|
| 612 |
|
| 613 |
gr.Markdown("""
|
| 614 |
---
|