Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/forex/public_html/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/forex/public_html/wp-settings.php on line 18
W :forex decode

W Archives

WSOWROTrend.mq4

//+------------------------------------------------------------------+
//|                                       Ind-WSO+WRO+Trend Line.mq4 |
//|                    Copyright ?2004, http://www.expert-mt4.nm.ru |
//|                                      http://www.expert-mt4.nm.ru |
//+------------------------------------------------------------------+
#property copyright "nsi2000"
#property link      "http://www.expert-mt4.nm.ru"

#property indicator_chart_window
//---- input parameters
extern int nPeriod=9;
extern int Limit=350;
///---- int Widners Oscilator
int cnt,nCurBar=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- Output in Char
   for(cnt=0; cnt<=5; cnt++)
    {
      ObjectCreate("WSO-"+cnt,OBJ_HLINE,0,0,0);
      ObjectSet("WSO-"+cnt,OBJPROP_COLOR,Red);
   if(cnt<5)
      {
      ObjectCreate("Trend DN-"+cnt,OBJ_TREND,0,0,0,0,0);
      ObjectSet("Trend DN-"+cnt,OBJPROP_COLOR,Red);
      }
//----
      ObjectCreate("WRO-"+cnt,OBJ_HLINE,0,0,0);
      ObjectSet("WRO-"+cnt,OBJPROP_COLOR,Blue);
   if(cnt<5)
      {
      ObjectCreate("Trend UP-"+cnt,OBJ_TREND,0,0,0,0,0);
      ObjectSet("Trend Up-"+cnt,OBJPROP_COLOR,Blue);
      }
    }
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   for(cnt=0; cnt<=5; cnt++)
      {
      ObjectDelete("Trend UP-"+cnt);
      ObjectDelete("Trend DN-"+cnt);
      ObjectDelete("WSO-"+cnt);
      ObjectDelete("WRO-"+cnt);
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//---- TODO: add your code here
   double r1,r2,r3,r4,r5,r6;
   int rt1,rt2,rt3,rt4,rt5,rt6;
   double s1,s2,s3,s4,s5,s6;
   int st1,st2,st3,st4,st5,st6;
//---- ?????????? ??????
if(Bars<Limit) Limit=Bars-nPeriod;
for(nCurBar=Limit; nCurBar>0; nCurBar--)
   {
   if(Low[nCurBar+(nPeriod-1)/2] == Low[Lowest(NULL,0,MODE_LOW,nPeriod,nCurBar)])
      {
      s6=s5; s5=s4; s4=s3; s3=s2; s2=s1; s1=Low[nCurBar+(nPeriod-1)/2];
      st6=st5; st5=st4; st4=st3; st3=st2; st2=st1; st1=nCurBar+(nPeriod-1)/2;
      }
   if(High[nCurBar+(nPeriod-1)/2] == High[Highest(NULL,0,MODE_HIGH,nPeriod,nCurBar)])
      {
      r6=r5; r5=r4; r4=r3; r3=r2; r2=r1; r1=High[nCurBar+(nPeriod-1)/2];
      rt6=rt5; rt5=rt4; rt4=rt3; rt3=rt2; rt2=rt1; rt1=nCurBar+(nPeriod-1)/2;
      }
   }
//---- Move Object in Chart
ObjectMove("WSO-0",0,Time[st1],s1);
ObjectMove("Trend DN-0",1,Time[st1],s1);
ObjectMove("Trend DN-0",0,Time[st2],s2);
ObjectMove("WSO-1",0,Time[st2],s2);
ObjectMove("Trend DN-1",1,Time[st2],s2);
ObjectMove("Trend DN-1",0,Time[st3],s3);
ObjectMove("WSO-2",0,Time[st3],s3);
ObjectMove("Trend DN-2",1,Time[st3],s3);
ObjectMove("Trend DN-2",0,Time[st4],s4);
ObjectMove("WSO-3",0,Time[st4],s4);
ObjectMove("Trend DN-3",1,Time[st4],s4);
ObjectMove("Trend DN-3",0,Time[st5],s5);
ObjectMove("WSO-4",0,Time[st5],s5);
ObjectMove("Trend DN-4",1,Time[st5],s5);
ObjectMove("Trend DN-4",0,Time[st6],s6);
ObjectMove("WSO-5",0,Time[st6],s6);
//----
ObjectMove("WRO-0",0,Time[rt1],r1);
ObjectMove("Trend UP-0",1,Time[rt1],r1);
ObjectMove("Trend UP-0",0,Time[rt2],r2);
ObjectMove("WRO-1",0,Time[rt2],r2);
ObjectMove("Trend UP-1",1,Time[rt2],r2);
ObjectMove("Trend UP-1",0,Time[rt3],r3);
ObjectMove("WRO-2",0,Time[rt3],r3);
ObjectMove("Trend UP-2",1,Time[rt3],r3);
ObjectMove("Trend UP-2",0,Time[rt4],r4);
ObjectMove("WRO-3",0,Time[rt4],r4);
ObjectMove("Trend UP-3",1,Time[rt4],r4);
ObjectMove("Trend UP-3",0,Time[rt5],r5);
ObjectMove("WRO-4",0,Time[rt5],r5);
ObjectMove("Trend UP-4",1,Time[rt5],r5);
ObjectMove("Trend UP-4",0,Time[rt6],r6);
ObjectMove("WRO-5",0,Time[rt6],r6);
//----
   return(0);
  }
//--------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

WPRslow.mq4

//+------------------------------------------------------------------+
//|                                                      WPRslow.mq4 |
//|                                                                  |
//|                                        Ramdass - Conversion only |
//+------------------------------------------------------------------+
#property  copyright "Author - OlegVS"

#property indicator_separate_window
#property indicator_minimum -1.000000
#property indicator_maximum 1.000000
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int P=54;
extern int n1=9;
extern int n2=49;
extern int CountBars=300;
//---- buffers
double Up[];
double Down[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,Blue);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,Red);
   SetIndexBuffer(0,Up);
   SetIndexBuffer(1,Down);
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| WPRslow                                                          |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+P);
   SetIndexDrawBegin(1,Bars-CountBars+P);
   int i,counted_bars=IndicatorCounted();
   double V1,V2;
//----
   if(CountBars<=P) return(0);
//---- initial zero
   if(counted_bars<1)
   {
      for(i=1;i<=P;i++) Up[CountBars-i]=0.0;
      for(i=1;i<=P;i++) Down[CountBars-i]=0.0;
   }
//----
   i=CountBars-P-1;
   while(i>=0)
     {
Down[i]=0.0; Up[i]=0.0;
V1=iWPR(NULL,0,P,i)*iWPR(NULL,0,P,i)/100;
V2=MathCeil(V1);
if (V2<n1) {Up[i]=V2;}
if (V2>n2) {Down[i]=-(V2);}

      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

WPRfast.mq4

//+------------------------------------------------------------------+
//|                                                      WPRfast.mq4 |
//|                                                                  |
//|                                        Ramdass - Conversion only |
//+------------------------------------------------------------------+
#property  copyright "Author - OlegVS"

#property indicator_separate_window
#property indicator_minimum -1.000000
#property indicator_maximum 1.000000
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int P=9;
extern int n1=9;
extern int n2=49;
extern int CountBars=300;
//---- buffers
double Up[];
double Down[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,Blue);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,Red);
   SetIndexBuffer(0,Up);
   SetIndexBuffer(1,Down);
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| WPRfast                                                          |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+P);
   SetIndexDrawBegin(1,Bars-CountBars+P);
   int i,counted_bars=IndicatorCounted();
   double V1,V2;
//----
   if(CountBars<=P) return(0);
//---- initial zero
   if(counted_bars<1)
   {
      for(i=1;i<=P;i++) Up[CountBars-i]=0.0;
      for(i=1;i<=P;i++) Down[CountBars-i]=0.0;
   }
//----
   i=CountBars-P-1;
   while(i>=0)
     {
Down[i]=0.0; Up[i]=0.0;
V1=iWPR(NULL,0,P,i)*iWPR(NULL,0,P,i)/100;
V2=MathCeil(V1);
if (V2<n1) {Up[i]=V2;}
if (V2>n2) {Down[i]=-(V2);}

      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

WoodiesCCI.mq4

//+------------------------------------------------------------------+
//|                                                   WoodiesCCI.mq4 |
//|                                                             Rosh |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "created by Luis Damiani; converted by Rosh"
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 DeepSkyBlue
#property indicator_color3 DimGray
//---- input parameters
extern int       A_period=14;
extern int       B_period=6;
extern int       num_bars=550;
// parameters
int shift=0;
bool initDone=true; // ?? init
int bar=0;
int prevbars=0;
int startpar=0;  // ?? start
int cs=0;
int prevcs=0;
string commodt="nonono";
int frame=0;
int bars=0;

//---- buffers
double FastWoodieCCI[];
double SlowWoodieCCI[];
double HistoWoodieCCI[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,FastWoodieCCI);
   SetIndexStyle(1,DRAW_LINE,1,3);
   SetIndexBuffer(1,SlowWoodieCCI);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexBuffer(2,HistoWoodieCCI);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//---- TODO: add your code here
cs= A_period+B_period+num_bars; //checksum used to see if parameters have been changed
if ((cs==prevcs)&&(commodt==Symbol())&&(frame==(Time[4]-Time[5]))&&((Bars-prevbars)<2)) startpar=Bars-prevbars; else startpar=-1;  //params haven't changed only need to calculate new bar
commodt=Symbol();
frame=Time[4]-Time[5];
prevbars = Bars;
prevcs = cs;
if (startpar==1 | startpar==0)  bar=startpar; else initDone = true;

if (initDone)
   {
   FastWoodieCCI[num_bars-1]=0;
   SlowWoodieCCI[num_bars-1]=0;
   HistoWoodieCCI[num_bars-1]=0;
   //SetIndexValue(num_bars-1, 0);
   //SetIndexValue2(num_bars-1, 0);
   bar=num_bars-2;
   initDone=false;
   }

//SetLoopCount(0);
for (shift = bar;shift>=0;shift--)
   {
   FastWoodieCCI[shift]=iCCI(NULL,0,B_period,PRICE_TYPICAL,shift);
   SlowWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);
   HistoWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);
   //SetIndexValue(shift,iCCIEx(A_period,PRICE_TYPICAL,shift));
   //SetIndexValue2(shift,iCCIEx(B_period,PRICE_TYPICAL,shift));
   }

//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

WolfWave_nen.mq4

//+------------------------------------------------------------------+
//| A WolfWave finder based on ZIGZAG.MQ4                            |
//| fukinagashi a t gmx p o i n t net
//| Patched by Nen @  http://onix-trade.net/forum/index.php?showtopic=373
//| Patched again by Maumax                                         |
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 Blue
#define MaxAnalyze 200
#define UpperDistance 15
#define LowerDistance 5
#define Title "WW"

//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=3;
extern int ExtBackstep=2;

//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];
int timeFirstBar=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);
//---- drawing settings

   SetIndexStyle(0,DRAW_SECTION);
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtMapBuffer);
   SetIndexBuffer(1,ExtMapBuffer2);

   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);

   ArraySetAsSeries(ExtMapBuffer,true);
   ArraySetAsSeries(ExtMapBuffer2,true);
//---- indicator short name
   IndicatorShortName("WolfWave");
//---- initialization done

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
      for (int i=1;i<=5;i++)
       {
         ObjectDelete(Title + ""+i);
       }

      ObjectDelete(Title + "Line-2-4");
      ObjectDelete(Title + "Line-1-3");
      ObjectDelete(Title + "Line-1-4");
      ObjectDelete(Title + "Line-2-5");
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int    shift, back,lasthighpos,lastlowpos;
   double val,res;
   double curlow,curhigh,lasthigh,lastlow;
   int num=0;

   int Peak[MaxAnalyze],h,i,j;
   int Wolf[6];
   string WolfWave="None";
   double Winkel1, Winkel2;
   bool found=false;

   //----+ ???? ????? ???? ????????? ???????????????
   if (Bars-1<ExtDepth)return(0);
   //----+ ???? ???????? ??? ?? ?????????? ??? ? ??????? ???
   static int time2,time3,time4;
   //----+ ???? ????? ????????? ?? ?????????? ??? ? ??????? ???
   static  double ZigZag2,ZigZag3,ZigZag4;
   //----+ ???? ???????? ?? ?????????? ??? ? ??????? ????????????????? ???
   int MaxBar,limit,supr2_bar,supr3_bar,supr4_bar;
   //---- ???? ? ????????
   if (counted_bars<0)return(-1);
   //---- ??????????? ????? ?? ?????
   if (counted_bars>0) counted_bars--;
   //---- ????????? ??? ??????, ???? ????? ??????????????? ?? ???
   MaxBar=Bars-ExtDepth;
   //---- ????????? ?????  ?? ???? ???? ????? ?????????  ???? ??????
   if (counted_bars==0 || Bars-counted_bars>2)
     {
      limit=MaxBar;
     }
   else
     {
      //----
      supr2_bar=iBarShift(NULL,0,time2,TRUE);
      supr3_bar=iBarShift(NULL,0,time3,TRUE);
      supr4_bar=iBarShift(NULL,0,time4,TRUE);
      //----
      limit=supr3_bar;
      if ((supr2_bar<0)||(supr3_bar<0)||(supr4_bar<0))
         {
          limit=MaxBar;
         }
     }

   //---- ??????? ??
   if (limit>=MaxBar || timeFirstBar!=Time[Bars-1])
     {
      timeFirstBar=Time[Bars-1];
      for (shift=Bars-1; shift>0;shift--) {ExtMapBuffer[shift]=0.0; ExtMapBuffer2[shift]=0.0;}
      limit=MaxBar;
     }
   //----

   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      val=Low[Lowest(NULL,0,MODE_LOW,ExtDepth,shift)];
      if(val==lastlow) val=0.0;
      else
        {
         lastlow=val;
         if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer[shift+back];
               if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0;
              }
           }
        }
      if (Low[shift]==val) ExtMapBuffer[shift]=val;
      //--- high
      val=High[Highest(NULL,0,MODE_HIGH,ExtDepth,shift)];
      if(val==lasthigh) val=0.0;
      else
        {
         lasthigh=val;
         if((val-High[shift])>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer2[shift+back];
               if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0;
              }
           }
        }
      if (High[shift]==val) ExtMapBuffer2[shift]=val;
     }

   // final cutting
   lasthigh=-1; lasthighpos=-1;
   lastlow=-1;  lastlowpos=-1;

   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      curlow=ExtMapBuffer[shift];
      curhigh=ExtMapBuffer2[shift];
      if((curlow==0)&&(curhigh==0)) continue;
      //---
      if(curhigh!=0)
        {
         if(lasthigh>0)
           {
            if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;
            else ExtMapBuffer2[shift]=0;
           }
         //---
         if(lasthigh<curhigh || lasthigh<0)
           {
            lasthigh=curhigh;
            lasthighpos=shift;
           }
         lastlow=-1;
        }
      //----
      if(curlow!=0)
        {
         if(lastlow>0)
           {
            if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;
            else ExtMapBuffer[shift]=0;
           }
         //---
         if((curlow<lastlow)||(lastlow<0))
           {
            lastlow=curlow;
            lastlowpos=shift;
           }
         lasthigh=-1;
        }
     }

   for(shift=Bars-1; shift>=0; shift--)
     {
      if(shift>=Bars-ExtDepth) ExtMapBuffer[shift]=0.0;
      else
        {
         res=ExtMapBuffer2[shift];
         //if(res!=0.0) ExtMapBuffer[shift]=res;
         if(res>0.0) ExtMapBuffer[shift]=res;
        }
     }

   // ???? ??????
   i=0;j=0;
   res=0;
   for (shift=0;i<3;shift++)
     {
      if (ExtMapBuffer[shift]>0)
        {
         i++;
         if (i==1 && ExtMapBuffer[shift]==High[shift])
           {
            j=shift;
            res=ExtMapBuffer[shift];
           }
         if (i==2 && res>0 && ExtMapBuffer[shift]==High[shift])
           {
            if (ExtMapBuffer[shift]>=ExtMapBuffer[j]) ExtMapBuffer[j]=0; else ExtMapBuffer[shift]=0;
            res=0;
            i=0;
            j=0;
            shift=0;
           }
        }
     }

   //+--- ??????? ???? ??????????? ????????? ????
   if (limit<MaxBar)
     {
      ExtMapBuffer[supr2_bar]=ZigZag2;
      ExtMapBuffer[supr3_bar]=ZigZag3;
      ExtMapBuffer[supr4_bar]=ZigZag4;
      for(int qqq=supr4_bar-1; qqq>supr3_bar; qqq--)ExtMapBuffer[qqq]=0;
      for(int ggg=supr3_bar-1; ggg>supr2_bar; ggg--)ExtMapBuffer[ggg]=0;
     }
   //+---+============================================+

   //+--- ???????????????
   double vel1, vel2, vel3, vel4;
   int bar1, bar2, bar3, bar4;
   int count;
   if (limit==MaxBar)supr4_bar=MaxBar;
   for(int bar=supr4_bar; bar>=0; bar--)
    {
     if (ExtMapBuffer[bar]!=0)
      {
       count++;
       vel4=vel3;bar4=bar3;
       vel3=vel2;bar3=bar2;
       vel2=vel1;bar2=bar1;
       vel1=ExtMapBuffer[bar];bar1=bar;
       if (count<3)continue;
       if ((vel3<vel2)&&(vel2<vel1)){ExtMapBuffer[bar2]=0;bar=bar3+1;}
       if ((vel3>vel2)&&(vel2>vel1)){ExtMapBuffer[bar2]=0;bar=bar3+1;}
       if ((vel2==vel1)&&(vel1!=0 )){ExtMapBuffer[bar1]=0;bar=bar3+1;}
     }
    }
   //+--- ???????????? ??????????????????? ????? ??? ???
   time2=Time[bar2];
   time3=Time[bar3];
   time4=Time[bar4];
   ZigZag2=vel2;
   ZigZag3=vel3;
   ZigZag4=vel4;
   //+---

// Basic Modification ==>

   i=0;
   for(h=0; h<Bars && i<MaxAnalyze; h++)
   {
      if ((ExtMapBuffer[h]!=0) || (ExtMapBuffer2[h]!=0)) {
         Peak[i]= h;
         i++;
      }
   }

   for(j=0;j<i && j<MaxAnalyze && found==false;j++) {
      Wolf[1]=Peak[j+4]; // 1 High
      Wolf[2]=Peak[j+3]; // 2 Low
      Wolf[3]=Peak[j+2]; // 3 High
      Wolf[4]=Peak[j+1]; // 4 Low
      Wolf[5]=Peak[j+0]; // 5 High
      if (     // Buy Wolfwave
         Low[Wolf[1]]<High[Wolf[2]] &&  // 1. + 3.a.//1-3
         Low[Wolf[3]]<Low[Wolf[1]] &&   // 2. + 3.b. //3-1
         Low[Wolf[3]]<High[Wolf[4]]  // 4//3-4
         ) {
            WolfWave="Buy";
      } else if
         (     // Sell Wolfwave
         High[Wolf[1]]>Low[Wolf[2]] &&  // 1. + 3.a.
         High[Wolf[3]]>High[Wolf[1]] &&   // 2. + 3.b.
         High[Wolf[3]]>Low[Wolf[4]]  // 4
         ) {
            WolfWave="Sell";
         } else {
            WolfWave="Not";
      }

      if(WolfWave=="Buy") {
      	ObjectCreate(Title + "Line-1-3", OBJ_TREND, 0, Time[Wolf[1]],Low[Wolf[1]], Time[Wolf[3]],Low[Wolf[3]] );
        //	ObjectSet(Title + "Line-1-3",OBJPROP_RAY,0);
        	ObjectSet(Title + "Line-1-3", OBJPROP_COLOR, Lime);
          	ObjectSet(Title + "Line-1-3", OBJPROP_WIDTH, 2);
          //	ObjectSet(Title + "Line-1-3",OBJPROP_BACK,1);

        	if (ObjectGetValueByShift(Title + "Line-1-3", Wolf[3]) >= Low[Wolf[3]]) {
           	ObjectCreate(Title + "1", OBJ_TEXT, 0, Time[Wolf[1]],Low[Wolf[1]]-LowerDistance*Point );
           	ObjectSetText(Title + "1", ""+DoubleToStr(1,0), 10, "Arial", Blue);
           	ObjectCreate(Title + "2", OBJ_TEXT, 0, Time[Wolf[2]],High[Wolf[2]]+UpperDistance*Point );
           	ObjectSetText(Title + "2", ""+DoubleToStr(2,0), 10, "Arial", Blue);
           	ObjectCreate(Title + "3", OBJ_TEXT, 0, Time[Wolf[3]],Low[Wolf[3]]-LowerDistance*Point );
           	ObjectSetText(Title + "3", ""+DoubleToStr(3,0), 10, "Arial", Blue);
           	ObjectCreate(Title + "4", OBJ_TEXT, 0, Time[Wolf[4]],High[Wolf[4]]+UpperDistance*Point );
           	ObjectSetText(Title + "4", ""+DoubleToStr(4,0), 10, "Arial", Blue);
           	ObjectCreate(Title + "5", OBJ_TEXT, 0, Time[Wolf[5]],Low[Wolf[5]]-LowerDistance*Point );
           	ObjectSetText(Title + "5", ""+DoubleToStr(5,0), 10, "Arial", Blue);

           	ObjectCreate(Title + "Line-1-4", OBJ_TREND, 0, Time[Wolf[1]],Low[Wolf[1]], Time[Wolf[4]],High[Wolf[4]] );
           	ObjectSet(Title + "Line-1-4", OBJPROP_COLOR, Red);
           //	ObjectSet(Title + "Line-1-4",OBJPROP_RAY,0);
           	ObjectSet(Title,OBJPROP_STYLE,STYLE_DOT);
          	ObjectSet(Title + "Line-1-4", OBJPROP_WIDTH, 0);
          	ObjectSet(Title + "Line-1-4",OBJPROP_BACK,0);
          	ObjectSet(Title + "Line-2-5",OBJPROP_BACK,0);

          //	ObjectCreate(Title + "Line-2-5", OBJ_TREND, 0, Time[Wolf[2]],High[Wolf[2]], Time[Wolf[5]],Low[Wolf[5]] );
            //ObjectSet(Title,OBJPROP_STYLE,STYLE_DOT);
           // ObjectSet(Title + "Line-2-5",OBJPROP_RAY,0);
            //ObjectSet(Title + "Line-2-5", OBJPROP_COLOR, Lime);
           // ObjectSet(Title + "Line-2-5", OBJPROP_WIDTH, 1);

           //	Comment("Buy Wolfwave (" + TimeToStr(Time[Wolf[5]],TIME_DATE|TIME_MINUTES) + ") at " + (ObjectGetValueByShift("Line-1-3", Wolf[5])-5*Point) + " SL " + High[Wolf[5]]);
          	// found=true;
         //} //else {
           // ObjectDelete(Title + "Line-1-3");
         }
      } else if (WolfWave=="Sell") {
            ObjectCreate(Title + "Line-1-3", OBJ_TREND, 0, Time[Wolf[1]],High[Wolf[1]], Time[Wolf[3]],High[Wolf[3]] );
         //ObjectSet(Title + "Line-1-3",OBJPROP_RAY,0);
         	ObjectSet(Title + "Line-1-3", OBJPROP_COLOR, Lime);
          	ObjectSet(Title + "Line-1-3", OBJPROP_WIDTH, 2);
          //	ObjectSet(Title + "Line-1-3",OBJPROP_BACK,1);

         if ( ObjectGetValueByShift(Title + "Line-1-3", Wolf[3]) <= High[Wolf[3]] ) {
           	ObjectCreate(Title + "1", OBJ_TEXT, 0, Time[Wolf[1]],High[Wolf[1]]+UpperDistance*Point );
            ObjectSetText(Title + "1", ""+DoubleToStr(1,0), 10, "Arial", Blue);
            ObjectCreate(Title + "2", OBJ_TEXT, 0, Time[Wolf[2]],Low[Wolf[2]]-LowerDistance*Point );
            ObjectSetText(Title + "2", ""+DoubleToStr(2,0), 10, "Arial", Blue);
            ObjectCreate(Title + "3", OBJ_TEXT, 0, Time[Wolf[3]],High[Wolf[3]]+UpperDistance*Point );
            ObjectSetText(Title + "3", ""+DoubleToStr(3,0), 10, "Arial", Blue);
            ObjectCreate(Title + "4", OBJ_TEXT, 0, Time[Wolf[4]],Low[Wolf[4]]-LowerDistance*Point );
            ObjectSetText(Title + "4", ""+DoubleToStr(4,0), 10, "Arial", Blue);
            ObjectCreate(Title + "5", OBJ_TEXT, 0, Time[Wolf[5]],High[Wolf[5]]+UpperDistance*Point );
            ObjectSetText(Title + "5", ""+DoubleToStr(5,0), 10, "Arial", Blue);

            ObjectCreate(Title + "Line-1-4", OBJ_TREND, 0, Time[Wolf[1]],High[Wolf[1]], Time[Wolf[4]],Low[Wolf[4]] );
            ObjectSet(Title + "Line-1-4", OBJPROP_COLOR, Red);
            //ObjectSet(Title + "Line-1-4",OBJPROP_RAY,0);
            ObjectSet(Title,OBJPROP_STYLE,STYLE_DOT);
            ObjectSet(Title + "Line-1-4", OBJPROP_WIDTH, 0);
            ObjectSet(Title + "Line-1-4",OBJPROP_BACK,0);

           // ObjectCreate(Title + "Line-2-5", OBJ_TREND, 0, Time[Wolf[2]],Low[Wolf[2]], Time[Wolf[5]],High[Wolf[5]] );
           //// ObjectSet(Title,OBJPROP_STYLE,STYLE_DOT);
           // ObjectSet(Title + "Line-2-5",OBJPROP_RAY,0);
           // ObjectSet(Title + "Line-2-5", OBJPROP_COLOR, Yellow);
           // ObjectSet(Title + "Line-2-5", OBJPROP_WIDTH, 1);
          //  ObjectSet(Title + "Line-2-5",OBJPROP_BACK,0);

            // found=true;
         } //else {
                //ObjectDelete(Title + "Line-1-3");
                 ObjectsRedraw();
         //}
      }
   }
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

Wolf.mq4

//+------------------------------------------------------------------+
//| A WolfWave finder based on ZIGZAG.MQ4                            |
//| fukinagashi a t gmx p o i n t net                                              |
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#define MaxAnalyze 200
#define UpperDistance 5
#define LowerDistance 5
#define Title "WW"

//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;

//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);
//---- drawing settings

   SetIndexStyle(0,DRAW_SECTION);
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtMapBuffer);
   SetIndexBuffer(1,ExtMapBuffer2);

   SetIndexEmptyValue(0,0.0);

   ArraySetAsSeries(ExtMapBuffer,true);
   ArraySetAsSeries(ExtMapBuffer2,true);
//---- indicator short name
   IndicatorShortName("WolfWave");
//---- initialization done

   return(0);
  }

int deinit()
{
      for (int i=1;i<=5;i++) {
         ObjectDelete(Title + ""+i);
      }

      ObjectDelete(Title + "Line-2-4");
      ObjectDelete(Title + "Line-1-3");
      ObjectDelete(Title + "Line-1-4");
      }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int    shift, back,lasthighpos,lastlowpos;
   double val,res;
   double curlow,curhigh,lasthigh,lastlow;
   int num=0;

   int Peak[MaxAnalyze],h,i,j;
   int Wolf[6];
   string WolfWave="None";
   double Winkel1, Winkel2;
   bool found=false;

   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      val=Low[Lowest(NULL,0,MODE_LOW,ExtDepth,shift)];
      if(val==lastlow) val=0.0;
      else
        {
         lastlow=val;
         if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer[shift+back];
               if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0;
              }
           }
        }
      ExtMapBuffer[shift]=val;
      //--- high
      val=High[Highest(NULL,0,MODE_HIGH,ExtDepth,shift)];
      if(val==lasthigh) val=0.0;
      else
        {
         lasthigh=val;
         if((val-High[shift])>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer2[shift+back];
               if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0;
              }
           }
        }
      ExtMapBuffer2[shift]=val;
     }

   // final cutting
   lasthigh=-1; lasthighpos=-1;
   lastlow=-1;  lastlowpos=-1;

   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      curlow=ExtMapBuffer[shift];
      curhigh=ExtMapBuffer2[shift];
      if((curlow==0)&&(curhigh==0)) continue;
      //---
      if(curhigh!=0)
        {
         if(lasthigh>0)
           {
            if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;
            else ExtMapBuffer2[shift]=0;
           }
         //---
         if(lasthigh<curhigh || lasthigh<0)
           {
            lasthigh=curhigh;
            lasthighpos=shift;
           }
         lastlow=-1;
        }
      //----
      if(curlow!=0)
        {
         if(lastlow>0)
           {
            if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;
            else ExtMapBuffer[shift]=0;
           }
         //---
         if((curlow<lastlow)||(lastlow<0))
           {
            lastlow=curlow;
            lastlowpos=shift;
           }
         lasthigh=-1;
        }
     }

   for(shift=Bars-1; shift>=0; shift--)
     {
      if(shift>=Bars-ExtDepth) ExtMapBuffer[shift]=0.0;
      else
        {
         res=ExtMapBuffer2[shift];
         //if(res!=0.0) ExtMapBuffer[shift]=res;
         if(res>0.0) ExtMapBuffer[shift]=res;
        }
     }

// Basic Modification ==>

	i=0;
   for(h=0; h<Bars && i<MaxAnalyze; h++)
   {
      if ((ExtMapBuffer[h]!=0) || (ExtMapBuffer2[h]!=0)) {
         Peak[i]= h;
         i++;
      }
   }

   for(j=0;j<i && j<MaxAnalyze && found==false;j++) {
      Wolf[1]=Peak[j+4]; // 1 High
      Wolf[2]=Peak[j+3]; // 2 Low
      Wolf[3]=Peak[j+2]; // 3 High
      Wolf[4]=Peak[j+1]; // 4 Low
      Wolf[5]=Peak[j+0]; // 5 High
      if (     // Buy Wolfwave
         Low[Wolf[1]]<High[Wolf[2]] &&  // 1. + 3.a.
         Low[Wolf[3]]<Low[Wolf[1]] &&   // 2. + 3.b.
         Low[Wolf[3]]<High[Wolf[4]]  // 4
         ) {
            WolfWave="Buy";
      } else if
         (     // Sell Wolfwave
         High[Wolf[1]]>Low[Wolf[2]] &&  // 1. + 3.a.
         High[Wolf[3]]>High[Wolf[1]] &&   // 2. + 3.b.
         High[Wolf[3]]>Low[Wolf[4]]  // 4
         ) {
            WolfWave="Sell";
         } else {
            WolfWave="Not";
      }

      if(WolfWave=="Buy") {
        	ObjectCreate(Title + "Line-1-3", OBJ_TREND, 0, Time[Wolf[1]],Low[Wolf[1]], Time[Wolf[3]],Low[Wolf[3]] );
        	if (ObjectGetValueByShift(Title + "Line-1-3", Wolf[5]) >= Low[Wolf[5]]) {
           	ObjectCreate(Title + "1", OBJ_TEXT, 0, Time[Wolf[1]],Low[Wolf[1]]-LowerDistance*Point );
           	ObjectSetText(Title + "1", ""+DoubleToStr(1,0), 10, "Arial", Red);
           	ObjectCreate(Title + "2", OBJ_TEXT, 0, Time[Wolf[2]],High[Wolf[2]]+UpperDistance*Point );
           	ObjectSetText(Title + "2", ""+DoubleToStr(2,0), 10, "Arial", Red);
           	ObjectCreate(Title + "3", OBJ_TEXT, 0, Time[Wolf[3]],Low[Wolf[3]]-LowerDistance*Point );
           	ObjectSetText(Title + "3", ""+DoubleToStr(3,0), 10, "Arial", Red);
           	ObjectCreate(Title + "4", OBJ_TEXT, 0, Time[Wolf[4]],High[Wolf[4]]+UpperDistance*Point );
           	ObjectSetText(Title + "4", ""+DoubleToStr(4,0), 10, "Arial", Red);
           	ObjectCreate(Title + "5", OBJ_TEXT, 0, Time[Wolf[5]],Low[Wolf[5]]-LowerDistance*Point );
           	ObjectSetText(Title + "5", ""+DoubleToStr(5,0), 10, "Arial", Red);
           	ObjectCreate(Title + "Line-1-4", OBJ_TREND, 0, Time[Wolf[1]],Low[Wolf[1]], Time[Wolf[4]],High[Wolf[4]] );
           	ObjectSet(Title + "Line-1-4", OBJPROP_COLOR, LimeGreen);
          	ObjectSet(Title + "Line-1-4", OBJPROP_WIDTH, 2);
           	Comment("Buy Wolfwave (" + TimeToStr(Time[Wolf[5]],TIME_DATE|TIME_MINUTES) + ") at " + (ObjectGetValueByShift("Line-1-3", Wolf[5])-5*Point) + " SL " + High[Wolf[5]]);
          	// found=true;
         } else {
            ObjectDelete(Title + "Line-1-3");
         }
      } else if (WolfWave=="Sell") {
         ObjectCreate(Title + "Line-1-3", OBJ_TREND, 0, Time[Wolf[1]],High[Wolf[1]], Time[Wolf[3]],High[Wolf[3]] );
         if ( ObjectGetValueByShift(Title + "Line-1-3", Wolf[5]) <= High[Wolf[5]] ) {
           	ObjectCreate(Title + "1", OBJ_TEXT, 0, Time[Wolf[1]],High[Wolf[1]]+UpperDistance*Point );
            ObjectSetText(Title + "1", ""+DoubleToStr(1,0), 10, "Arial", Red);
            ObjectCreate(Title + "2", OBJ_TEXT, 0, Time[Wolf[2]],Low[Wolf[2]]-LowerDistance*Point );
            ObjectSetText(Title + "2", ""+DoubleToStr(2,0), 10, "Arial", Red);
            ObjectCreate(Title + "3", OBJ_TEXT, 0, Time[Wolf[3]],High[Wolf[3]]+UpperDistance*Point );
            ObjectSetText(Title + "3", ""+DoubleToStr(3,0), 10, "Arial", Red);
            ObjectCreate(Title + "4", OBJ_TEXT, 0, Time[Wolf[4]],Low[Wolf[4]]-LowerDistance*Point );
            ObjectSetText(Title + "4", ""+DoubleToStr(4,0), 10, "Arial", Red);
            ObjectCreate(Title + "5", OBJ_TEXT, 0, Time[Wolf[5]],High[Wolf[5]]+UpperDistance*Point );
            ObjectSetText(Title + "5", ""+DoubleToStr(5,0), 10, "Arial", Red);
            ObjectCreate(Title + "Line-1-4", OBJ_TREND, 0, Time[Wolf[1]],High[Wolf[1]], Time[Wolf[4]],Low[Wolf[4]] );
            ObjectSet(Title + "Line-1-4", OBJPROP_COLOR, LimeGreen);
            ObjectSet(Title + "Line-1-4", OBJPROP_WIDTH, 2);
           	Comment("Sell Wolfwave (" + TimeToStr(Time[Wolf[5]],TIME_DATE|TIME_MINUTES) + ") at " + (ObjectGetValueByShift("Line-1-3", Wolf[5])-5*Point) + " SL " + High[Wolf[5]]);
            // found=true;
         } else {
           	ObjectDelete(Title + "Line-1-3");
         }
      }
   }
}

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

wlxFractals.mq4

//+------------------------------------------------------------------+
//|                                                  wlxFractals.mq4 |
//|         Copyright ?2004, by konKop, GOODMAN, Mstera, af + wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2004, by wellx"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DeepSkyBlue
#property indicator_color2 Red
//---- input parameters
extern int       Equals=5;
extern int       nLeftUp=2;
extern int       nRightUp=2;
extern int       nLeftDown=2;
extern int       nRightDown=2;
//---- buffers
double FractalsUp[];
double FractalsDown[];

int pos=0, cntup=0, cntdown=0, cnt=0;
int r=0,l=0,e=0;
int fup=0,fdown=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,217);
   SetIndexBuffer(0,FractalsUp);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,218);
   SetIndexBuffer(1,FractalsDown);
   SetIndexEmptyValue(1,0.0);

   cntup=nLeftUp+nRightUp+Equals+1;
   cntdown=nLeftDown+Equals+1;
   if (cntup>=cntdown) cnt=cntup;
   if (cntup<cntdown)  cnt=cntdown;
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i=0, j=0;
   int cbars=IndicatorCounted();
   if  (cbars<0) return(-1);
   if  (cbars>0) cbars--;

   pos=0;

   if (cbars > (Bars-cnt-1)) pos=(Bars-cnt-1);
   else pos=cbars+nRightUp;

   while (pos>=nRightUp)
    {
     FractalsUp[pos]  =NULL;
     FractalsDown[pos]=NULL;

     //???????
     r=nRightUp; //????? ??? ????????
     for (i=1;i<=r;i++)
     {
      if (High[pos]<=High[pos-i]) break;
     }

     //?? ??? ??? ? i ??? ?? ???r+1
     if (i==r+1) //FractalsUp[pos]=High[pos];
     {
      l=nLeftUp;  //????? ???????????
      e=Equals;
      for (j=1;j<=l+Equals;j++)
       {

        if (High[pos] < High[pos+j]) break;
        if (High[pos] > High[pos+j]) l--;
        if (High[pos] == High[pos+j])e--;
        if (l==0)
         {
           FractalsUp[pos]=High[pos];
           break;
         }
        if (e<0) break;
       }
     }

     //??????
     r=nRightDown; //????? ??? ????????
     for (i=1;i<=r;i++)
     {
      if (Low[pos]>=Low[pos-i]) break;
     }

     if (i==r+1) //FractalsUp[pos]=High[pos];
     {
      l=nLeftDown;  //????? ???????????
      e=Equals;
      for (j=1;j<=l+Equals;j++)
       {

        if (Low[pos] > Low[pos+j]) break;
        if (Low[pos] < Low[pos+j]) l--;
        if (Low[pos] == Low[pos+j])e--;
        if (l==0)
         {
           FractalsDown[pos]=Low[pos];
           break;
         }
        if (e<0) break;
       }
     }
    pos--;
    }
//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

wlxBWWiseMan-2.mq4

//+------------------------------------------------------------------+
//|                                               wlxBWWiseMan-2.mq4 |
//|                                          Copyright ?2005, wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, wellx"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkOrange
#property indicator_color2 Magenta

//---- input parameters

extern int       updown=8;
//---- buffers
double BWWM2Up[];
double BWWM2Down[];

int pos=0;
double AO,AO1,AO2,AO3,AO4;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,141);
   SetIndexBuffer(0,BWWM2Up);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,141);
   SetIndexBuffer(1,BWWM2Down);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int  cbars=IndicatorCounted();
   if  (cbars<0) return(-1);
   if  (cbars>0) cbars--;
//---- TODO: add your code here
   if (cbars > (Bars-40)) pos=(Bars-40);
   else pos=cbars;
//----
   while (pos > 0)
   {
    BWWM2Up[pos]=NULL;
    BWWM2Down[pos]=NULL;
    AO=iAO(NULL,0,pos);
    AO1=iAO(NULL,0,pos+1);
    AO2=iAO(NULL,0,pos+2);
    AO3=iAO(NULL,0,pos+3);
    AO4=iAO(NULL,0,pos+4);

    if (
        (AO4>0.0 && AO3>0.0 )
          &&
        (AO4<AO3 && AO3>AO2 && AO2>AO1 && AO1>AO)
       )
        BWWM2Up[pos]=(High[pos]+updown*Point);

    if (
        (AO4<0.0 && AO3<0.0 )
          &&
        (AO4>AO3 && AO3<AO2 && AO2<AO1 && AO1<AO)
       )
        BWWM2Down[pos]=(Low[pos]-updown*Point);
     pos--;
    }

    return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

wlxBWWiseMan-1.mq4

//+------------------------------------------------------------------+
//|                                                 BW-wiseMan-1.mq4 |
//|                                          Copyright ?2005, wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, wellx"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 OrangeRed

extern int  updown=5; //???? ????? ???? ???????? ???
extern int  back=2;   // ??? ????? ???????

//---- buffers
double BWWM1Up[];
double BWWM1Down[];

int pos=0;
int i=0;
bool contup=true,contdown=true;

//+-----------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,140);
   SetIndexBuffer(0,BWWM1Up);
   SetIndexEmptyValue(0,0.0);

   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,140);
   SetIndexBuffer(1,BWWM1Down);
   SetIndexEmptyValue(1,0.0);

   IndicatorDigits(6);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int  cbars=IndicatorCounted();
   if  (cbars<0) return(-1);
   if  (cbars>0) cbars--;
//---- TODO: add your code here
   //if (cbars == 0) return(0);
   pos=cbars;
   while (pos > 0)
   {
    BWWM1Up[pos]=NULL;
    BWWM1Down[pos]=NULL;

    if (
        (Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
         &&
        (Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
         &&
        (Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
         &&
        (Close[pos]<((High[pos]+Low[pos])/2))
       )
        {
           contup=true;
           for(i=1; i <= back ;i++)
               {
                 if (High[pos]<=High[pos+i])
                  {
                   contup=false;
                   break;
                  }
               }
           if (contup) BWWM1Up[pos]=(High[pos]+updown*Point);
        }

    if (
        (High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
         &&
        (High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
         &&
        (High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
         &&
        (Close[pos]>((High[pos]+Low[pos])/2))
       )
        {
           contdown=true;
           for(i=1; i <= back ;i++)
               {
                 if (Low[pos]>=Low[pos+i])
                  {
                   contdown=false;
                   break;
                  }
               }
           if (contdown) BWWM1Down[pos]=(Low[pos]-updown*Point);
        }

    pos--;
   }

//----
   return(0);
  }
//+------------------------------------------------------------------+

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

WisemanAO.mq4

//+------------------------------------------------------------------+
//|                                               wlxBWWiseMan-2.mq4 |
//|                                          Copyright ?2005, wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, wellx"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
//---- input parameters
extern int updown = 10;
extern bool UseAlert=true;
//---- buffers
double BWWM2Up[];
double BWWM2Down[];
string UD="";

//----
int pos = 0;
double AO, AO1, AO2, AO3, AO4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0, BWWM2Up);
   SetIndexBuffer(1, BWWM2Down);
//----
   SetIndexStyle(0, DRAW_ARROW, 0, 2);
   SetIndexStyle(1, DRAW_ARROW, 0, 2);
//----
   SetIndexArrow(0, 140);
   SetIndexArrow(1, 141);
//----
   IndicatorShortName("StrInd(" + updown + ")");
   SetIndexLabel(0, "StrIndUp");
   SetIndexLabel(1, "StrIndDn");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int cbars = IndicatorCounted();
//----
   if(cbars < 0)
       return(-1);
//----
   if(cbars > 0)
       cbars--;
//----
   if(cbars > (Bars - 40))
       pos = (Bars - 40);
   else
       pos = Bars - cbars;
//----
   while(pos > 0)
     {
       BWWM2Up[pos] = NULL;
       BWWM2Down[pos] = NULL;
       AO = iAO(NULL, 0, pos);
       AO1 = iAO(NULL, 0, pos + 1);
       AO2 = iAO(NULL, 0, pos + 2);
       AO3 = iAO(NULL, 0, pos + 3);
       AO4 = iAO(NULL, 0, pos + 4);
       //----
       if((AO4 > 0.0 && AO3 > 0.0) && (AO4 < AO3 && AO3 > AO2 && AO2 >AO1 && AO1 > AO))
           BWWM2Up[pos] = (High[pos] + updown*Point);
            if (pos < 2 )
  {
  UD=" Up.";
  DoAlert(UD);
  }

      //----
       if((AO4 < 0.0 && AO3 < 0.0) && (AO4 > AO3 && AO3 < AO2 && AO2 < AO1 && AO1 < AO))
           BWWM2Down[pos] = (Low[pos] - updown*Point);
            if (pos < 2 )
  {
  UD=" Down.";
  DoAlert(UD);
  }

       pos--;
     }
       return(0);

    //   SpeechText("There is an opportunity to buy or sell ",

    }
void DoAlert(string UD)
{
   if (!NewBar() || !UseAlert)
      return;
     Alert (Symbol()," ",Period(),"WisemanAO ",UD);

}

  bool NewBar()
{
   static datetime dt  = 0;
   if (dt != Time[0])
   {
      dt = Time[0];
      return(true);
   }

}

[Post to Twitter] Tweet This Post  [Post to Delicious] Delicious This Post  [Post to Ping.fm] Ping This Post  [Post to StumbleUpon] Stumble This Post 

 Page 1 of 3  1  2  3 »

Tweet This Post links powered by Tweet This v1.3.9, a WordPress plugin for Twitter.