4 October 2021

This snippet shows how to get current bid and ask price. Two prices are there for buy and sell pricing and the difference of those is your spread.

Source code viewer
  1. double currentSellPrice = SymbolInfoDouble(Symbol(), SYMBOL_BID);
  2. double currentBuyPrice = SymbolInfoDouble(Symbol(), SYMBOL_ASK);
Programming Language: MQL5