What is the spread: Explained simply
9 minute read
The spread exists on any trading chart. Whether you’re a discretionary trader or a robot developer, to get things right you need a natural understanding of what the spread is. To not understand what it is, is as bad as trying to hand over one dollar for a new iPhone at the Apple Store cashier without seeing its $1,000 price tag – that’s just awkward. Today in this article, we’ll explain the spread in a simple way.
Let’s first see how the spread usually looks on a chart:
The current price of a stock (or thing) always has 2 lines near it: the bid line and the ask line, separated by a gap. This situation is referred to as the spread. The size of the gap is the size of the spread.
This means that the current price of a stock (or thing) is always truly represented by two prices: a bid price and an ask price.
To make things look simpler, charts only plot one price – usually the average (i.e. the midpoint of the gap, or mid-market price) or the bid price (like MT4 and MT5 charts), depending on industry norms. It’s also one of the most important feeds of information in the finance world that’s been completely deleted from the layman’s view, but we’ll get into that another time. For now, know that in terms of truth, which single price to anchor the chart’s plot at, is an arbitrary choice. For now, the big bright lightbulb to see here is that in reality there are always two prices that describe the value of any item on the market – which is the phenomenon referred to as the spread.
A natural phenomenon
The spread is a natural phenomenon. Let’s take a step back, forget the jargon, and look at what happens when we buy and sell things in this world.
There’s no single price of a thing on the market – there are always two prices: a price that you’d be willing to buy it for (your bidding price), and the price that the seller would be willing to sell it for (their asking price). There’s a gap between these two requests (the spread size). If both of you find a way to close the gap, by either you meeting their asking price, or they meeting your bidding price, then a trade happens (i.e. they take your money, and you take their goods, and you both go home).
For example, an iPhone for sale for $1,000 means that the asking price by Apple is $1,000. If your budget is $800, then your bidding price is $800. There’s a gap between what you both want – no trade happens unless someone budges. That’s why in reality the price of an iPhone for sale on the market is represented by two prices and there’s a spread. The only difference in this retail scenario, versus trading charts, is that in the consumer market the shops set the price tags so the asking price rarely fluctuates and they just wait for us to meet their asking price. But we still have our bid level in mind, which represents our budget or willing buying price; we won’t buy until we eventually cave in and decide to accept the retailer’s price tag. Whereas in the stock market, sellers can fluidly bring prices down to meet individual bids.
Now, staying on the iPhone example for a second, if you wanted to Google a chart of past iPhone prices, it’s intuitive to think that the chart should have a line at, say, $700, then move up to $800, then move up to $900, then to $1000, and so on, representing the iPhone price tag at the Apple Store over time. If the chart looks like this, then such a chart is plotting the ask side of the spread for iPhones, because it shows us the history of Apple’s asking price tag. But the chart could also be drawn in the way a lot of currency charts are (e.g. MT4 and MT5), which is to plot the bid price. If so, in the iPhone scenario the line would be messier and show $450, $250, $650, and so on, with all random numbers representing buyers’ budgets. Both lines have their relevance, because the first version tells us what Apple sets the iPhone price tag at, and the second version tells us the buyers’ sentiment – this kind of chart could be relevant to Apple itself if it wanted to monitor what buyers are willing to pay. So both charts have their relevance depending on the trading purpose.
There’s always a gap
The spread always has a gap, because buyers always want it for less, and sellers always ask for more. Once they meet at a single price, there’s a trade, so even though the spread theoretically becomes 0 for an instant, this closing of the gap isn’t visible, because instantly after the trade occurs, the spread must widen again to represent the negotiations on the remaining stock that’s still up on the market for sale.
That is, if you take your stock home and never want to sell it again because you want to eat it, that’s not relevant to anyone in the economy anymore, so it isn’t represented, it’s just taken off the market. If you instantly want to resell your stock after buying it, you’re putting it back on the market and you’d set your price tag higher than what you bought it for in hopes for a profit, and therefore there’s always a spread gap for what’s on market. There’s always a gap, and if not, there’s a bug in that market’s representation.
For example, once you decide to meet Apple’s demands and pay $1,000, at the very moment that you hand them the money and they hand you the iPhone, the spread technically has a 0 gap with your bid and their ask both at $1,000. But since you take the iPhone home and it’s not on the market of new iPhones anymore, it’s gone from the playing field. The spread represents the value of things still on the market for sale, so it widens again instantaneously to represent the remaining stock in the Apple Store: an asking price of $1,000 by Apple, and a bid price at $700 representing the next potential customer’s wishful budget of $700, still hanging around in the Apple Store deciding if they should fork out an extra $300 or not to close the spread gap.
The river between us
A spread doesn’t just exist on trading charts. A spread exists in any area of exchange in life, where one person would want to have a thing, and another person would want to give that thing, and both need to meet in agreement. The phenomenon of the spread can’t be removed from trading, because it’s a natural occurrence in life.
So you see, the spread is like a river between You and I. It represents the conditions that we each have for the other to gain our resources. Every time a trade occurs between You and I, a bridge is built across the river and resources are exchanged. But we each still have remaining resources to negotiate on, and that’s why the river still exists.
In more professional applications that chart trading activity, this river analogy is not far from the truth of what you might see – you don’t see a line representing a single price, but rather, you see a river which is the spread, and the bridges are where trades happen. But since trades are instantaneous, you don’t see the infinitesimally thin bridges that represent instances in time of trade, so the spread gap is generally never 0 to the naked eyes.
What’s more, the river widens and narrows, giving us tell-tale signs about the relationship between buyers and sellers. It’s not far from the truth to say that a large river means those lands are distant in expectations and won’t build a bridge very often.
Trading algorithms: Seeing the real price tag
As a trading robot developer, why do you need to understand the spread? Because, at the very minimum, code that executes buys and sells need to state the price at which you’re buying or selling. To do this, you usually refer to one of the sides of the spread. You also often need to measure profitability, and if you use the wrong price to do it, that’s a bug.
For example, you need to know that a Market Buy order executes on the ask side of the spread, and a Market Sell order executes on the bid side. When closing a Buy position, it executes on the bid side, and when closing a Sell position, it executes on the ask side. What about Take Profit lines, Stop Loss lines, Limit and Stop orders, and so on? On which side of the spread does each operation execute, for all these types of transactions? How do you remember all of this?
Stop using code templates, and gain a natural understanding by remembering it the easy way: When we buy something, we buy it at the seller’s asking price. When we sell something, we sell it at a buyer’s bidding price. ‘Closing’ an order is just selling-back a Buy you made, or buying-back a Sell you made.
So for example, when closing an order, think about what type of order it is. If it’s a Buy order, it means you bought stuff, and so now to ‘close’ it you have to sell it back to buyers at their bidding price. Conversely, if it’s a Sell order, it means you ‘sold’ stuff at the beginning (a virtual type of selling, which we won’t get into right now), and so to ‘close’ it you have to buy it back from the market from sellers at their asking price.
This thought process will tell you how your orders close at Take Profit and Stop Loss lines too. To hit Take Profit or Stop Loss means you want to close your position when the market meets your price. Realize whether you’re buying-back or selling-back to the market, and this will tell you which side of the spread needs to hit your Take Profit or Stop Loss level in order for the position to close.
Use the relevant side: The bid side represents prices that the market wants to buy things at, so you can sell things back at this price; the ask side represents prices that the market wants to sell things at, so you can buy things back at this price. If you use the wrong side of the spread, it’s a bug; in algorithmic analysis the mistake will pass by silently in the code, but with order requests the broker will luckily respond with a hard rejection.
The invisible chart
The previous section explains why when you hit “Buy” on the MT4 or MT5 platform, the order buys at a price that’s higher than the line or candle on the trading chart. That’s because the line or candle only shows the bid price, and to buy something means to buy it at the ask line of the market, which isn’t plotted. That’s why it’s vitally important to enable the ask line so that you see it by default on these platforms.
This brings us to the realization that there’s a whole feed of ask prices that’s vitally important info, which has been made invisible to most people. And the fact that this feed is invisible can mislead you about your buying and selling power in history.
In other words, there really should be two candles at every bar on the chart. That’s because once you buy a stock, you buy it at one side of the spread of prices. Instantaneously, you’re trying to sell it back to the market, and so you really need to assess the trend of the other side of the spread. But that’s hidden.
For example, if you were thinking about buying an iPhone, you would look at the trend of iPhone sellers’ prices (the ask prices). Once you buy one, you want to sell it back to the market. At this time, you would want to look at the trend of iPhone buyers’ sentiments (the bid prices). Yet, we only see one side of the market on charts. Isn’t that interesting?
Robots can help
If you learn a little coding, you’d be empowered to make simple assistive tech to help you watch the spread. Although there are limits to what we can do based on the data the industry provides, and the nature of the invisible ask feed, a robot can still watch the chart faster than we can, store a running memory of what it has seen, check the spread before opening an order, and perform accurate calculations like remembering how to measure entry-to-exit distances properly by using the correct sides of the spread.
The ways the spread plays into trading, and how to handle it, is beyond the scope of this article and the developer domain. But what you should take away from this article is that the spread is a natural phenomenon that can’t be changed.
Now as a developer, if a client asks you why something executes in the blank space above a candle, you know that it’s because of the spread. And, you know that it can’t be “made to execute on the candle instead”, because that’s not how market mechanics work.
As a developer, you also know how to precisely measure how many points a position has gained, not by using candles, but by using the proper side of the spread depending on whether the stock would be sold back to the market or bought back from the market.
For long term set-and-forget strategies that aim for huge gains or losses, traders can get away with not precisely understanding the spread. But developers always need to be precise with this, even when programming a simple EA.
The more a strategy zooms in on the small scale at the scalping level, where tiny profits are scraped at high frequency, the more the spread starts to impact economic indicators and profit calculations.