Free lesson · Trading different assets
Stocks and ETFs: shares, dividends, shorting and fund structure
Open interactive lessonPractice calculationsExplore labs
Start with the idea
Buying a share gives you a claim on a company or fund vehicle. Your return combines price changes with distributions, while the broker handles the trade and settlement records.
Symbols, units & horizon
- Π: long-position profit in dollars over the holding period
- q: number of shares, nonnegative here
- P_0,P_1: entry and exit dollars per share
- D: cash distributions per share received during the period
- C: total dollar trading and financing costs
- model: no changing share count during this example
When and why to use this
Use a share-level total-return ledger for equity or ETF signals and compare it with the adjusted-data return series.
For a stock, distinguish company fundamentals from the mechanics of holding its shares. A long position pays for shares and may receive dividends. A short sale borrows shares to sell and later buys them back; borrow charges, recalls and payments in lieu of distributions belong in its economics. A stock split changes share count and per-share price, not wealth by itself.
An ETF trades as shares during its trading session, but its portfolio can hold stocks, bonds, futures or other exposures. Inspect what the fund actually holds, its expenses, distributions and tracking behavior. Market price can differ from per-share net asset value. Buying a commodity-linked fund does not necessarily buy a warehouse claim on the commodity.
Choose a liquid order type appropriate to the task: a market order prioritizes execution, whereas a limit order constrains price and may not fill. Respect auction and session rules. For backtests, separate tradeable unadjusted prices from return series adjusted for distributions and splits; avoid double-counting dividends.
A useful research progression is a total-return benchmark, then a simple signal with point-in-time membership, delistings and corporate actions handled. Only add machine learning after those records reconcile.
Stocks and ETFs: shares, dividends, shorting and fund structure
- Entry cash outflow is qP₀ and exit cash inflow is qP₁.
- Add qD for distributions actually received.
- Subtract the outflow and all costs: qP₁+qD−qP₀−C=q(P₁−P₀+D)−C.
Ten shares bought at $50, sold at $53, with $.50 per share distributions and $2 total costs produce 10×(3+.5)−2=$33.
Apply it in a strategy
- Read the security or fund exposure and corporate-action records.
- Specify share quantities, sessions, borrow needs and order behavior.
- Reconcile price changes and distributions before researching momentum, value, factors or relative value.
Research deliverable
Reconcile one long equity trade and list the extra cash flows required for a short trade.
Mechanics & research · reviewed 12 September 2026
Official educational material checked 12 September 2026. These examples use hypothetical prices and costs. Check the actual product specification, broker terms, venue calendar and jurisdiction before building an instrument adapter. ETF exposure, intraday trading and NAV differences checked.
Further reading: Investor.gov · Exchange-Traded Funds ↗
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
def share_profit(shares,entry,exit,distribution,cost):
if shares<0 or min(entry,exit,cost)<0: raise ValueError("Long-only teaching inputs required")
return shares*(exit-entry+distribution)-cost
print(share_profit(10,50,53,.5,2))Continue learning
Trading Different Assets: Instruments, Mechanics & Risk — all lessons- Start with the instrument: exposure, ownership and obligations
- Stocks and ETFs: shares, dividends, shorting and fund structure
- Bonds and bills: lending, accrued interest and settlement cash
- Futures: multipliers, ticks, margin and expiry
- Commodities: spot goods, storage and the futures curve
- Foreign exchange: two currencies, one quote and financing
- Options: rights, premiums, exercise and nonlinear exposure
- Spot crypto: tokens, venues, wallets and execution
- Crypto perpetuals: funding, mark prices and liquidation
- Event contracts: resolution rules and probability-priced exposure
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations