- Each one has a main pattern — a channel. On my charts, it is marked with yellow lines.
- Each has two entry lines for channel breakouts. The upper one is located at upper border + 10% of channel’s height. The lower one is located at lower border — 10% of channel’s height. They are depicted using cyan (or more precisely, turquoise) lines on my charts.
- Each has two target lines. Similarly to the entry lines, they are placed at 100% of the channel’s height from the border lines. Their color is green (actually, lime green).
Recently I have been asked by one of the blog readers about how do I draw the entry/target channels at 10%/100% distance of the channel’s height accurately. Until yesterday, I did it this way:
- I used the standard Equidistant Channel object to draw the channel borders.
- I placed the control dot of the Equidistant Channel’s auxiliary line directly above or below the first or last control dot of the Equidistant Channel’s main line:
right-clickingthe channel and choosing “Channel properties…”, and then “Parameters” tab would show me exact price levels for those control dots:
- Subtracting the price levels with the same time coordinates would yield the exact channel height value.
- Then, it could be used to place both Entry and TP channels. Two new channels would be placed with their control dots aligned in time to the control dots of the Border channel.
- Adding and subtracting 10% and 100% of height from the Border’s channel price levels would position Entry and TP channels exactly where needed.
Yesterday, I have decided to code a MetaTrader 4 script that would do all this automatically. Now, all I need to do is only to place the initial Border channel, name it “Border” and run the script. It will do all the calculations and place the 10%/100% channels completely by itself. Unfortunately, MetaTrader does not support input parameters for scripts, but the percentage levels and some other properties can be easily modified via the script’s source code:
string BorderName = "Border"; string EntryName = "Entry"; string TPName = "TP"; int PercentageEntry = 10; // Distance to entry in % of the channel's height int PercentageTP = 100; // Distance to entry in % of the channel's height color EntryColor = Turquoise; color TPColor = LimeGreen; color EntryStyle = STYLE_DOT; color TPStyle = STYLE_DOT;
Update 2013-02-27: The script was updated to work normally when Entry and TP objects are already on the chart. For example, when you have just repositioned the Border channel, running the script will also reposition Entry/TP channels properly.
Update 2013-04-13: Fixed the error in MT4 version of the script that caused division by zero on horizontal channel processing.
If you have any comments or questions about this channel markup script, please post them using the form below.