Pinbar scanner indicator

3 August 2020, 17:01
Jan Flodin
5
678

The main purpose of this blog is to describe and explain the input parameters of my Pinbar scanner 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
    • 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.
    • 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: The 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).
    • Delay in seconds for applying chart template: This parameter can be set to a higher value in case the trade advice lines are now drawn on the chart.
    • Single chart modeWhen set to True the indicator will scan only pin bars on the chart where it has been installed. It will only draw arrows for future pin bars and it will not redraw pin bars when changing time frame. 
  • SIGNAL SETTINGS
    • Amount of signals to show in the panel: 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.
    • Where to write signals (for EA): 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 "PBS_symbol_timeframe.csv". For instance "PBS_EURUSD_M5.csv". This file could be used by an Expert Advisor for automatical trading. The format in the file is: [type of signal];[symbol name];[time frame (text)];[date of previous candle]; [bullish or bearish]. For example "Pinbar;EURUSD;M30;6.11.2024 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.
      • 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 "PBS-[symbol]-[time frame]-[bullish or bearish]-[type of signal]. For instance "PBS-AUDUSD-H1-Bull-Pinbar" or "PBS-DE40-M5-Bear-Pinbar". 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. Will not work in single chart mode. 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 under the product description.
    • Maximum candles signal is valid for: This setting is used to set the lenght of the buy/sell lines.
    • Offset for buy/sell stop (ATR, ADR or points): This settings will control the distance of the buy/sell lines measured from the last candle in the formation. 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 3 it will use ATR multiplied with the value. If larger than 3 then points will be used.
  • BAR SETTINGS
    • Minimum candle height in points: Makes it possible to filter out the smallest pin bars. If you for instance trade M1 and M5, you could set it to 25 points. Please be aware though that this setting is valid for all time frames. For this reason this setting will not be very useful if you are trading on all time frames. You can also use the average candle range option which means that the pin bar candle must be larger than the average candle size of the last xx bars. If the value in this parameter is set to 1-20 then average candle range will be used, if set to >20 then points will be used.
    • Minimum candle body size % (0 = any body size): The scanner will filter out dojis by default. Recommended setting is 0. But if you would like a larger body, you can set a higher value.
    • Minimum percent for tail: Default is 60. If you would like a larger tail you can set it to for instance 70. It will give fewer signals but higher quality.
    • Only strict pinbars: True or false. A strict pin bar means that the pinbar must have another color then the previous bar and that the pin bar's high must be higher then the previous bar's high and finally that the pin bar's body must be within the range of the previous bar. It will give fewer signals but higher quality. With this setting set to False any pin bar will give a signal.
    • Use candle midpoint logic (0=disabled): See screenshot #2 under the product description.
    • TREND FILTER SETTINGS
      • ** Enable RSI: Set to True if you would like to enable the RSI filter.
      • * Trend filter to use: List box where you can select from RSI or Bollinger bands.
      • RSI overbought levels: The pin bar candle must close above this level in order to be valid.
      • RSI oversold levelThe pin bar candle must close below this level in order to be valid.
      • RSI Period: Default period is 10.
      • * Bollinger shift
      • * Bollinger deviation
      • * Bollinger period
      • Apply to price: RSI/Bollinger level is calculated from this setting.
      • * Trend time frame (current=main signal time frame)You can set this for to instance the Daily (D1) time frame. In that case all scanned time frames will check RSI/Bollinger only on the D1 time frame.
    • 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.
      • SL at pin bar high/low: Will draw the line a the high/low level (+ offet) instead of using ATR.
    • 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.
      • Additonal symbols to scan
      • 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.
    • CHART OBJECT PROPERTIES
      • Buy/sell stop color
      • TP line color
      • SL line color
      • Line width
      • Enable ray for TP/SL linesTrue or False. When set to True then the lines will have an infinite duration the right.
      • Panel background color
      • Panel text color
      • List item height
      • List item font size
    • 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 pin bar ([your custom text])'