Stock Calculations for Beginners: How to Calculate Profit and Average Cost

What You Need to Know First

To calculate your average stock cost, divide the total amount you paid by the total number of shares you bought. When you buy in several batches at different prices, the result is a weighted average, not the simple average of the prices. Profit per share is the selling price minus that average, and total profit is that figure times the number of shares. Commission and VAT apply when you buy and again when you sell.

What you wantFormula
Average cost per shareTotal amount paid ÷ total number of shares
Break-even priceTotal cost including buying fees ÷ (shares × (1 minus the selling fee rate))
Profit or loss in SARNet sale proceeds minus total cost
Profit or loss in %Profit or loss ÷ total cost × 100

The examples use generic numbers, not named stocks, and nothing here is a recommendation to buy any share.

How Do You Calculate the Average Cost of a Share Bought in Batches?

Suppose you bought the same stock three times. Log each purchase in a table and multiply shares by price to get the amount for each.

PurchaseSharesPrice (SAR)Amount (SAR)
First10050.005,000
Second15044.006,600
Third5056.002,800
Total300Average 48.0014,400

To find the average price per share, add the amounts to get SAR 14,400, add the shares to get 300, then divide 14,400 ÷ 300. The average cost is SAR 48.00 per share.

A common mistake is to add the three prices and divide by three. That gives SAR 50.00, which is wrong because you bought more shares at the lower price. The second purchase (150 shares at SAR 44.00) carries the most weight, which pulls the true average down.

How Much Do Commission and VAT Add to a Trade?

The Capital Market Authority (CMA) sets a ceiling of 0.155% of trade value on commission for listed shares, paid by both the buyer and the seller. The ceiling splits into 0.105% for the brokerage firm and 0.05% for the CMA and the Saudi Exchange. It is a maximum, so a broker may charge less. VAT of 15% applies to the commission, not to the trade value, and Argaam reports that the CMA’s share of the commission (3.2 basis points) is not subject to VAT. To keep the arithmetic simple, our examples apply 15% to the whole commission, which slightly overstates the cost.

Trade value (SAR)Commission at the 0.155% capVAT at 15% on commissionTotal cost per transaction
1,0001.550.231.78
10,00015.502.3317.83
50,00077.5011.6389.13

The CMA also cancelled the fixed minimum commission, so the percentage applies to every trade however small.

How Do You Calculate the Break-Even Price Including Commission?

The break-even price is the selling price at which you recover everything you paid, including buying and selling fees. Returning to our example, we apply the cap plus VAT to each purchase (0.155% × 1.15 = 0.17825%).

PurchaseAmount (SAR)Commission + VAT (SAR)Total (SAR)
First5,000.008.915,008.91
Second6,600.0011.766,611.76
Third2,800.004.992,804.99
Total14,400.0025.6614,425.66

With fees, the average cost per share becomes 14,425.66 ÷ 300 = SAR 48.09 instead of 48.00. For the break-even price, divide 14,425.66 by 300 shares times (1 minus 0.0017825), which gives about SAR 48.18. The price has to rise above 48.18, not just 48.00, before you are in profit.

How Do You Calculate Stock Profit in SAR and in Percent?

To calculate profit or loss, assume you sell all 300 shares at SAR 55.00. Sale proceeds before fees are 300 × 55 = SAR 16,500.

ItemWithout feesAt the cap plus VAT
Total purchase cost14,400.0014,425.66
Sale proceeds16,500.0016,500.00
Selling fees (commission 25.58 + VAT 3.84)0.0029.42
Net sale proceeds16,500.0016,470.58
Profit in SAR2,100.002,044.92
Profit in %14.58%14.18%

Fees take SAR 55.08 in total (25.66 on buying and 29.42 on selling) and pull the return down from 14.58% to 14.18%. Had you sold at SAR 45.00 instead, proceeds before fees would be SAR 13,500, a loss of SAR 900 (6.25%) with no fees. After SAR 24.07 in selling fees and the full purchase cost, the loss is SAR 949.73, or 6.58% of total cost. Fees widen a loss just as they shrink a gain.

What Changes If the Broker Waives Its Share of the Commission?

Derayah’s prices and fees schedule lists zero commission on Saudi stocks and Nomu, with regulatory fees still applying. The CMA’s split puts the 0.05% regulatory part outside the broker’s 0.105% share, so it remains even when the broker charges nothing. The fees page does not state that rate or how VAT applies to it, so we use 0.05% without VAT here. Confirm the exact figure with your broker.

Item (same example)At the cap plus VATRegulatory share only, 0.05%
Buying fees (SAR)25.667.20
Selling fees (SAR)29.428.25
Break-even price (SAR)48.1848.05
Profit in SAR2,044.922,084.55
Profit in %14.18%14.47%

The difference here is only SAR 39.63, but it grows with trade size and with how often you trade.

Can a Stock Calculator Replace the Manual Method?

You can build your own stock average calculator without special software. A simple spreadsheet works: put shares in column A and price in column B, make column C the product of the two, and divide the sum of C by the sum of A to get the average cost. Add a row for each new purchase and the average updates itself. To start trading Saudi stocks, you can open a trading account with Derayah Financial. If you use a stock calculator from your broker or a finance site, check that it computes the weighted average and says whether it includes commission and VAT.

For more on what to look for in a trading app, read our guide to choosing a trading platform.

How Do You Calculate Return on Investment?

The ROI formula is simple: (final value minus amount invested) ÷ amount invested × 100. If you invest SAR 20,000 and the investment becomes worth SAR 22,300, ROI is 2,300 ÷ 20,000 × 100 = 11.5%. In our earlier examples, it equals the profit as a percentage of cost. ROI ignores time: 11.5% in two months is very different from 11.5% over five years, so always state the holding period when you compare two investments.

Does Averaging Down Reduce Your Loss?

Averaging down means buying more shares after the price falls, to lower your average cost. Suppose you bought 100 shares at SAR 50.00 (SAR 5,000), the price dropped to SAR 40.00, and you bought another 100 (SAR 4,000). Your average is now 9,000 ÷ 200 = SAR 45.00, so the price only needs to recover to 45.00 for you to break even, not 50.00.

Market price (SAR)Before the extra purchase (100 shares)After the extra purchase (200 shares)
50.00Break-even (0)Profit 1,000 (11.11%)
45.00Loss 500 (10.00%)Break-even (0)
30.00Loss 2,000 (40.00%)Loss 3,000 (33.33%)

The table also shows the downside. If the stock keeps falling to SAR 30.00, your loss in riyals rises by half (from 2,000 to 3,000) because you put more money into the same stock, even though the percentage looks smaller. Before averaging down, ask yourself: would I buy this stock today if I did not already own it? And am I comfortable with it becoming a larger part of my portfolio? The SEC’s guidance on diversification says that holding everything in one investment exposes your whole portfolio to its losses, and that diversification does not prevent losses when markets fall.

How Do You Calculate US Stocks in USD with Fractional Shares?

The method is the same, only in dollars and with fractions of a share. Derayah Global offers US and global stocks across 46 markets, and its page mentions fractional shares and zero commission on US stocks and ETFs in the Lite account. The example below uses made-up numbers and assumes no commission.

TransactionAmount (USD)Share price (USD)Quantity
First buy2004000.5 share
Second buy1503000.5 share
Total350Average 3501.0 share

The average cost is 350 ÷ 1.0 = USD 350 per share. If you sell the whole share at USD 380, your profit is USD 30, or 30 ÷ 350 × 100 = 8.57%. The result in riyals depends on the exchange rate on the day you convert. The SEC’s bulletin on fractional shares notes that execution varies by broker, and that some firms charge extra fees or restrict transfers to another broker, so read your account terms first.

Frequently Asked Questions

Does my average cost change after I sell part of my shares?

No. A partial sale leaves the average cost of the remaining shares unchanged, and only the realized profit changes with the quantity sold. If you sold 100 shares from the first example at SAR 55.00 without fees, your realized profit is SAR 700 (100 × 7.00), and the 200 remaining shares still average SAR 48.00.

What is the difference between realized and unrealized profit?

Unrealized profit is the gap between the current price and your average cost while you still hold the shares. It becomes realized only when you sell, and fees then reduce it.

Do cash dividends change the average cost per share?

No. Dividends are cash income separate from your purchase price and do not change your average cost. Add them to the final value when you calculate ROI.

Should I calculate the average for my whole portfolio or for each stock?

For each stock separately. Average cost is specific to one company, and blending different stocks into one number tells you nothing useful. For the whole portfolio, calculate the total amount invested and its current value, then apply the ROI formula.

Why does the average cost in my app differ from my own calculation?

There are three common reasons: fees included in or left out of the average, the way fractions are rounded, and free shares being counted at a price of zero. Compare your account statement with your table line by line.

This content is educational and is not investment advice. The examples use made-up numbers. Investing in stocks involves risk, and you may lose part of your capital.

Sources