Sub topic 1
Whole Shares Versus Fractional Shares
Prerequisites
This chapter assumes you know what a share of stock is, can calculate a simple average and a percentage, and understand what an ETF or index fund is at a basic level. A brokerage account helps you follow along but is not required.
Whole shares and fractional shares
A whole share is one complete unit of a stock. Traditionally, you could buy only whole units, so a stock priced at $300 needed at least $300 to buy one share. A fractional share is a part of one unit, such as 0.25 of a share.
How brokers provide fractional shares
Brokers typically buy whole shares in bulk and track each customer's fractional portion in their own records. When you buy 0.5 shares, the broker buys whole shares in the market and allocates the fractions to accounts. Rules vary by firm. Some brokers offer fractional trading only for certain stocks or certain account types.
Investing by dollar amount: orders and rounding
A dollar-based order specifies how much to spend, not how many shares to buy. The broker converts the dollar amount into shares at the executed price and rounds to a fixed number of decimal places. The filled quantity can therefore be slightly less than the amount you intended. Check your broker's precision rules before relying on exact figures.
from decimal import Decimal, ROUND_DOWN
amount = Decimal("50.00")
price = Decimal("300.00")
shares = (amount / price).quantize(Decimal("0.000001"), rounding=ROUND_DOWN)
print(shares)
# 0.166666What dollar-cost averaging is
Dollar-cost averaging (DCA) is a method of investing the same dollar amount at regular intervals, regardless of price. Because the dollar amount stays fixed, you buy more shares when the price is low and fewer when it is high.
Your average cost per share equals total dollars invested divided by total shares bought. It is not the simple average of the prices. Suppose you invest $100 at each of five prices: $50, $40, $25, $40, and $50. You buy 2, 2.5, 4, 2.5, and 2 shares, for 13 shares in total. You spend $500, so your average cost is about $38.46. The simple average price is $41, which is higher.
Exercise
You invest $100 each month for four months. The price is $20 in months 1 and 2, and $80 in months 3 and 4. What is your average cost per share?
Show answer
You buy 5 + 5 + 1.25 + 1.25 = 12.5 shares for $400 total. The average cost is $400 / 12.5 = $32 per share.