Author:
Mr. T from www.codeforex.com
Hey fellow traders! It’s about time I share my insights with the MQL4 community. Many of us often wonder whether our brokers are playing fair with the spreads. So, I’ve put together two handy indicators that will help you keep an eye on how the spread is performing in real-time, as well as over the last few minutes—just enough time to get a feel for things.
From my experience, a few minutes of data is more than sufficient. Unfortunately, MT4 doesn’t store historical spread data, unless we code it ourselves. During major news releases, I noticed that spreads can nearly double or even triple—this was on a demo account! I can only imagine what it’ll look like on a live account. Once you apply these indicators, they will log the Spread, Bid, and Ask for the last 500 ticks (or however many you choose to specify in the LastTicks parameter). Initially, you’ll see a few readings, but within a minute, your chart will fill up with valuable data.
Here are the two simple indicators you’ll want to check out:
- _x_SpreadLogger.mq4 - This tracks the latest spreads for your selected currency, letting you see the minimum and maximum spreads during a specified period.
- _x_BidAskLogger.mq4 - This one tracks the most recent Bid and Ask prices, giving you insight into their performance over a specific timeframe.
The template included allows you to apply both indicators simultaneously on your chart. You can either use _x_BidAskLogger first, followed by _x_SpreadLogger in the same subwindow, or keep them separate—totally up to you!

Recommendations:
- Set LastTicks to 500 (default) for optimal performance. I’ve tried using a bigger number, but typically, 500 is more than enough to capture the last 3-10 minutes.
- Copy the indicators into your /experts/indicators folder.
- Copy the template into your /templates folder.
- If you want the same layout as shown in the image, don’t forget to apply the template!
If you have any suggestions or improvements in mind, feel free to drop a comment below! I’m always looking for ways to enhance these tools, and I’ll be sure to share any updates once they’re ready and tested. Let’s help each other out by sharing our findings!

Comments 0