Median / Max / Min spreads

Here is a small EA that alerts you the median/max/min spread for the last hour based on continuous random samples taken once per minute. This is relevant if you e.g. use previous highs from the chart as stop losses on your short trades (spread should be added), or if you just want to monitor and see how your broker spreads vary during trading hours. It gives you, statistically, a much more robust way of estimating the relevant spread versus just looking at current spread at any given moment.

The median spread is based on the default middle value (30) of course. You can also change this value from 0-60, e.g. set to 54 (60*0.9), it shows you with at least a little statistical confidence that spreads are below this value 90% of the time based on the last hour – you get how it works. You can also change at what minute interval the EA alerts the spreads (every 15 minutes default). Note that the EA, depending on your update interval, has to be on the chart for at least a full hour to gather data before it starts alerting.

Happy trading!