Metatrader4: “Pin Bar Alerts” Indicator

Introduction
This indicator marks Pin Bars (bars with an unusually longĀ upper or lower candle wick) on your chart. It will also send alerts when one forms, including via e-mail or push notification to your phone. It’s ideal for when you want to be notified of a Pin Bar set-up but don’t want to have to sit in front of your chart all day.
Pin Bar Indicator in action

You can configure all the settings including:

  • What proportion of the bar should be made up of the wick
  • How big or small the total size of the Pin Bar has to be
  • Optionally whether the Pin Bar has to be making a new extreme (e.g. new high for a bearish Pin Bar or new low for a bullish Pin Bar).
  • What symbol (if any) is plotted to highlight a Pin Bar
  • How far beyond the bar it is plotted
  • What alerts to receive out of pop-up desktop, e-mail and push notification to your phone

Input Parameters

DoAlert: if set to true a desktop pop-up alert will appear from your MetaTrader terminal whenever an Inside Bar forms

DoNotification: if set to true then a push notification message will appear on your MetaTrader smart phone app

DoEmail: if set to true then an e-mail will be sent to your e-mail address with the alert information in

MinimumTailSize: this is the fraction of the total range of the bar that the long wick has to be

MinRangePnts: this is the smallest size the total range of the Pin Bar can be still to qualify.

MaxRangePnts: this is the largest size the total range of the Pin Bar can be still to qualify.

NB if running this indicator on a large timeframe please ensure that you’ve set the MaxRangePnts input to a sufficiently large value so that your Pin Bars will still plot

RequireNBarExtreme: if set to true then for a bullish Pin Bar the low of the bar must be the lowest of the last N bars (where N is set by the NBarExtreme parameter) & v.v. for a bearish Pin Bar.

NBarExtreme: if RequireNBarExtreme is set to true then this specifies how many bars to look back to see if the Pin Bar is at an extreme

MarkPinBarOnChart: if set to true then it will mark all historic and current Pin Bars on the chart

PlotAboveBar: if set to true then the symbol for marking the Inside Bars will appear above the chart; if false then it will appear below the chart

BullPinBarSymbol: this is the Wingdings symbol code that will be used to mark a bull Pin Bar. You can choose from any of the Wingdings codes (see the chart below)

BearPinBarSymbol: this is the Wingdings symbol code that will be used to mark a bear Pin Bar. You can choose from any of the Wingdings codes (see the chart below)

PlotOffsetPnts: this is the offset in points (the minimum Metatrader price fluctuation) from the high or the low of the bar where the symbol will be plotted. The bigger the number here the further beyond the bar the symbol will be plotted. If you find that your plots are overlapping the bar then you need to increase this number

Wingdings codes