Forex Blog

First-hand Forex trading experience and information about foreign exchange market that will be useful to traders


ChannelPattern Script Update — One-Sided Breakouts

June 5, 2014 (Last updated on November 30, 2020) by

The new version of the ChannelPattern script can now draw Entry/TP levels as trendlines on a chosen side of the Border channel. By default, it will act as before — draw two channels (Entry and Take-Profit) around the given Border channel. If new the input parameter Sides is set to Upper or Lower instead of Both, the script will draw trendlines on a selected side only. This may help when you expect breakout from that particular side.

Here is a full list of new input parameters:

  • Sides (default = Both) — if set to Both, draws channels on both sides of the given channel; if set to Upper, draws trendlines for bullish breakout; if set to Lower, draws trendlines for bearish breakout.
  • UpperEntry (default = “UpperEntry”) — name for the trendlines object acting as Upper Entry level.
  • UpperTP (default = “UpperTP”) — name for the trendlines object acting as Upper TP level.
  • LowerEntry (default = “LowEntry”) — name for the trendlines object acting as Lower Entry level.
  • LowerTP (default = “LowerTP”) — name for the trendlines object acting as Lower TP level.

Additionally, the MT5 version of the script has got a major bug fix. Previously, the script would calculate the height of the channel incorrectly if one of its lines was shifted horizontally. Now, the updated version addresses this case and calculates everything correctly.

ChannelPattern Script - Example on MT5 Chart


ChannelPattern script was developed by me to be used in combination with ChartPatternHelper EA.

PS: Do not forget to set the name of your Border channel object according to the input parameters of the script if you decide to use it.

Update 2014-06-07: Fixed a bug in MT4 version that would make script work incorrectly on weekly timeframe on some occasions.

Update 2014-07-05: The script can now work with borders drawn using trendlines or horizontal lines. It is trader’s responsibility to make sure that the lines are parallel, otherwise resulting channels will not be very useful.

Update 2018-02-03: Tweaked the MT4 code to correctly detect Borders given as horizontal lines and both versions (MT4 and MT5) will now create Entry and TP lines as horizontal line objects whenever possible.

Update 2020-11-30: Version 1.07 of the script has been released. MT4 version now works identically to MT5 one with much fewer potential errors in calculations when dealing with channels where auxiliary line is shifted horizontally in relation to the channel’s main line. MT5 version had only one minor change that doesn’t affect much.

If you want to report a bug or make a suggestion for this channel markup script, please do so using the form below.

2 Responses to “ChannelPattern Script Update — One-Sided Breakouts”

  1. yaqueline

    hello, ChannelPattern Script mt4 not working error 2021.03.31 09: 17: 18.709 ChannelPattern EURUSD, Weekly: uninit reason 0
    can you fix it please


    Andriy Moraru Reply:

    That looks like a normal script termination message. What are the messages immediately before that one?


Leave a Reply

required (will not be published)