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
double currentSellPrice = SymbolInfoDouble(Symbol(), SYMBOL_BID); double currentBuyPrice = SymbolInfoDouble(Symbol(), SYMBOL_ASK);Programming Language: MQL5