Pinbar scanner indicator

3 August 2020, 17:01
Jan Flodin
3
556

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 for 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.
    • * Write signals to file: This is set to true and must remain this way. The signals will be saved to a .csv (text) file for further usage. 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: [alert type];[symbol name];[time frame];[time of pin bar candle];[Bull or Bear]. For example "PINBAR;EURUSD;M30;6.11.2019 12:30;Bear". The values are always separated by a semi colon.
    • * Amount of signals to save in file: When this value has been reached then older signals will be deleted.
    • ** Write signals to global variablesTrue or False. What set to true the indicator will write the signals as global variables as well. Can then be used by an Expert Advisor for auto trading. The format global variable name is "PS-[symbol]-[time frame]-[bullish or bearish]. For instance "PS-AUDUSD-H1-Bull" or "PS-DE40-M5-Bear". The value of the global variable is the time (in MQL5 format) of the trigger candle.
    • 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 in points for buy/sell stop: 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.
  • 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 20 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.
    • 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. 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.
    • Average body-size period (0 = any size): This can be used fo filter out small pin bars. The pin bar candle size must then be larger than the average candle size for the past xx candles.
    • TREND FILTER SETTINGS
      • * 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.
      • ** Disable RSI: Set to True if you would like to disable the RSI filter.
      • * 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.
      • 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
    • 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])'


    Share it with friends: