Short answer

For a buy, double the difference between the execution price and the relevant quote midpoint. For a sell, double the midpoint minus the execution price. Apply the same quote timing and unit when comparing trades.

Match the quote to the execution comparison

Record side, fill price, size, market session and the quote timestamp used by the methodology. A quote from minutes later can create a meaningless comparison. Compare like orders and aggregate with consistent size weights if you receive multiple fills. The half-spread figure is the one-way execution difference from the midpoint, while the doubled measure is used for effective-spread comparisons. Study fill rate and speed separately when comparing brokers because a low spread tells you little about an order that did not fill.

Worked example or comparison
Basis Evidence or calculation
Worked example or comparison Illustration. Bid $19.98 and ask $20.02 give a $20.00 midpoint. A buy at $20.01 is one cent above midpoint, so effective spread is $0.02 per share.

Frequently asked question

Can an effective spread be negative?

Yes, an execution better than the reference midpoint can produce a negative result under the signed formula.

Source

Primary reference · sec.gov

Related guide

Commission-free trading costs: calculate FX, spread and recurring fees