Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Spread Spike Histogram with Moving Average - indicator for MetaTrader 5

Kenichiro Sakamoto
Kenichiro Sakamoto
5 (2)
I'm Kenichiro Sakamoto, the developer behind FXEA365 — a studio building transparent, rule-based Expert Advisors for MetaTrader 5.
Views:
41
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The indicator draws the spread of every bar in points as a histogram in a separate window. For the history it uses the bar spread stored in the price data, and for the current bar it uses the live spread of the symbol. A blue line shows the simple average of the spread over the previous bars.

A bar is colored red when its spread is greater than the average multiplied by a factor, or greater than a fixed ceiling in points. In this way it is easy to see the hours when the spread usually widens, for example around the daily rollover, and to avoid placing orders at those times. An optional alert is given once per bar when the current bar becomes a spike.

Fig. 1. The indicator on a GBPJPY H1 chart; the red bars are the rollover hours

Input parameters

  • InpAvgPeriod - number of previous bars used for the spread average.
  • InpSpikeFactor - a bar is a spike when its spread is greater than the average multiplied by this factor; the value must be greater than 1.
  • InpCeiling - fixed spread ceiling in points; a bar with a larger spread is also a spike; 0 turns the ceiling off.
  • InpAlert - show an alert when the current bar becomes a spike.

Notes

The bar spread in the history depends on what the broker stores, which is usually the smallest spread of the bar. The real spread inside a bar can be wider, so the histogram shows the typical pattern of the spread rather than every short widening.

Economic News Window Flag for Pausing Expert Advisors Economic News Window Flag for Pausing Expert Advisors

Utility Expert Advisor that reads the built-in economic calendar and sets a terminal global variable to 1 around important events, so other Expert Advisors can skip new entries during the news.

Trade List Report — a colorful PDF of your trades, written in pure MQL5 Trade List Report — a colorful PDF of your trades, written in pure MQL5

Prints a colorful, print-ready PDF report of your last N trades: KPI cards, a win-rate donut, a zebra table with BUY/SELL pills and diverging profit bars. Pure MQL5 — no DLL, no external converter. Saved to `MQL5\Files`.

Missing Stop Loss and Take Profit Setter Missing Stop Loss and Take Profit Setter

Utility Expert Advisor that finds open positions without a stop loss or take profit and adds them at a fixed distance in pips from the open price. It never opens or closes trades.

MACD Signals MACD Signals

Indicator edition for new platform.