Spread
Spread MetaTrader indicator — displays current spread in the main window of the chart. You can modify the font parameters, indicator's position and the normalization of the spread value. The spread is redrawn after each tick, ensuring the most current and active spread value. This can be useful for brokers with variable spreads or with spreads that are widened often. You can also enable a spread label to be shown near the current Bid line. The indicator is available for both MT4 and MT5.
Input parameters
- UseCustomPipSize (default = false) — if true, the pip size will be based on DecimalPlaces input parameter, otherwise, the broker's default pip size will be used.
- DecimalPlaces (default = 0) — the number of decimal places in a pip. E.g. "4", if the pip looks like "0.0001".
- AlertIfSpreadAbove (default = 0) — if above zero, then one or more of the defined alerts will be issued if spread goes above given value.
- AlertNative (default = true) — if true, then a native popup alert will be used.
- AlertSound (default = false) — if true, then a sound alert will be played.
- AlertEmail (default = false) — if true, alerts will be sent via email. Email should be properly configured in MetaTrader via Tools->Options->Email.
- AlertNotification (default = false) — if true, alerts will be sent via push notifications to your mobile device. Notifications should be properly configured in MetaTrader via Tools->Options->Notifications.
- DrawLabel (default = false) — if true, a small text label with the current spread value will be drawn near the Bid line.
- font_color (default = Red) — color of the spread indicator.
- font_size (default = 14) — size of the spread indicator.
- font_face (default = "Arial") — font of the spread indicator.
- corner (default = ANCHOR_LEFT_UPPER) — location for the spread indicator on the chart.
- spread_distance_x (default = 10) — horizontal distance from the corner to indicator.
- spread_distance_y (default = 130) — vertical distance from the corner to indicator.
- DrawTextAsBackground (default = false) — if true, the text label with the spread value will be drawn as background. It can be useful if you want to prevent the indicator from obscuring the chart.
- label_font_color (default = Red) — color of the spread label.
- label_font_size (default = 13) — size of the spread label.
- label_font_face (default = "Courier") — font of the spread label.
Usage
The indicator measures the current spread in points (pips). Because there is no convention as to what a pip is, there is a DecimalPlaces input parameter. Using that parameter, you can change the indicator's idea of a pip. If you set it to 0, you tell the indicator that one pip looks like "1" — with zero decimal places.
That way, a quote like 1201.4/1202.6 will result in a spread of 1.2 pips. If you set DecimalPlaces to 1, then it means that your pip looks like "0.1" — with one decimal place.
And that means that the quote above has 12 pips of spread. Furthermore, if you believe that a proper pip should look like "0.01", you will set DecimalPlaces to 2 and the spread of the same quote will become 120.
In another example, let's have a look at the CAD/CHF quote of 0.76654/0.76773. If you want to use "0.0001" as a pip, you just set DecimalPlaces to 4, and the indicator will display the spread for that quote as 11.9 pips. If you set DecimalPlaces to 5, the indicator's output will look like 119 pips.
If you want to set the custom pip size using DecimalPlaces, then UseCustomPipSize should be true. When UseCustomPipSize is false, the indicator uses the default pip size of the current quote. For example, it will output 12 for 1201.4/1202.6 quote and 119 for 0.76654/0.76773 quote.
This indicator cannot be used to generate trading signals. It can only assist you to make trading decisions, set proper stop-loss or take-profit levels and inform of the current market situation in a simple and fast manner.
Download (ver. 1.08, 2022-03-23)
Spread for MetaTrader 4 in .zip Spread for MetaTrader 4 in .mq4 Spread for MetaTrader 5 in .zip Spread for MetaTrader 5 in .mq5Discussion
Warning! If you do not know how to install this indicator, please read the MetaTrader Indicators Tutorial.
Do you have any suggestions or questions regarding this indicator? You can always discuss Spread with the other traders and MQL programmers on the indicators forums.
Changelog
1.08 - 2022-03-23
- Minor improvement in performance when DrawLabel = true.
1.07 - 2020-04-09
- Added three more alert types: native, email, and push notifications.
- Fixed a bug with spread label positioning in MT5.
1.06 - 2016-07-07
- Added an option for a line label with spread size.
1.05 - 2016-05-30
- Fixed a bug with label positioning.
1.04 - 2016-05-28
- Added an option to draw the spread label as a background.
1.03 - 2015-05-04
- Fixed some compilation bugs.
1.02 - 2015-05-03
- Added custom pip size settings.
- Fixed code for compliance with MT4 Build 600 and newer.
1.01 - 2012-02-19
- Added sound alerts.
1.00 - 2009-11-10
- The first release of Spread indicator.