Script to Draw Middle Line of a Channel


Staff member
Nov 30, 2008
A while ago, a user on Reddit asked about a MetaTrader script to automatically draw a middle line for a channel chart object. Now, after wishing to have such a script myself a few times, I decided to finally code it both for MT4 and MT5.

The script's source code and the compiled files are attached to this post and are available for free download.

You can simply run the script on a chart with a channel object named Channel (or anything else, but make sure to change the respective input parameter), and it will calculate the exact points and will create a middle line that bisects the channel.

Bug reports and suggestions are welcome!


  • ChannelMiddleLine.ex4
    11.6 KB · Views: 4
  • ChannelMiddleLine.mq4
    4.7 KB · Views: 14
  • ChannelMiddleLine.ex5
    18.2 KB · Views: 4
  • ChannelMiddleLine.mq5
    3.7 KB · Views: 11