Saturday, October 11, 2008

DOCUMENATION for WRR_ZUP_INFO_v02 .mq4 forex Indicator to Complement ZUP :: successful forex trader

Rev 00
Issued 2008.06.16

Forex Indicator INTRODUCTION
In response to a number of requests, I have re-written my ZUP _ v67.01_WRR _ZUP_INFO.mq4 forex indicator to make it compatible with multiple versions of ZUP for forex trading. I am calling this new indicator WRR_ZUP_INFO_v02.mq4. Following, is a description of what it does and the settings for it.
This forex indicator also needs the ZUP indicator on the chart set up to show Gartley patterns for it to work.

The main purposes for, and features of, the WRR_ZUP_INFO forex indicator are as follows. It will display a text block saying what type of pattern ZUP has made (Gartley, Butterfly, Bat or Crab), if the pattern has “failed,” if there is no pattern, what timeframe or period the chart is on and the chart instrument or pair. The text block also indicates the risk for the forex trade and the range in which the pattern is valid or somewhat valid. The text block can be moved anywhere on any window including forex indicator sub-windows.

It will alert when there is a pattern change. It will draw a 100% fib expansion on Gartleys to show if there is an AB=CD confirmation. It will allow one to change the background property and colours of the D Point Rectangle drawn by ZUP. It will also allow one to forex automatically and instantly make a screen shot every time a new pattern forms, fails or there is no pattern, then save it to a file.

There are a few more adjustments that can be made to the forex indicator, all of which are documented below. The main settings for the forex indicator are noted in green. The other settings for the indicator are noted in blue. Important notes are shown in red.


To function properly, this forex indicator must be installed after the ZUP indicator. A source for the ZUP indicator is noted near bottom of this document.

**** VERY IMPORTANT **** TO GET the WRR_ZUP_INFO INDICATOR TO WORK AND TO GET ZUP TO WORK, one must check the box "Allow DLL imports" in the Common Tab of the indicators’ properties ON BOTH INDICATORS. If “Allow DLL imports” is not selected in ZUP, nothing will show up. If “Allow DLL imports” is not checked in WRR_ZUP_INFO, an error message alert will show up and it will not run.

**** VERY IMPORTANT **** Always install ZUP first then WRR_ZUP_INFO after ZUP. This is because WRR_ZUP_INFO needs to read the most current data from ZUP. If one installs WRR_ZUP_INFO first, then its performance will be delayed.


It has 3 different types of forex alerts, one that alerts when ever there is a new pattern (PatternAlertON = true), a second that forex alerts if there is a pattern failure (FailedPatternAlertON = true) , and a third that alerts when the last pattern is removed by ZUP i.e. No Pattern Now (NoPatternAlertON = true) . All alerts can be turned off together with the (AllAlertsOFF = true) setting. On the old version, the alerts would always sound for forex charts with patterns every time the forex indicator was started or the period was changed on the charts. On this version these problems have been reduced.

When I wrote the original version, I placed Global Variables in the ZUP code to make data accessible to my indicator since this seemed like an easier way to code it. However, there are so many new versions of ZUP coming out all the time, this turned into a make work project. So this new version of my indicator detects the triangle and rectangle objects that ZUP draws for the patterns. This indicator should now work with multiple versions of ZUP with no modifications required to the ZUP code, provided the ZUP settings are correct.


Following are the current settings I use in ZUP. I don’t know how they all work but at a minimum, the bolded ones should be considered.

extern string ________________0_____________ = "Parameters for ZigZag";
extern int ExtIndicator = 11;//WRR default is 11 for Gartley Patterns
extern int minBars = 8;//this varys slightly on some versions
extern int minSize = 55;//this varys slightly on some versions

// Ïåðåìåííûå îò ZigZag èç ÌÒ
extern int ExtDeviation = 5;
extern int ExtBackstep = 3;
// Ïåðåìåííàÿ äëÿ nen-ZigZag
extern int GrossPeriod = 1440;
extern double minPercent = 0;
extern int ExtPoint=11; // êîëè÷åñòâî òî÷åê çèãçàãà äëÿ çèãçàãà Talex
extern bool ExtStyleZZ = true;

extern string ________________2_____________ = "Parameters for Pesavento Patterns";
extern int ExtPPWithBars = 0;
extern int ExtHidden = 1;
extern int ExtFractal = 7;
extern int ExtFractalEnd = 7;
extern int ExtFiboChoice = 2;
extern bool ExtFiboZigZag = false;
extern double ExtDelta = 0.04;
extern int ExtDeltaType = 2;
extern int ExtSizeTxt = 10;//WWR default 7, try 10
extern color ExtLine = DarkOrange;//WRR default DarkBlue, try DarkOrange
extern color ExtLine886 = LimeGreen;//WWR default Purple, try Yellow
extern color ExtNotFibo = DarkOrange;//WRR default SlateGray, try DarkOrange
extern color ExtPesavento = LimeGreen;
extern color ExtGartley886 = GreenYellow;
color colorPPattern;

The colours one chooses are one’s personal preference. Some say the best patterns are those with the most or all Fibonacci numbers. These are the ones labelled by the ExtGartley886 colour so make sure they stand out. The next best patterns are the ones with the most ExtPesavento numbers.

extern string ________________3_____________ = "Parameters for Gartley Patterns";
extern int maxDepth = 33;
extern int minDepth = 3;
extern bool DirectionOfSearchMaxMin = true;
extern int NumberPattern = 1; //WRR default set for only one pattern
extern int ExtGartleyTypeSearch = 0; //WRR default= 0, 2=historical
extern int ExtHiddenPP = 1;
extern bool ExtGartleyOnOff = false;
//extern int VarDisplay=0;
extern int maxBarToD = 100;//WRR default was = 15, 0=historical, set at 100 so pattern stays visible more bars after it is formed. If this is set too low, then often the pattern will be removed from the chart as soon as it fails and WRR_ZUP_INFO will go from a pattern to No Pattern Now, skipping the FAILED message. This setting is also good to pick up big patterns and ones that are slow to start moving in flat market.
extern bool RangeForPointD = true;
extern color ExtColorRangeForPointD = DarkGrey;//so red candles show up better extern color ExtColorPatterns = Blue;
extern string ExtColorPatternList = "Blue,DarkGreen,Navy,Sienna,MediumBlue,RoyalBlue,DodgerBlue,CornflowerBlue,LightSkyBlue,SlateBlue,MediumSlateBlue,SlateGray,LightSteelBlue";
extern double ExtDeltaGartley = 0.09;
extern double ExtCD = 0.886;

extern string ________________12_____________ = "Common Parameters";
extern color ExtObjectColor = CLR_NONE;
extern int ExtObjectStyle = 1;
extern int ExtObjectWidth = 0;
extern bool ZigZagHighLow = true;
// --------------------------------
// Äîïîëíèòåëüíûå ôèíêöèè
extern bool ExtSendMail = false;
extern bool ExtAlert = false; this setting will alert every time a ZigZag draws a new bar (changes direction). It is too irritating to have it on (true) when the market is flat as it sends too many alerts but it is handy as a tool to signal direction change. It is not necessary to have this alert in ZUP on for the WRR_ZUP_INFO indicator to work.
// Âûâîä îáúåêòîâ â âèäå ôîíà
extern bool ExtBack = true;
// Ñîõðàíåíèå ñòàòè÷åñêèõ âèë Ýíäðþñà, Fibo Time è ò.ä.
extern bool ExtSave = false;
extern bool infoTF = false;//set to true if one wants to see average true range for different chart periods, range numbers and pattern names created by ZUP. These are the same range numbers and pattern names as in WRR_ZUP_INFO. Normally the comments from infoTF don’t show up due to interference with the comments of other indicators or infoTF gets in the way of the comments of other indicators if not set to false.
extern int ExtComplekt = 0;

The rectangle that ZUP draws with each pattern denotes the price range where the “D” point or entry point of the XABCD pattern is valid or somewhat valid. The indicator determines the high and low value of this rectangle then calculates it’s range and the distance of price from the pattern failure point. The minimum and maximum price range where the pattern is valid is the same information as is available when ZUP is set to show one pattern and the ZUP infoTF switch is turned on.

The code for a "FAILED" pattern is now corrected. Before, if the pattern "failed" a while ago but the price came back into range, ZUP_v67.01_WRR_ZUP_INFO.mq4 would call the pattern valid when it was not.

Trading the Patterns
For entering bullish patterns, the low value of the rectangle range would be the maximum risk or minimum price level where one might want to set a stop. For entering bearish patterns, the high value of the rectangle range would be the maximum risk or maximum price level where one might want to set a stop. If price moves beyond these points then the pattern has failed and the indicator optionally sends an alert. A new bullish pattern can also be used as a signal to exit a short trade and a new bearish pattern can also be used as a signal to exit a long trade.

One may find that Gartley’s on higher timeframes are the most reliable to trade followed by 1.618, 1.272 and 2.618 Butterflies.

I found that the default setting on ZUP for the “D” point rectangle that draws only an outline of the rectangle blocked my view of the wicks on candles. For this reason I added a feature to optionally make the rectangle solid and in the background so that the wicks can always be seen (RetangleInBackground = true). The colour of the rectangle can be changed with this setting (RetangleColour = DarkGray).

Many Gartley traders agree that a true Gartley pattern must have pattern segment AB equal to CD. Therefore, the indicator will optionally draw a single Fibonacci Expansion line at the 100% expansion level to show where point D should end on a proper Gartley pattern when (ShowABeqCD_FibExpGartley = true). It will remove the single fib line either when the Gartley Pattern fails (RemoveFibExpGartley_if_FAIL = true), or when the Gartley Pattern is not on the chart (RemoveFibExpGartley_if_FAIL = false). The colour of the fib line can be adjusted here: (ABeqCD_FibExpGartleyColour = Red).

In addition, the indicator will optionally, instantly make a *.gif screenshot of the chart each time the indicator is launched to show what if any pattern was there upon start up and make further screen shots the moment a new pattern forms, fails or is removed by ZUP. I added the screen shot feature to make it easier to debug and understand WRR_ZUP_INFO’s alerting behaviour but it may be useful for some people so I left this code in (ScreenShotWhenPatternChange = false). Make sure one turns screen shots to false when not needed as the screen shot files will take up a lot of space on one’s hard drive with the setting set to true.

Screen shot files are named in the following format:

Currency Pair, Chart Period, date time of the Chart i.e. ChartYYYYMMDD HHMM SS, date time of the local PC i.e. (LocalYYYYMMDD HHMM SS milliseconds), Pattern Name, . For example:

AUDUSD 5M Chart20080613 0559 05 Local20080612 2359 53 632 Bullish Gartley Initially.gif

Note that “Initially” will not show up again in any file names unless MT4 is restarted or the chart is changed.

These files are created in the C:\Program Files\ \experts\files\WRR_ZUP_INFO Screen Shots directory. The “WRR_ZUP_INFO Screen Shots” sub-directory is created automatically by the indicator if it does not already exist.

When (ShowScreenShotsOnLabel_3_ON = true) a label will be drawn on the chart noting that automatic screen shots is turned on. The label will disappear when automatic screen shots is turned off or if the setting is changed to false, but changing ShowScreenShotsOnLabel_3_ON to false does not turn off screen shots – it only turns off the label. The recommended setting is to always leave it as true to help remember to turn off screen shots when not needed.

One can adjust the screen shot gif file picture size by changing the (ScreenShotWidth = 1088) and the (ScreenShotHeight = 612) settings. This is handy if one wants to post smaller screen shots on forums or to get the gif files to fit on your picture viewing software without having to resize or scroll. Smaller numbers make a smaller screen shot. Play around with this to see what is best.

Corner = "br", sets which corner of the chart to draw the labels where “tl" = top left, "tr" = top right, "bl" = bottom left and "br" = bottom right.
OffsetTopBottom = 0, adjusts the overall height in points that the labels are from the Corner selected. One may want to set this to 10 if using screen shots with WRR_ZUP_INFO labels set to bottom left corner so the Metaquotes logo is not blocked on the screen shot.
OffsetLeftRight = 0, adjusts the overall distance left or right in points that the labels are from the Corner.
The above two settings allow the labels to be placed anywhere one wants in the window.
FontSize = 10, is the font size for the labels
FontType = "Arial Black", is the font type for the labels.
FontColour = DarkOrange, is the label font colour.
LabelsInBackground = false, sets the labels to over-write other objects.
SpaceBetweenLines = 4, adjusts spacing between lines of text (may need if changing font size).
WindowNumber = 0, main window is zero, indicator windows are 1 through how many are on chart. This allows labels to go in another indicator’s window such as MACD to save space on the main chart. If one turns off the Visualization for say the MACD indicator for the active chart on which one wants the labels, the labels will not be visible.

AllLabelsOFF = false, turns off all labels.
PatternAndFileNameLabel_1_ON = true, turns on Label_1 (the first row of the labels)
DisplayFileNameInLabel_1 = true, turns off the file name of the indicator in label 1.
RiskAndRangeLabel_2_ON = true, turns on Label_2 (the second row of the labels)
ShowScreenShotsON_Label_3 = true, usually leave as true so one knows that Screen Shot is on unless it is in the way. One does not want to forget about Screen Shot being on and have one’s hard drive fill up.

ShowFileNameInComment = false, turn on or off Standard MT4 title Comment in top left corner of chart. This shows the file name of indicator. Normally leave this set to false so it doesn’t block comments of other indicators.

1) Often labels and indicator window charts will not be captured by the automatic screen shot.
2) Sometimes on start up or chart changes while data is loading, alerts for current patterns trigger. You can silence most subsequent alerts on chart changes by cycling through each chart period once after start up.

Anyone who knows how to fix these, please advise.


I send big thank you to Eugeni Neumoin known as nen, the developer who wrote the ZUP code. It is truly amazing work.

An interview with nen can be found at this link:

The Russian forum for the development of the ZUP indicator is found on this thread:

One may also find nen's ZUP indicators at the beginning of this thread:
Harmonic Trading

Another discussion of harmonic price patterns can be found on this thread:
Price Patterns(Gartley,Butterfly,Bat,...)

Discussion of the old version of WRR_ZUP_INFO_v02.mq4 (i.e. ZUP_v67.01_WRR_ZUP_INFO.mq4) starts around page 11, post 108 of this thread:
Price Patterns(Gartley,Butterfly,Bat,...)

This new version, WRR_ZUP_INFO_v02.mq4 is found on page 26, post 251 - 254 on this thread.
Price Patterns(Gartley,Butterfly,Bat,...)

A further discussion of harmonic patterns is found on this thread:
Harmonic Trading

1 comment:

  1. I would like to recommend that you stick with the #1 Forex broker - eToro.