RoboForex – Professional services on Forex market

How the price of a financial instrument is formed: demand, supply and Bid/Ask

You click the Buy button and see how the price instantly changes — but where does the platform even get this number from? Who decides that EURUSD is worth exactly that much, and not otherwise, and why can the price on one account momentarily differ from the price on another? The entire market is behind these issues: the bids of buyers and sellers, the glass of bids, market makers and liquidity flows. Let's analyze the price of a financial instrument in parts: how does an equilibrium price arise from supply and demand, how does a Bid differ from an Ask, how the price is formed on the stock exchange and at an over-the-counter broker, how ticks turn into candles, and how all this affects the real outcome of a transaction in MetaTrader 5.

What is the price of a financial instrument

The price of a financial instrument is the result of the coincidence of supply and demand at a particular time. This is not a property of the graph or a constant embedded in the platform. The price exists only because some market participants are willing to buy an asset at one rate, while others are willing to sell it at another, and at some point these interests meet.

Several important consequences follow from this definition:

  • the price is constantly changing, because the ratio of those willing to buy and sell is constantly changing;
  • at any moment, there is not one price on the market, but a range from the best purchase price to the best sale price;
  • the price does not reflect "fair value", but the balance of interests here and now;
  • any transaction is possible only when the buyer's desire and the seller's desire coincide in price and volume;
  • the more participants and volumes there are, the denser and more stable the price.

It is useful to immediately separate price from related concepts. The quote is the published value of the best buy and sell prices that the trader sees. The transaction price is the price at which a particular order was actually executed. They are related, but not identical, and it is from this difference that the spread and slippage grow. Before delving into the mechanics, it is worth refreshing the general context of the market in the material What is Forex, and here we will analyze exactly how the price is born.

Supply and demand: the point of equilibrium

The basic model is simple. Demand is a set of desires to buy: the lower the price, the more willing there are. An offer is a set of desires to sell: the higher the price, the more willing there are to sell. At the intersection of these two interests, a equilibrium price arises — one at which the volume of those who want to buy approximately coincides with the volume of those who want to sell.

In the real market, this model does not work in a vacuum, but as a continuous auction. The price is not "calculated by a formula" — it is discovered in the process when the flow of buyers' requests collides with the flow of sellers' requests. A new large buyer shifts the balance up, a large seller moves down, and together they make the price constantly move.

EventWhat happens to the balanceHow price reacts
Demand is growing (more buyers) Preponderance on the buying side The balance is shifting upward
The supply is growing (more sellers) The advantage is on the selling side The balance is shifting downward
Supply and demand are equal Balance of power The price fluctuates in a narrow range
Simultaneous surge both there and there Fighting for levels Volatility is growing

Hence the key point that is important to understand: it is not the chart itself that moves the price, but the imbalance between the flow of purchases and sales. If there are more people willing to buy than sell, sellers raise their prices, and the new level is fixed as the new market price. All technical indicators only describe the trace of this process, not its cause.

Supply and demand in the market: how the equilibrium price of an instrument is determined

Requests from buyers and sellers

Equilibrium is the result, and its "building material" is the usual orders. Each order contains two important characteristics: the price at which the participant is ready to make a deal, and the volume that he is ready to buy or sell.

There are two types of applications:

  • market — "buy/sell at the best available price right now"; they are executed immediately and consume liquidity from the glass;
  • limit orders — "buy for no more than X / sell for no less than Y"; they stand in line and wait for the price to reach the specified level.

When a market buy order and a limit sell order meet at the same price, the transaction is completed. Each transaction "eats up" part of the volume set, and if the flow of market purchases exceeds the volume of limit sales at the best price, buyers are forced to take the next, higher level. This is how the price moves up step by step. The reverse situation — market sales versus limit purchases — pushes the price down.

Almost all participants are divided into two categories:

CategoryRolePrice impact
Market takers (market orders) They take the liquidity out of the glass They move the price by "eating" the levels
Market makers (limit orders) They put liquidity in a glass Create a "cushion", smooth out the movement

It is important to understand that one large order does not always move the market as much as many small ones. If there is a dense limit "wall" in the way of a large market order, the price will move slightly. If there is little liquidity, even a modest volume can pass dozens of points with almost no resistance.

Bid and Ask: two prices of the same instrument

Every time different orders co-exist on the market, the instrument always has at least two key prices.

Bid is the best price at which participants are willing to buy. For a trader, this is the price at which he can sell the instrument.

Ask is the best price at which participants are willing to sell. For a trader, this is the price at which he can buy a instrument.

The Ask is always higher than the Bid. The difference between them is called the spread — this is the fee for the instantaneous transaction and the main cost for the trader.

Quotation of the instrumentPriceWhat does it mean for a trader
Bid 1.08500 The asset can be sold at this price
Ask 1.08512 You can buy an asset at this price
Spread 1.2 points Transaction entry and exit costs

Why is there a difference at all? Because the buyer and seller have different interests. The buyer would like to buy cheaper, the seller would like to sell more expensive, and their meeting costs money to those who provide liquidity. That is why you see a small disadvantage immediately after entering the transaction: for you, the "zero" result does not come at the entry price, but after passing the price by the amount of the spread.

Glass of bids: Bid, Ask and spread as a result of counter bids

Last transaction price and quotation

One of the most frequent sources of confusion is the identification of the quote and the price of the last transaction. These are different things.

The Last transaction price is the price at which the transaction actually took place. It shows exactly where the buyer and seller met at that moment.

A quote is a pair of the best Bid and Ask prices displayed in a glass. It does not reflect the "last deal", but the intentions of the participants right now.

The conceptWhat showsSpecial Feature
Last transaction price Where was the last real deal It may not change for a long time with a sluggish market
Bid Best purchase price Updated as requests change
Ask Best selling price Always above the Bid
Mid (Mid) (Bid + Ask) / 2 The benchmark of the "average" price of the instrument

The practical meaning of this difference is noticeable on low-liquid instruments and in quiet hours. There, the price of the last transaction may "freeze" because there are simply no transactions, and the Bid and Ask have already shifted following the changed bids. Therefore, the correct benchmark for the current market situation is the actual Bid and Ask, and their mid is often used for analysis.

Market makers and liquidity

The market price could not exist without liquidity — the ability to quickly buy or sell an asset without strongly influencing its price. The main liquidity providers are market makers: banks, brokers, and specialized firms that constantly hold buy and sell orders in a glass.

The market maker earns money on the spread and turnover, and in exchange takes on risks: he is obliged to quote both sides of the market and is ready to execute transactions even when the flow is one-sided. The more market makers there are and the larger their volumes, the denser the liquidity cushion and the more resistant the price is to sharp market orders.

  • High liquidity — narrow spread, smooth movement, execution close to the stated price.
  • Low liquidity — wide spread, ragged movements, risk of slippage.
  • Liquidity is variable — it changes by session, on the news and on holidays, when some participants leave the market.

That is why the same pair behaves differently: during the hours of the intersection of London and New York, liquidity is at its maximum, and at night or on weekends it drops, and the price may move unnaturally sharply on a small volume. A participant who ignores the state of liquidity risks getting a much worse performance than expected.

Tick and minimum price step

The price cannot change arbitrarily: Each instrument has a minimum price step, which is the smallest value it can move by. Each such change is recorded as a tick — a new price value with a timestamp, and in MetaTrader 5 also with information about the volume.

A tick is an atom of market information. Everything else is built from ticks: current quotes, charts, and candlesticks. The differences in the "price" of instruments are largely explained by their pitch: for some pairs it is 0.00001, for others it is 0.001, and for individual instruments it is different.

The conceptMeaningExample
Tick One price update with time and volume Bid changed from 1.08500 to 1.08501
Minimum step (Point) The smallest possible price change 0.00001 for a five-digit pair
Tick volume The amount that has passed in this update Shows activity at a specific moment
Tick frequency How many updates per unit of time Indirect indicator of activity and liquidity

The tick volume deserves special attention. Unlike the exchange volume, which is accurate, the tick volume of an over—the-counter broker is a counter of price changes, not real lots. It is not equal to the "trading volume" in the strict sense, but it shows activity well: when there are many ticks, the market is lively and liquid, when there are few ticks, the movement can be deceptive.

How candlesticks are formed from ticks: the tick flow turns into a candle bar

Price formation on the stock exchange

The exchange's pricing mechanism is as transparent and centralized as possible. All orders are stacked in one glass of orders (order book), where the best prices and volumes at each level are visible. The price is determined by the meeting of bids according to the rules that are the same for all participants.

Key mechanisms of exchange pricing:

  1. Double Auction is a continuous mode where purchase and sale orders are compared in real time, and transactions are completed as prices match.
  2. A glass of orders is an open book reflecting the depth of the market: how much volume is worth at each price level.
  3. Clearing and a central counterparty guarantee the execution of transactions, which increases trust and liquidity.
  4. Opening and closing auctions are separate procedures where the price is set based on the results of accumulated bids.

The main advantage of the exchange is a single price and accurate volume: all participants see the same glass, and the number of transactions and their volumes are fixed unambiguously. This makes the stock data "clean" and understandable for analysis. That is why exchange-traded instruments (stocks, futures, and some ETFs) are valued by traders who want to see real supply and demand.

Over-the-counter broker pricing

The over-the-counter market (Forex, CFD) works differently. There is no single exchange and a single glass here: the price is formed from the flow of quotations that the broker receives from its liquidity providers — banks, market makers and aggregators.

The mechanics look like this:

  1. Liquidity providers (banks and major market makers) publish their Bid/Ask for instruments.
  2. The broker aggregates these flows: collects the best available prices and volumes from multiple sources.
  3. The final quote is generated, which the trader sees in the terminal; it often represents the best price from available sources plus a margin.
  4. Traders' orders are executed at a broker or withdrawn to a liquidity provider, depending on the execution model.
AspectExchangeOver-the-counter broker
Price source A single glass of applications Aggregation of the flow of quotes from suppliers
Single price Yes, for all participants It may vary slightly from broker to broker
Volume Accurate, real Ticked, not always equal to real lots
Transparency High Below; depends on the execution model
Spread Determined by the glass Depends on the broker's liquidity and conditions

Hence, an important practical conclusion: two traders at different brokers may see slightly different quotes on the same instrument, and this is normal, not a "mistake". The price on the over—the-counter market is always the result of aggregation of a specific set of sources, with a specific margin and specific performance conditions.

Over-the-counter broker pricing: aggregating the flow of quotations in MetaTrader 5

What changes the price

Since the price is a balance of supply and demand, it can be moved by any events that change the intentions of the participants. In practice, the main drivers are:

  1. News and macro statistics. Data on the labor market, inflation, GDP and business activity dramatically change expectations and cause a surge in applications.
  2. Central bank rates. A change in the rate or even a hint of it directly affects the attractiveness of the currency and assets.
  3. Actions of major participants. Transactions of institutions and hedge funds are able to move the price regardless of the logic of small players.
  4. Capital flows. The flow of funds between markets and instruments creates steady pressure on the price.
  5. Volume ratio. The preponderance of buyers or sellers at the moment determines the direction of movement.
  6. Trading sessions. The activity of the Asian, European and American sessions is changing both the liquidity and the nature of the movement.

It is important to understand that the price reacts not only to the fact of the event itself, but also to the difference between expectation and reality. If the market was waiting for one thing and got another, the movement can be especially sharp. Therefore, at the time of publication, the spread widens, liquidity temporarily "disappears", and slippage becomes especially likely — this is a direct consequence of the instantaneous struggle of applications.

How candlesticks are formed from ticks

The candle on the chart is not something primary, but the result of the aggregation of ticks over a selected time interval. Each timeframe collects its own set of ticks and "compresses" them into one bar.

The logic of candle construction is as follows:

  • Open — the first price at the beginning of the period (the price of the first tick of the interval);
  • High — the maximum price reached during the period.
  • Low — minimum price for the period.
  • Close — the last price at the end of the period (the price of the last tick);
  • Volume — the number of past ticks (or trades) during the period.

That is why a candle is an average, "compressed" representation of reality. There could be dozens of sharp jumps inside one bar, but you can only see their extreme points on the chart. Hence the consequence: the smaller the timeframe, the closer the chart is to the real tick flow, and vice versa — on the daily chart, a huge volume of movement is packed into one candle.

TimeframeHow many ticks are there in the barWhat the trader sees
M1 A little bit, in detail A lot of "noise" and small movements
H1 Bigger, smoother The main intraday pattern
D1 Very much, in general The overall picture and trends

The practical conclusion is simple: you cannot judge the market only by a "beautiful" candle, without realizing that there is a whole stream of ticks hidden inside it. To enter a trade, professionals often go down to the lower timeframes to see the real structure of the movement, from which the senior candle gathered.

Spread and slippage as a result of the trade

If the market has two prices, the result of the transaction always depends not only on the direction of movement, but also on the costs. The two main ones are spread and slippage.

Spread is the difference between Ask and Bid. You buy by Ask, and close the sale by Bid, so immediately after entering you are in the red by the amount of the spread. To simply go to zero, the price must travel at least this distance in your direction.

Slippage is the difference between the price you expected and the price at which the order was actually executed. It occurs when there is not enough liquidity at the required level: for example, in the news, the price "slips" past your request, and execution is worse.

CostWhen it occursHow does it affect the result
Spread On every trade Immediately creates a slight disadvantage when entering
Slippage When there is a shortage of liquidity, on the news Execution is worse than expected, especially for stop orders
Spread expansion On low liquidity and volatility Dramatically increases the cost of entry and exit

That is why the "ideal" price on the chart and the actual result of the transaction may differ markedly. A trader who considers only the direction of movement and ignores the spread and slippage is faced with "unexplained" losses. This effect is especially important in automated trading, where dozens of trades multiply costs.

Why does the price look unpredictable

The price seems chaotic because it reflects the simultaneous actions of thousands of participants with different goals, information, and horizons. Added to this are costs and heterogeneity of liquidity. The result is a system where the cause of each movement exists, but is not always observable and not always predictable.

What follows from this practically:

  • the price is not "obligated" to move for a reason that is clear to you at a particular moment;
  • past movements do not guarantee a repeat, but they set probabilistic scenarios.
  • costs (spread, commissions, slippage) are a constant component of the result that cannot be ignored;
  • risk management is more important than the accuracy of individual forecasts;
  • stability is achieved not by "price prediction", but by a system of rules and discipline.

This is not a reason to consider the market random. This is a reason to work probabilistically: build scenarios, limit risk, and evaluate the outcome over a long series of trades, rather than one successful or unsuccessful one. Understanding how the price is formed protects you from the illusion of predictability where there is none.

Price and quotes in MQL5

MetaTrader 5 allows you to programmatically receive Bid, Ask, and the latest price, calculate the midpoint and spread, and evaluate market activity by ticks. This is a basic skill for any Expert Advisor who makes decisions based on price. Below is a compact and correct example on MQL5, which solves several tasks at once: it receives current quotes, calculates the spread, the midpoint of the price and the strike price, taking into account the spread, and also returns tick data.


// =============================================================================================== //
// = Get the current quotes of the instrument: Bid, Ask, Last and rate the spread = //
// =============================================================================================== //
void OnStart()
{
MqlTick tick; // a structure that stores the data of the last tick

   // === requesting the last known tick for the current symbol ===
   if(!SymbolInfoTick(_Symbol, tick))
   {
      Print("Couldn't get tick data for ", _Symbol);
      return;
   }

   double bid   = tick.bid; // best purchase price
   double ask = tick.ask; // best selling price
   double last = tick.last; // last transaction price
   double point = SymbolInfoDouble(_Symbol, SYMBOL_POINT); // minimum price step
   int digits = (int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS); // number of quotation marks

   // === spread in points ===
   double spread_points = (point > 0.0) ? (ask - bid) / point : 0.0;

   // === the midpoint of the price between Bid and Ask ===
   double mid = (bid + ask) / 2.0;

   Print(_Symbol,
         " | Bid = ", DoubleToString(bid, digits),
         " | Ask = ", DoubleToString(ask, digits),
         " | Last = ", DoubleToString(last, digits),
         " | Spread = ", DoubleToString(spread_points, 1), " points",
" | Mid =", DoubleToString(mid, digits));
}

// ===

// =============================================================================================== //
// = Calculation of the strike price, taking into account the spread and slippage = //
// =============================================================================================== //
double ExecutionPrice(const string symbol, const bool is_buy, const double slippage_points)
{
MqlTick tick;
   if(!SymbolInfoTick(symbol, tick))
      return 0.0;

   double point = SymbolInfoDouble(symbol, SYMBOL_POINT);
   double slip = slippage_points * point; // margin for price slippage

   // === for purchase we execute by Ask, for sale — by Bid ===
   if(is_buy)
      return tick.ask + slip;

   return tick.bid - slip;
}

// ===

// =============================================================================================== //
// = Market activity by ticks: the more frequent the ticks, the more liquid the market is = //
// =============================================================================================== //
bool IsMarketActive(const string symbol, const int min_ticks)
{
   MqlTick tick;
   if(!SymbolInfoTick(symbol, tick))
      return false;

   // === comparing the number of accumulated ticks with the activity threshold ===
   long tick_count = SymbolInfoInteger(symbol, SYMBOL_TICKS_BOOKDEPTH);
   return (tick_count > 0) ?

 true : (min_ticks <= 0);
}

How the example works. The OnStart() function requests the last tick via SymbolInfoTick() and extracts the Bid, Ask, and price of the last transaction from it, then converts the Ask−Bid difference into points and calculates the midpoint of the Mid price. The ExecutionPrice() function simulates the actual strike price: the purchase is based on Ask with a margin for slippage, the sale is based on Bid with the same margin, which makes the evaluation of the result closer to reality. The IsMarketActive() function serves as an illustration of the approach to activity assessment — a comparison with the threshold at which transactions make sense, because in a "dead" market the price is deceptive and costs are high.

An important limitation: the calculation is based on the current tick and the properties of the symbol, is updated on new data and does not take into account commissions, swaps and a possible sharp spread expansion. In a real Expert Advisor, you should additionally check the free margin, limit the maximum allowable spread and correctly handle slippage. When the rules of the strategy are formalized and the price is taken from the terminal according to a clear algorithm, the logical next step is to turn this into a full—fledged trading robot (Expert Advisor) on MQL5. An educational project MQL Master.

Practical conclusions for a trader

What gives an understanding of how the price is formed in practice:

  1. Realistic performance expectations. You stop being surprised by the initial downside and the difference between the chart price and the deal price.
  2. Liquidity accounting. When choosing the time and tool, you take into account how narrow the spread is and how dense the "cushion" of orders is.
  3. Caution on the news. At the time of publication, you reduce the volume or do not enter at all, realizing the risk of spreading and slippage.
  4. Correct candle reading. You remember that a candle is a collapsed tick flow, and check the structure on the lower timeframes.
  5. Cost-based automation. In the Expert Advisor, you set the spread, commissions, and slippage, not just the entry logic.

It is from these principles that disciplined trading is formed. Understanding the mechanics of price is not the "secret of profit", but the foundation that removes basic mistakes and makes the strategy more honest in relation to real market conditions. For instruments where the price is based on liquidity flows, it is also useful to understand the nature of the instruments themselves, for example, in the material What is a CFD, which shows how the price of a CFD contract differs from the price of the underlying asset.

Risks and caveats

Understanding price formation does not eliminate market risk and does not guarantee results. The price can move against your position quickly and for no apparent reason, and costs can gradually "eat up" profits even from a formally correct strategy.

  • The spread is a fixed cost that expands on low liquidity and news.
  • commissions are an additional transaction cost, especially noticeable with frequent trading.
  • Slippage — execution is worse than expected, especially sensitive for stop orders.
  • Liquidity is a variable value that depends on the instrument, session, and market situation.
  • Broker's Terms — execution model, margin and rules may affect the final quotes.

For trading systems and robots, this means the main thing: backtest results do not guarantee future results. Past tests do not take into account the actual conditions of execution, changes in liquidity and market conditions. Therefore, any strategy should be tested on a demo account, tested on real quotes, monitored for slippage, and only then carefully implemented on a small volume. No model or Expert Advisor provides guaranteed profits — risk is an integral part of the market.

Typical errors

  • Identification of the quotation and the transaction price. The trader believes that the deal will go exactly at the price on the chart, and is surprised by the slippage.
  • Ignoring the spread. Failure to understand that entering immediately creates a negative leads to incorrect profit targets.
  • Trading at times of low liquidity. At night, on holidays and in a thin market, the spread is wider and the movements are more deceptive.
  • The bet is on "logic" without taking into account the flow of applications.The price is driven by an imbalance of purchases and sales, not by abstract "fairness."
  • Judgment by one candle. The candle is a collapsed tick flow; without a lower timeframe, it is easy to make a mistake.
  • Ignoring tick volume. It is confused with the actual trading volume and incorrect conclusions are drawn about the activity.
  • Not accounting for testing costs. A backtest without spread, commission, and slippage yields inflated results.
  • Belief in price predictability. Trying to guess every move instead of using probabilistic scenarios.
  • Comparing quotes from different brokers as "errors". Small discrepancies are the norm in the over—the-counter market.
  • Lack of risk control. Without volume and stop limits, even a correct understanding of the price will not save the deposit.

Frequently Asked Questions

What is the price of a financial instrument in simple terms?

This is the result of the coincidence of supply and demand at a particular moment. The price is shown by two values — the best purchase price (Bid) and the best sale price (Ask), and a deal is possible when the desires of the buyer and seller coincide.

How does Bid differ from Ask?

Bid is the best price at which participants are willing to buy (for a trader— the selling price). Ask is the best price at which you are ready to sell (for a trader, the purchase price). The Ask is always higher than the Bid, and the difference is called the spread.

Why is the price of the last transaction different from the quote?

A quote is the best buy and sell prices displayed in a glass at the moment. The price of the last transaction is where the buyer and seller actually met. In a sluggish market, they may diverge because there are no deals, and orders change at the same time.

Who are market makers?

These are participants (banks, brokers, firms) who constantly hold purchase and sale orders in a glass and provide liquidity. They earn on the spread and turnover, taking on the risk of quoting both sides of the market.

How does stock exchange pricing differ from the over-the-counter market?

The exchange has a single glass of orders and a single price for all participants, and the volumes are accurate. In the over-the-counter market, a broker aggregates the flow of quotes from several liquidity providers, so quotes from different brokers may vary slightly.

How are candlesticks formed from ticks?

The candle is assembled from ticks for the selected interval: Open is the first price of the period, High and Low are the maximum and minimum, Close is the last price, and volume is the number of past ticks or trades. An older timeframe means a stronger "compression" of the movement.

What is slippage and why does it occur?

Slippage is the difference between the expected and actual strike price. It appears when there is not enough liquidity at the required level: for example, on the news, the price passes by the order, and the order is executed worse.

Is it possible to predict the price?

It is impossible to accurately predict the price: it is formed by the actions of many participants with different information. It is worth working probabilistically — through scenarios, risk management and evaluation of the result on a long series of transactions, and not according to single forecasts.

Conclusion

The price of a financial instrument is not a property of the chart, but the result of the coincidence of supply and demand at a particular moment. Everything else grows out of this: buyers' and sellers' bids, two prices of the same instrument (Bid and Ask) and the spread between them, the difference between the quote and the price of the last transaction, the role of market makers and liquidity, the minimum price step and the tick as an atom of market information. On the stock exchange, the price is generated in a single glass of orders, and on the over—the-counter market - from the aggregation of the flow of quotes, so quotes from different brokers may differ slightly.

Follow the steps: understand that the price is a balance of supply and demand → understand the mechanics of bids and glasses → understand Bid, Ask and spread → see how ticks gather into candles → take into account costs and slippage → check any conclusions on a demo account in MetaTrader 5 → automate logic on MQL5 taking into account the real conditions of execution. Understanding how the price is formed does not guarantee profit or eliminate risk, but it removes the illusion of randomness and makes trading conscious. And when the rules become clear, the logical next step is to have your own trading robot built on an honest understanding of market mechanics.

Comments

To write a comment, log in Enter
Registration

Login

Password recovery Registration
Login

Password recovery Registration
Password request

If you forgot your password, enter your e-mail. The control line for changing the password will be sent to you by e-mail.

A link has been sent to your email address to confirm the E-mail address. To complete the registration, follow this link.

If you have not received an email to your email, check the Spam folder. If there is no letter there either, then contact us.

Registration completed successfully!

You have successfully logged in to the site!

We use both our own cookies and third-party cookies for the purpose of analysis, as well as to display ads based on your preferences, in accordance with your browsing habits and your profile. For more information, please see our Privacy Policy.
Telegram community
Discussions, settings, results,
communication with the author
GO