The difference between the bid price and the ask price of a currency pair. The bid/ask spread is essentially a transaction cost — traders buy at the higher ask price and sell at the lower bid price, and the spread is the broker’s markup or market’s price gap. For example, if EUR/USD is quoted 1.2050/1.2052, the spread is 2 pips. In backtesting a forex robot, accounting for the spread is crucial, because every trade effectively starts with a small loss equal to the spread. A strategy that looks profitable on raw price data might be unprofitable once realistic spreads (and commissions) are applied, especially on lower timeframes or frequent trading strategies.