MA Cross Arrows With Alerts
A two-MA cross is one of the oldest signals there is, and also one of the easiest to get subtly wrong: mark the cross on a bar that has not closed yet and the arrow can appear, then vanish, then reappear somewhere else as the bar keeps forming. This indicator only ever compares fully closed bars against each other, so an arrow placed on bar 1 is final the moment bar 0 opens - it will never move or disappear afterwards. Both lines share one method and one applied price by design, because mixing methods between the fast and slow line makes the cross point depend on two independent smoothing choices instead of one, which is harder to reason about and rarely intentional. Notes and limitations - The cross test needs one prior closed bar, so the very first two loaded bars are never marked. - This is a lagging signal by construction - both lines are moving averages, so the cross always confirms after the turn has already begun. That is the nature of any MA cross, not a bug in this implementation. - No repainting: bar 0 (the still-forming current bar) is never evaluated for a cross, only recalculated as its own MA values update live.
Indicator · MT4 · v1.0 · Free
About MA Cross Arrows With Alerts
MA Cross Arrows With Alerts is an indicator for MetaTrader 4 based on Moving Average. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Fast period, Slow period and Ma method. MQL source code included.
Files in the download: MaCrossArrows.ex4, MaCrossArrows.mq4, MaCrossArrows.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Fast period | 10 | Fast MA period |
| Slow period | 30 | Slow MA period |
| Ma method | MODE_EMA | MA method, applied to both lines |
| Applied price | PRICE_CLOSE | Applied price, applied to both lines |
| Alerts | true | Alert once per closed bar on a cross |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Buy/Sell Arrows · Alerts · MT4 Indicator · MQL4 Source Code