Pennants and Triangles scanner indicator

16 September 2019, 16:23
Jan Flodin
0
480

The main purpose of this blog is to describe and explain the input parameters of my Pennants and Triangles indicator (MT4 version / MT5 version).

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
    • * Scanning interval in seconds: Default is 1. Can be set to a higher value in order to prevent possible performance issues on slower computers.
    • Panel width: Default is 220. For instance, 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: The template you put here will be applied to the new chart which will be opened when you click on a signal in the panel.
    • Delay in seconds for applying chart templateThis parameter can be set to a higher value in case objects from other indicators or an Expert Advisor are now drawn on the chart.
    • * Single chart mode: When set to True the indicator will scan only patterns on for the chart where it has been installed. It will only draw 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 25. 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, signal type and in case of inside bars signal, also the amount of inside bars. For instance "3.5 18:00-USDJPY-H4-Inside-8". 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 as well as lines showing the formation. The opened chart will be opened with the chart template which you have defined in the indicator settings.
    • ** Write signals to file: 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 "PTS_symbol_timeframe.csv". For instance "PTS_EURUSD_M5.csv". This file could be used by an Expert Advisor for automatical trading. The format in the file is: [signal type];[amount of inside bars (empty in case of P/T signal)];[symbol name];[time frame (text)];[date of previous candle]. For example "Inside;17;EURUSD;M30;6.11.2019 12:30" or "P/T;GBPUSD;H1;6.11.2019 13:30". Always separated by a semi colon.
    • * Write signals: Drop down menu with the following selections:
      • File in data folder: Will save the 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 "PTS_symbol_timeframe.csv". For instance "PTS_EURUSD_M5.csv". This file could be used by an Expert Advisor for automatical trading. The format in the file is: [signal type];[amount of inside bars (empty in case of P/T signal)];[symbol name];[time frame (text)];[date of previous candle]. For example "Inside;17;EURUSD;M30;6.11.2019 12:30" or "P/T;GBPUSD;H1;6.11.2019 13:30". 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.
      • Write to globals: Will write the signals as global variables. Can also be used by an Expert Advisor for automatical trading. The format global variable name is "PTS-[symbol]-[time frame]-[bullish or bearish]-[signal type]. For instance "PTS-AUDUSD-H1-Bull-P/T" or "PTS-DE40-M5-Bear-Inside". The value of the global variable is the time (in MQL5 format) of the trigger candle. 
    • Amount of signals to save in file: When this value has been reached then older signals will be deleted.
    • Draw trading objects: True or False. When True then buy/sell lines as well as TP/SL lines (based on ATR multiplier) will be drawn on the chart which will be opened when clicking on a signal in the panel. Please see screenshot #5 under the product description.
    • Maximum candles signal is valid for: This setting is used to set the length of the buy/sell lines drawn on the chart. 
    • Offset in points for buy/sell stop: This settings will control the distance of the buy/sell lines. It is measured from the formation Master candle high/low. If the Breakout option has been enabled then the candle must have closed above/below this line in order for the breakout to be valid.
      When a negative (minus) value will be put here then the ADR percentage (Average daily range based on last 20 days) logic will be used. If you for instance set this value to -5 (%) and the ADR is 1000 points (100 pips) then a 50 points offset will be used. When the value is between 0 and 10 it will use ATR multiplied with the value.
  • PENNANT AND TRIANGLES SETTINGS
    • Enable scanning: True or False. Enables scanning of Pennants and Triangles.
    • Ignore wicks: True or False. Wicks are ignored on the candles after the Master candle.
    • Wait for breakoutTrue or False. Will only alert on a breakout from the formation. The candle must have closed above/below the buy/sell line (visible on the chart which you will open by clicking on the signal in the panel) in order for a breakout to be valid and an alert to be sent. The indicator will wait for a breakout the amount of candles you have set in the 'Maximum candles signal is valid for' parameter above. If the breakout comes later then no alert will be sent. If there will be a candle with wicks (high/low) outside the master candle then the breakout will be invalidated.
  • INSIDE BARS SETTINGS
    • Enable scanning: True or False. Enables scanning of inside bars.
    • Minimum amount of inside bars: Default is 6 (4 for Master candle strategy).
    • Maximum amount of inside bars: Default is 20 (5 for Master candle strategy).
    • Min. master candle size in points (0=any size): Only a Master candle larger than or equal to this size will give an alert. Default is 0.
    • Max. master candle size in points (0=any size): Only a Master candle smaller than or equal to this size will give an alert. Default is 0.
    • Ignore wicks: True or False. Wicks are ignored on the candles after the Master candle.
    • Wait for breakout: True or False. Please see the description of the same parameter under the PENNANT AND TRIANGLES SETTINGS section above.
  • ATR SETTINGS
    • ATR Period: Period for the Average True Range indicator. Default is 14. The ATR value is measured on the Master candle.
    • TP 1 ATR multiplier: Used for the first take profit level.
    • TP 2 ATR multiplier: Used for the second take profit level.
    • SL ATR multiplier: Used for the stop loss levels.
  • 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 insteadWith 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.
  • OBJECTS
    • Formation lines color: The color of the formation lines which are drawn on the chart which has been opened from the panel.
    • Buy line color: Color for the buy line and the take profit levels.
    • Sell line color: Color for the sell line and the stop loss levels.
    • Line width: Line width for the formation lines.
    • Enable ray for TP/SL lines: True or False. When set to True then the lines will have an infinite duration the right.
    • 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 alert text: Blank by default. The text you put here will be inserted at the end of the alert text.



    Share it with friends: