Moving average crossover scanner indicator

16 September 2019, 14:51
Jan Flodin
12
2 526

The main purpose of this blog is to describe and explain the input parameters of my Moving average crossover scanner indicator ( MT4 version / MT5 version).

Please check out my other Moving Average products for MT4:
Trend dashboard, Triple MA Expert advisor

For MT5:
Trend dashboard, Triple MA Expert advisor

Input parameters

Parameters marked with an asterisk (*) in the beginning are only available in the MT5 version and parameters marked with two asterisks (**) in the beginning are only available in the MT4 version.

  • GENERAL SETTINGS
    • Candle shift to check for crossover: Default is 1 which means that the indicator will check for crossovers upon candle opening. 0 can be set to catch intracandle (unconfirmed) crossovers. Only the first crossover will be alerted. Setting a higher value than 1 will delay the alert with xx candles. This in order to properly confirm the signal. Might be useful when working with time frames >= H1 and using larger values for the slow MA.
    • Panel width: If you are using a non-standard font size in Windows you could set this to a larger value in order for the whole text to be visible.
    • Custom panel title: If you put some text here this text will be shown instead of the default panel title.
    • Template name: Your own custom chart template you put here will be applied to the chart which will be opened when you click on a signal in the panel. The name must include the file extension (.tpl). You would typically prepare your template with the MA lines and for instance a support/resistance indicator.
    • Delay in seconds for applying chart template: This parameter can be set to a higher value in case the Stochastics indicator will now be drawn on the chart which opens up when you click on a signal in the panel.
    • Single chart modeWhen set to True the indicator will scan for patterns only on the chart where it has been installed. It will only draw arrows for future patterns and it will not redraw patterns when changing time frame.
  • SIGNAL SETTINGS
    • Amount of signals to show in the panel: Default is 20. But you can set it to more if it will fit on your chart. The signals will be shown in descending order, i.e. the latest signal first. The panel can be moved around on the chart by dragging it with the top list. It can also be minimized. If closing it with the x button the indicator will be unloaded from the chart as well. The panel does not support having font size set to for instance 125% in Windows. You can set the last (XX) signals in the indicator settings. You can change it to for instance 30. The panel height will then increase and in some cases it might not fit on your chart. To disable to panel you must set the value to 0. The text on each row contains information about time (server time) when the signal was generated, symbol, time frame, type of alert and if bull or bear. For instance "3.5 18:00-USDJPY-H4-MA cross-Bear". The time is written in the format M.D hh:MM. When clicking on a row a new chart will be opened with the selected symbol and time frame. The opened chart will be opened with the chart template which you have defined in the indicator settings.
    • Where to write signals (For EA): Listbox with the following selections:
      • Disabled
      • File in data folder: Set to True to save signals to a .CSV file. The file is located in the \MQL4\Files folder (MQL5 in Metatrader 5) and the name of the file is "MAS_symbol_timeframe.csv". For instance "MAS_EURUSD_M5.csv". This file could be used by an Expert Advisor for automatical trading. The format in the file is: [alert type];[symbol name];[time frame (text)];[date of signal candle];[Bull or Bear]. For example "MA cross;EURUSD;M30;6.11.2019 12:30;Bear". Always separated by a semi colon.
      • File in common folder: The file is stored in the common folder instead which is a folder shared by all Metatrader instances installed on the machine.
      • Global variables
    • Amount of signals to save in file: When this value has been reached then older signals will be deleted.
  • GENERAL MOVING AVERAGE SETTINGS (the default values can be changed to any other values)
    • Period, shift, method and price mode for the first (fast) MA: The shift simply moves the value of the MA in time. So the MA value for bar 0 with shift 1 is the same as the MA value for bar 1. I do not recommend using negative shift values.
    • Period, shift, method and price mode for the second (slow) MA
    • Period, shift, method and price mode for the third MA
  • SINGLE MOVING AVERAGE SETTINGS
    • Alert when price crossed first MA: Alert only when price has closed above/below the first MA.
    • Alert when price crossed second MA: Alert only when price has closed above/below the second MA.
    • Bounces only (price crossed first MA but reversed): When set to True then any of the 2 parameters above must also be set to True. With the parameter 'Candle shift to check for crossover' set to 1 then the bounce logic works in the following way. For a bullish bounce: The open price of the candle with shift 2 must be below the MA and the high price of this candle must be above the MA. Finally the close price of the candle with shift 1 (the next candle) must be below the MA. The idea is to trade reversals on bounces, hence in the direction of the candle (shift 2) prior to the bounce candle.
  • DOUBLE MOVING AVERAGE SETTINGS
    • Alert at MA crossovers (fast crossing slow)
  • TRIPLE MOVING AVERAGE SETTINGS
    • Alert at triple MA crossovers
    • Strict mode:  'true' or 'false'. By setting this to ' false' will allow the third MA to be above/below the second MA. Example: We have a triple MA setup with MA 5, 13 and 20. In the normal situation, for a bullish signal to be valid, MA 5 must be above both MA 13 and MA 20 and MA 13 must be above MA 20. In the non strict mode MA 20 is allowed to be above MA 13. Vice verse for a bearish signal.
    • Min. distance in points between MA:s: You can set this to 1 to be alerted at the cross (0 value is not supported). But recommended is to wait until a certain distance between the 3 MA:s has been reached. A good range is somwhere between 40 and 70 points.
    • Max. distance between signal MA:s (0=disabled): Will prevent alerts if the distance is to big. For instance after a news event.
  • MACD SETTINGS
    • Alert at MACD lines crossover
    • Alert at MACD zero(0) line cross
    • Fast EMA, Slow EMA and Signal SMA periods
  • RSI FILTER SETTINGS
    • Enable RSI filter (not used with MACD)
    • Signal only when RSI is between the buy and sell level: The alert will be sent only if the RSI level is between these values.
    • RSI buy level (signal from this level and above): If you set this to for instance 55, alerts will be sent for crossovers (fast MA crossing slow from below) where RSI >= 55.
    • RSI sell level (signal from this level and below): If you set this to for instance 45, alerts will be sent for crossovers (from above) where RSI <= 45.
    • RSI Period
    • RSI apply to price
  • MOVING AVERAGE MAJOR TREND FILTER SETTINGS
    • Enable MA filter
    • MA period
    • Bar shift
    • MA method
    • MA price type
    • MA time frame
  • SYMBOLS AND TIME FRAMES
    • Symbols to scan: Here you will put all symbols you would like to monitor. Every symbol must be entered in the exact way as it is visible in the Market Watch window and separated with a comma, without spaces. By design in Metatrader 4 the amount of character in a text (string) parameter is limited to 255. You can put more characters in the Symbols parameter but when reading the value, Metatrader cuts at 255. 255 characters will allow for 36 symbols and 35 commas (,) if the symbol length is 6 characters. If you need more symbols you can always drag the indicator with the remaining symbols to another chart. To come around this limitation you can set the value in the 'Use symbols from Market Watch window instead' parameter below to  true. By doing this the indicator will use the symbols visible in your Market Watch window instead.
    • Use symbols from Market Watch window instead: With this option set to True all visible symbols in your Market Watch window will be scanned instead of the symbols above. Due to performace reasons It is not recommended to use more than 40 symbols if you have a slower computer. 
    • Time frames: Set to true for each time frame you would like to monitor.
  • CHART OBJECT PROPERTIES
    • * Draw moving average lines on chartTrue or False. If set to True then the MA lines will be drawn on the chart which opens up when you click on a signal in the panel.
    • * Add MACD indicator on chart: True or False. Will add the MACD indicator in a subwindow.
    • Panel background color
    • Panel text color
  • ALERTS
    • Alerts: Set to 'true' for each alert type you would like to receive. All alert types are supported.
    • Custom sound alert (if True then no pop-up alert): True or False.
    • Custom sound file: If you would like to use another sound file than the default it must exist in the Sounds folder. For example: c:\program files (x86)\metatrader 4\sounds.
    • Custom alert text: Blank by default. The text you put here will be inserted after the time frame in the pop-up (on screen) alert. For example  'GBPUSD H1 - bearish MA 10/20 crossover ([your custom text])'



Share it with friends: