Spread in backtest

How can I backtest a spread as if it were in real time?

In MT4 you can use the Current setting in the Strategy Tester, but it will use the current spread value in the entire period of the test, so its not exactly real time, not even close.

If you want to have trustworthy results in your backtests, use the MT5 strategy tester, that downloads real tick historical data and spread data from the broker's server itself, so the spread used in every trade of the test will be the correct real spread at the time.