Dissecting the ZUP indicator for EA development

Post Reply
User avatar
Freedom787
Trader
Posts: 30
Joined: Wed Mar 13, 2013 3:46 pm
Location: United States

Dissecting the ZUP indicator for EA development

Post by Freedom787 »

Coders Help Needed:

I began developing a multi-pair EA for trading Harmonic Patterns ( Gartley, Butterfly, Crab, etc) several months ago. I hit a big hangup when using different Zig Zag indicators to pull in the values. I would iterate through their variables to try to identify a pattern at every opportunity possible, but I am never able to grab the patterns as perfectly as the ZUP indicator.

I have tried multiple times to read the ZUP indicator and understand its logic; however, it is extremely cryptic and a hard piece of code to understand.

The following article is from the ZUP indicator. Attached is the Gartley 101, which gives me the same results without all the additional options as the ZUP (such as the pitchpork and others).

http://articles.mql4.com/376


Can anyone take this logic, and identify the red box ( Potential D, the entry area) in the form of code? Any Coder's help would be most appreciated.
You do not have the required permissions to view the files attached to this post.
fxprotrader
Trader
Posts: 26
Joined: Sat Jun 16, 2012 11:26 pm

Re: Dissecting the ZUP indicator for EA development

Post by fxprotrader »

Freedom787 wrote:Coders Help Needed:

I began developing a multi-pair EA for trading Harmonic Patterns ( Gartley, Butterfly, Crab, etc) several months ago. I hit a big hangup when using different Zig Zag indicators to pull in the values. I would iterate through their variables to try to identify a pattern at every opportunity possible, but I am never able to grab the patterns as perfectly as the ZUP indicator.

I have tried multiple times to read the ZUP indicator and understand its logic; however, it is extremely cryptic and a hard piece of code to understand.

The following article is from the ZUP indicator. Attached is the Gartley 101, which gives me the same results without all the additional options as the ZUP (such as the pitchpork and others).

http://articles.mql4.com/376


Can anyone take this logic, and identify the red box ( Potential D, the entry area) in the form of code? Any Coder's help would be most appreciated.
Freedom787-
We know the RECT name is PointD w/a prefix and its the only Red object
color xClrRngForPntD=Red;

Starting at Line 2076.

Code: Select all

        if(RngForPntD>0)
         {
            if(FlgForD)
            {
               for(j=aXABCD[D];j<aXABCD[C]-1;j++)
               {
                  if(vBllBr==vBull)
                  {
                     if(LvlForDmx>=Low[j])TmForDmx=Time[j];
                  }
                  else if(vBllBr==vBear)
                  {
                     if(LvlForDmn<=High[j])TmForDmn=Time[j];
                  }
               }
               if(vBllBr==vBull)
               {
                  TmForDmn=TmForDmx+((LvlForDmx-LvlForDmn)/((zz[aXABCD[C]]-zz[aXABCD[D]])/(aXABCD[C]-aXABCD[D]+1)))*Period()*60;
               }
               else if(vBllBr==vBear)
               {
                  TmForDmx=TmForDmn+((LvlForDmx-LvlForDmn)/((zz[aXABCD[D]]-zz[aXABCD[C]])/(aXABCD[C]-aXABCD[D]+1)))*Period()*60;
               }
               nameOb="_"+xCmplkt+"PointD";
               ObjectCreate(nameOb,OBJ_RECTANGLE,0,TmForDmn,LvlForDmn,TmForDmx,LvlForDmx);
               ObjectSet(nameOb,OBJPROP_BACK,false);
               ObjectSet(nameOb,OBJPROP_COLOR,xClrRngForPntD);
               
               Comment("\nLvlForDmn         =  " + DoubleToStr(LvlForDmn,4),
                       "\nLvlForDmx         =  " + DoubleToStr(LvlForDmx,4));
               
I haven't tried this but I would start with triggering a trade where the RECT code gets called. This being a ZigZag there will be a huge delay in getting a signal that does not repaint.
Post Reply

Return to “Coders Hangout”