Venerdì, Novembre 17, 2017
   
Text Size

Forex EA.

Forex Expert.

Forex Expert.

Forex Expert

Opzioni Forex.

Esempio di aspetto di una sezione blog (sezione FAQ)

Indicatore Metatrader - AutoDayFibs

//+------------------------------------------------------------------+
//|                                                AutoDayFibs V1.0  |
//|                                                                  |
//|              Copyright © 2005, Jason Robinson                    |
//|               (jasonrobinsonuk,  jnrtrading)                     |
//|                http://www.jnrtrading.co.uk                       |
//|                                                                  |
//|                    Created by jnrtrading                         |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Jason Robinson (jnrtrading)"
#property link      "http://www.jnrtrading.co.uk"

#property indicator_chart_window
extern int daysBackForHigh = 1;
extern int daysBackForLow = 1;

//---- buffers

double Rates[][6];

double fib000,
       fib236,
       fib382,
       fib50,
       fib618,
       fib100,
       fib1618,
       fib2618,
       fib4236,
       range,
       prevRange,
       high,
       low;
       
bool objectsExist, highFirst;
prevRange = 0;
objectsExist = false;
       

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   //prevRange = 0;
   //objectsExist = false;
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   ObjectDelete("fib000");
   ObjectDelete("fib000_label");
   ObjectDelete("fib236");
   ObjectDelete("fib236_label");
   ObjectDelete("fib382");
   ObjectDelete("fib382_label");
   ObjectDelete("fib50");
   ObjectDelete("fib50_label");
   ObjectDelete("fib618");
   ObjectDelete("fib618_label");
   ObjectDelete("fib100");
   ObjectDelete("fib100_label");
   ObjectDelete("fib1618");
   ObjectDelete("fib1618_label");
   ObjectDelete("fib2618");
   ObjectDelete("fib2618_label");
   ObjectDelete("fib4236");
   ObjectDelete("fib4236_label");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i = 0;
//---- 
   //Print(prevRange);
   ArrayCopyRates(Rates, Symbol(), PERIOD_D1);   
   
   high = Rates[daysBackForHigh][3];
   low = Rates[daysBackForLow][2];
   range = high - low;
   
   while(true) {
      if(High[i] == high) {
         highFirst = true;
         break;
      }
      else if(Low[i] == low) {
         highFirst = false;
         break;
      }
      i++;
   }
   //Print(highFirst);
   
   // Delete Objects if necessary
   if (prevRange != range) {
      ObjectDelete("fib000");
      ObjectDelete("fib000_label");
      ObjectDelete("fib236");
      ObjectDelete("fib236_label");
      ObjectDelete("fib382");
      ObjectDelete("fib382_label");
      ObjectDelete("fib50");
      ObjectDelete("fib50_label");
      ObjectDelete("fib618");
      ObjectDelete("fib618_label");
      ObjectDelete("fib100");
      ObjectDelete("fib100_label");
      ObjectDelete("fib1618");
      ObjectDelete("fib1618_label");
      ObjectDelete("fib2618");
      ObjectDelete("fib2618_label");
      ObjectDelete("fib4236");
      ObjectDelete("fib4236_label");
      objectsExist = false;
      prevRange = range;
      //Print("Objects do not exist");
   }
   
   if (highFirst == true) {
      fib000 = low;
      fib236 = (range * 0.236) + low;
      fib382 = (range * 0.382) + low;
      fib50 = (high + low) / 2;
      fib618 = (range * 0.618) + low;
      fib100 = high;
      fib1618 = (range * 0.618) + high;
      fib2618 = (range * 0.618) + (high + range);
      fib4236 = (range * 0.236) + high + (range * 3);
   }
   else if (highFirst == false) {
      fib000 = high;
      fib236 = high - (range * 0.236);
      fib382 = high - (range * 0.382);
      fib50  = (high + low) / 2;
      fib618 = high - (range * 0.618);
      fib100 = low;
      fib1618 = low - (range * 0.618);
      fib2618 = (low - range) - (range * 0.618);// + (high + range);
      fib4236 = low - (range * 3) - (range * 0.236);// + high + (range * 3);
   }
   
   if (objectsExist == false) {
      ObjectCreate("fib000", OBJ_HLINE, 0, Time[40], fib000);
      ObjectSet("fib000", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib000", OBJPROP_COLOR, Orange);
      ObjectCreate("fib000_label", OBJ_TEXT, 0, Time[0], fib000);
      ObjectSetText("fib000_label","                             0.0", 8, "Times", Black);
   
      ObjectCreate("fib236", OBJ_HLINE, 0, Time[40], fib236);
      ObjectSet("fib236", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib236", OBJPROP_COLOR, Orange);
      ObjectCreate("fib236_label", OBJ_TEXT, 0, Time[0], fib236);
      ObjectSetText("fib236_label","                             23.6", 8, "Times", Black);
   
      ObjectCreate("fib382", OBJ_HLINE, 0, Time[40], fib382);
      ObjectSet("fib382", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib382", OBJPROP_COLOR, Orange);
      ObjectCreate("fib382_label", OBJ_TEXT, 0, Time[0], fib382);
      ObjectSetText("fib382_label","                             38.2", 8, "Times", Black);
   
      ObjectCreate("fib50", OBJ_HLINE, 0, Time[40], fib50);
      ObjectSet("fib50", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib50", OBJPROP_COLOR, Orange);
      ObjectCreate("fib50_label", OBJ_TEXT, 0, Time[0], fib50);
      ObjectSetText("fib50_label","                             50.0", 8, "Times", Black);
   
      ObjectCreate("fib618", OBJ_HLINE, 0, Time[40], fib618);
      ObjectSet("fib618", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib618", OBJPROP_COLOR, Orange);
      ObjectCreate("fib618_label", OBJ_TEXT, 0, Time[0], fib618);
      ObjectSetText("fib618_label","                             61.8", 8, "Times", Black);
   
      ObjectCreate("fib100", OBJ_HLINE, 0, Time[40], fib100);
      ObjectSet("fib100", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib100", OBJPROP_COLOR, Orange);
      ObjectCreate("fib100_label", OBJ_TEXT, 0, Time[0], fib100);
      ObjectSetText("fib100_label","                             100.0", 8, "Times", Black);
   
      ObjectCreate("fib1618", OBJ_HLINE, 0, Time[40], fib1618);
      ObjectSet("fib1618", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib1618", OBJPROP_COLOR, Orange);
      ObjectCreate("fib1618_label", OBJ_TEXT, 0, Time[0], fib1618);
      ObjectSetText("fib1618_label","                             161.8", 8, "Times", Black);
   
      ObjectCreate("fib2618", OBJ_HLINE, 0, Time[40], fib2618);
      ObjectSet("fib2618", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib2618", OBJPROP_COLOR, Orange);
      ObjectCreate("fib2618_label", OBJ_TEXT, 0, Time[0], fib2618);
      ObjectSetText("fib2618_label","                             261.8", 8, "Times", Black);
   
      ObjectCreate("fib4236", OBJ_HLINE, 0, Time[40], fib4236);
      ObjectSet("fib4236", OBJPROP_STYLE, STYLE_DASHDOTDOT);
      ObjectSet("fib4236", OBJPROP_COLOR, Orange);
      ObjectCreate("fib4236_label", OBJ_TEXT, 0, Time[0], fib4236);
      ObjectSetText("fib4236_label","                             423.6", 8, "Times", Black);
      //Print("Objects Exist");
   }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

Indicatore Metatrader - ATR ratio

//+------------------------------------------------------------------+
//|                                                    ATR ratio.mq4 |
//|                         Copyright © 2005, Luis Guilherme Damiani |
//|                                      http://www.damianifx.com.br |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Luis Guilherme Damiani"
#property link      "http://www.damianifx.com.br"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Silver
#property indicator_color2 Violet
//---- input parameters
extern int       short_atr=7;
extern int       long_atr=49;
extern double    triglevel=1.00;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   //Comment("ATR ratio= "+short_atr+" / "+long_atr);
   for(int i=0;i<Bars-counted_bars;i++)
   {
      ExtMapBuffer1[i]=triglevel;
      double sa=iATR(NULL,0,short_atr,i);
      ExtMapBuffer2[i]= sa/iATR(NULL,0,long_atr,i);   
   }
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

Indicatore Metatrader - ATR Levels New

//+------------------------------------------------------------------+
//|                                               ATR Levels New.mq4 |
//|                                                   Tamir Bleicher |
//+------------------------------------------------------------------+
#property copyright "Tamir Bleicher"

#property indicator_chart_window

extern int  ATRPeriod = 10;
extern string TimeFrame = "D";
extern bool IgnoreSunday = true;
extern int  MinVolume = 1;
extern color DynamicLevel = Teal;
extern color StaticLevel=Indigo;
extern color OpenLevel=Navy;
extern int   LevelBarDisplay=40;
extern string Remark1 = "==========================================================================";
extern string Remark2 = "TimeFrames: MN-Monthly W-Weekly D-Daily H4-4 Hours H1- 1 Hour M30-30 Minutes M15-15 Minutes M5-5 Minutes M1-1 Minute ==";
extern string Remark3 = "IgnoreSunday is relevant only for Daily levels";
extern string Remark4 = "MinVolue is the minimum volume to take in ATR calculation in order to skip holidays";
extern string Remark5 = "LevelBarDisplay is the line titles and value position in bars, counting backward from the last bar";
extern string Remark6 = "Levels are: Dynamic levels (support and resist), Static Levels (support and resist) and open period level";

double rates_d1[][6];
double Static_Resist, Dynamic_Resist, Static_Support, Dynamic_Support, atr;
int periods, TF;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
 
   if (TimeFrame=="MN" || TimeFrame=="mn" || TimeFrame=="M" || TimeFrame=="m") TF=PERIOD_MN1;
   else if (TimeFrame=="W" || TimeFrame=="w") TF=PERIOD_W1;
   else if (TimeFrame=="D" || TimeFrame=="d") TF=PERIOD_D1;
   else if (TimeFrame=="H4" || TimeFrame=="h4") TF=PERIOD_H4;
   else if (TimeFrame=="H1" || TimeFrame=="h1") TF=PERIOD_H1;
   else if (TimeFrame=="M30" || TimeFrame=="m30") TF=PERIOD_M30;
   else if (TimeFrame=="M15" || TimeFrame=="m15") TF=PERIOD_M15;
   else if (TimeFrame=="M5" || TimeFrame=="m5") TF=PERIOD_M5;
   else if (TimeFrame=="M1" || TimeFrame=="m1") TF=PERIOD_M1;
   else TF=PERIOD_D1;   

   return(0);
  }

int deinit()
  {

   ObjectDelete("ATR Static Resist");
   ObjectDelete("ATR Static Support");
   ObjectDelete("ATR Static Support Label");
   ObjectDelete("ATR Static Resist Label");
   ObjectDelete("Period Open");
   ObjectDelete("ATR Dynamic Resist");
   ObjectDelete("ATR Dynamic Support");
   ObjectDelete("ATR Dynamic Support Label");
   ObjectDelete("ATR Dynamic Resist Label");   
   ObjectDelete("Period Open Label");
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   string Remark;
   int Yesterday;  

   ArrayCopyRates(rates_d1, Symbol(), TF);
 
            atr = ATR(Symbol(), TF, ATRPeriod, 1, IgnoreSunday);
            
            switch(TF)
            {
               case PERIOD_MN1: Remark="(Monthly)"; break;
               case PERIOD_W1: Remark="(Weekly)"; break;
               case PERIOD_D1: if (IgnoreSunday) Remark="(Daily ignoring Sundays)";
                               else Remark="(Daily including Sundays)";
                               break;
               case PERIOD_H4: Remark="(4 Hours)"; break;
               case PERIOD_H1: Remark="(1 Hour)"; break;
               case PERIOD_M30: Remark="(30 Minutes)"; break;
               case PERIOD_M15: Remark="(15 Minutes)"; break;
               case PERIOD_M5: Remark="(5 Minutes)"; break;
               case PERIOD_M1: Remark="(1 Minute)"; break;
            }                           
            
            Comment("ATR (",ATRPeriod,") = ",atr," ",Remark);

                                    
            if (TF==PERIOD_D1 && IgnoreSunday && TimeDayOfWeek(iTime(NULL,TF,1))==0) Yesterday=2;
            else Yesterday=1;
            
            Static_Support = rates_d1[Yesterday][3] - atr;   
            Static_Resist = rates_d1[Yesterday][2] + atr;
            Dynamic_Support = rates_d1[0][3] - atr;   
            Dynamic_Resist = rates_d1[0][2] + atr;
                      
   if (ObjectFind("ATR Static Resist") != 0) 
     {
      ObjectCreate("ATR Static Resist",OBJ_HLINE,0,Time[0],Static_Resist);
      ObjectSet("ATR Static Resist",OBJPROP_COLOR,StaticLevel);
      ObjectSet("ATR Static Resist",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("ATR Static Resist", 0,Time[0],Static_Resist);
     }


   if (ObjectFind("ATR Static Support") != 0) 
     {
      ObjectCreate("ATR Static Support",OBJ_HLINE,0,Time[0],Static_Support);
      ObjectSet("ATR Static Support",OBJPROP_COLOR,StaticLevel);
      ObjectSet("ATR Static Support",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("ATR Static Support", 0,Time[0],Static_Support);
     }

   if (ObjectFind("ATR Dynamic Resist") != 0) 
     {
      ObjectCreate("ATR Dynamic Resist",OBJ_HLINE,0,Time[0],Dynamic_Resist);
      ObjectSet("ATR Dynamic Resist",OBJPROP_COLOR,DynamicLevel);
      ObjectSet("ATR Dynamic Resist",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("ATR Dynamic Resist", 0,Time[0],Dynamic_Resist);
     }

   if (ObjectFind("ATR Dynamic Support") != 0) 
     {
      ObjectCreate("ATR Dynamic Support",OBJ_HLINE,0,Time[0],Dynamic_Support);
      ObjectSet("ATR Dynamic Support",OBJPROP_COLOR,DynamicLevel);
      ObjectSet("ATR Dynamic Support",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("ATR Dynamic Support", 0,Time[0],Dynamic_Support);
     }
      if (ObjectFind("Period Open") != 0) 
     {
      ObjectCreate("Period Open",OBJ_HLINE,0,Time[LevelBarDisplay],iOpen(0,TF,0));
      ObjectSet("Period Open",OBJPROP_COLOR,OpenLevel);
      ObjectSet("Period Open",OBJPROP_STYLE,STYLE_DOT);
     }
     else
     {
     ObjectMove("Period Open", 0,Time[LevelBarDisplay],iOpen(0,TF,0));
     }


if(ObjectFind("ATR Static Resist Label") != 0)
      {
      ObjectCreate("ATR Static Resist Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Static_Resist);
      ObjectSetText("ATR Static Resist Label", "ATR Static res: " + DoubleToStr(Static_Resist,4), 8, "Verdana", Black);
      }
      else
      {
      ObjectMove("ATR Static Resist Label", 0, Time[LevelBarDisplay], Static_Resist);
      } 

if(ObjectFind("ATR Static Support Label") != 0)
      {
      ObjectCreate("ATR Static Support Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Static_Support);
      ObjectSetText("ATR Static Support Label", "ATR Static sup: " + DoubleToStr(Static_Support,4), 8, "Verdana", Black);
      }
      else
      {
      ObjectMove("ATR Static Support Label", 0, Time[LevelBarDisplay], Static_Support);
      } 

if(ObjectFind("ATR Dynamic Resist Label") != 0)
      {
      ObjectCreate("ATR Dynamic Resist Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Dynamic_Resist);
      ObjectSetText("ATR Dynamic Resist Label", "ATR Dynamic res: " + DoubleToStr(Dynamic_Resist,4), 8, "Verdana", Black);
      }
      else
      {
      ObjectMove("ATR Dynamic Resist Label", 0, Time[LevelBarDisplay], Dynamic_Resist);
      } 

if(ObjectFind("ATR Dynamic Support Label") != 0)
      {
      ObjectCreate("ATR Dynamic Support Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Dynamic_Support);
      ObjectSetText("ATR Dynamic Support Label", "ATR Dynamic sup: " + DoubleToStr(Dynamic_Support,4), 8, "Verdana", Black);
      }
      else
      {
      ObjectMove("ATR Dynamic Support Label", 0, Time[LevelBarDisplay], Dynamic_Support);
      } 
      
if(ObjectFind("Period Open Label") != 0)
      {
      ObjectCreate("Period Open Label", OBJ_TEXT, 0, Time[LevelBarDisplay], iOpen(0,TF,0));
      ObjectSetText("Period Open Label", "Period Open: " + DoubleToStr(iOpen(0,TF,0),4), 8, "Verdana", Black);
      }
      else
      {
      ObjectMove("Period Open Label", 0, Time[LevelBarDisplay], iOpen(0,TF,0));
      }

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

double ATR(string Sym, int TimeFrame, int Per, int Shift, bool Sunday_FLG)
{
   int i,j, Today_DOW,Yesterday_DOW;
   double h,l,c,tr,tr_sum=0;
   bool Sunday_Case;

   if (TimeFrame!=PERIOD_D1 || Sunday_FLG==false)
      return(iATR(Sym, TimeFrame, Per, Shift));
   else for (i=0, j=0; i<Per; i++, j++)
   {
      while(iVolume(Sym,TimeFrame,Shift+j)<=MinVolume) j++;
      
      Today_DOW=TimeDayOfWeek(iTime(Sym,TimeFrame,Shift+j));
      Yesterday_DOW=TimeDayOfWeek(iTime(Sym,TimeFrame,Shift+j+1));
      
      
      if (Today_DOW==1 && Yesterday_DOW==0)
      {
         Sunday_Case=true;
         c=iClose(Sym,TimeFrame,Shift+j+2);
         h=MathMax(iHigh(Sym,TimeFrame,Shift+j),iHigh(Sym,TimeFrame,Shift+j+1));
         l=MathMin(iLow(Sym,TimeFrame,Shift+j),iLow(Sym,TimeFrame,Shift+j+1));
      }
      else
      {
         Sunday_Case=false;
         c=iClose(Sym,TimeFrame,Shift+j+1);
         h=iHigh(Sym,TimeFrame,Shift+j);
         l=iLow(Sym,TimeFrame,Shift+j);
      }
      if (c>h) tr=c-l;
      else if(c<l) tr=h-c;
      else tr=h-l;
      
      tr_sum=tr_sum+tr;  // Ignore days with no volume
      if (Sunday_Case) j++;
   }
   return(tr_sum/Per);
}

   

Indicatore Metatrader - ATR Levels

//+------------------------------------------------------------------+
//|                                                   ATR Levels.mq4 |
//|                                                    Mike Ischenko |
//|                                            
 Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
  |
//+------------------------------------------------------------------+
#property copyright "Mike Ischenko"
#property link      "
 Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
 "

#property indicator_chart_window



extern int ATRPeriod = 10;

double rates_d1[][6];
double H1, H2, H3, H4, H4t, H5, L5, L4, L4t, L3, L2, L1, halfatr, fullatr;
int timeshift=0, timeshifts=0, beginner=0;
int periods;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
 
   
   ObjectDelete("H4atr line");
   ObjectDelete("L4atr line");
   ObjectDelete("L4atr label");
   ObjectDelete("H4atr label");
   ObjectDelete("H4tatr line");
   ObjectDelete("L4tatr line");
   ObjectDelete("L4tatr label");
   ObjectDelete("H4tatr label");   
   
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   //if (counted_bars<1) return(0);
   
   
   switch (Period())
   {
      case PERIOD_M1:  {timeshifts=60; beginner=Hour()*60;} break;
      case PERIOD_M5:  {timeshifts=300; beginner=Hour()*12;} break;
      case PERIOD_M15: {timeshifts=900; beginner=Hour()*4;} break;
      case PERIOD_M30: {timeshifts=1800; beginner=Hour()*2;} break;
      case PERIOD_H1:  {timeshifts=3600; beginner=Hour()*1;} break;
      case PERIOD_H4:  {timeshifts=14400; beginner=Hour()*0.25;} break;
      case PERIOD_D1:  {timeshifts=86400; beginner=Hour()*0;} break;
    }   

   timeshift=timeshifts*24;
   
   if(Period() > 86400)
      {
         Print("Error - Chart period is greater than 1 day.");
         return(-1); // then exit
      }   


   
   ArrayCopyRates(rates_d1, Symbol(), PERIOD_D1);



   //beginner=Hour();
   
            fullatr = iATR(Symbol(), PERIOD_D1, ATRPeriod, 1);
            
            L4 = rates_d1[1][3] - fullatr;   
            H4 = rates_d1[1][2] + fullatr;
            L4t = rates_d1[0][3] - fullatr;   
            H4t = rates_d1[0][2] + fullatr;
            halfatr = fullatr * 0.5;   
         
            H1 = H4+1.5*fullatr;
            H2 = H4+fullatr;
            H3 = H4+halfatr;
            L3 = L4-halfatr;
            L2 = L4-fullatr;
            L1 = L4-1.5*fullatr;
         
   
   
   if (ObjectFind("H4atr Line") != 0) 
     {
      ObjectCreate("H4atr line",OBJ_HLINE,0,Time[0],H4);
      ObjectSet("H4atr line",OBJPROP_COLOR,Yellow);
      ObjectSet("H4atr line",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("H4atr line", 0,Time[0],H4);
     }


   if (ObjectFind("L4atr Line") != 0) 
     {
      ObjectCreate("L4atr line",OBJ_HLINE,0,Time[0],L4);
      ObjectSet("L4atr line",OBJPROP_COLOR,Yellow);
      ObjectSet("L4atr line",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("L4atr line", 0,Time[0],L4);
     }

   if (ObjectFind("H4tatr Line") != 0) 
     {
      ObjectCreate("H4tatr line",OBJ_HLINE,0,Time[0],H4t);
      ObjectSet("H4tatr line",OBJPROP_COLOR,Yellow);
      ObjectSet("H4tatr line",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("H4tatr line", 0,Time[0],H4t);
     }


   if (ObjectFind("L4tatr Line") != 0) 
     {
      ObjectCreate("L4tatr line",OBJ_HLINE,0,Time[0],L4t);
      ObjectSet("L4tatr line",OBJPROP_COLOR,Yellow);
      ObjectSet("L4tatr line",OBJPROP_WIDTH,1);
     }
     else
     {
     ObjectMove("L4tatr line", 0,Time[0],L4t);
     }

if(ObjectFind("H4atr label") != 0)
      {
      ObjectCreate("H4atr label", OBJ_TEXT, 0, Time[0]+timeshift, H4);
      ObjectSetText("H4atr label", "ATR(y) res: " + DoubleToStr(H4,4), 8, "Verdana", Yellow);
      }
      else
      {
      ObjectMove("H4atr label", 0, Time[0]+timeshift, H4);
      } 

if(ObjectFind("L4atr label") != 0)
      {
      ObjectCreate("L4atr label", OBJ_TEXT, 0, Time[0]+timeshift, L4);
      ObjectSetText("L4atr label", "ATR(y) sup: " + DoubleToStr(L4,4), 8, "Verdana", Yellow);
      }
      else
      {
      ObjectMove("L4atr label", 0, Time[0]+timeshift, L4);
      } 

if(ObjectFind("H4tatr label") != 0)
      {
      ObjectCreate("H4tatr label", OBJ_TEXT, 0, Time[0]+timeshift, H4t);
      ObjectSetText("H4tatr label", "ATR(t) res: " + DoubleToStr(H4t,4), 8, "Verdana", Yellow);
      }
      else
      {
      ObjectMove("H4tatr label", 0, Time[0]+timeshift, H4t);
      } 

if(ObjectFind("L4tatr label") != 0)
      {
      ObjectCreate("L4tatr label", OBJ_TEXT, 0, Time[0]+timeshift, L4t);
      ObjectSetText("L4tatr label", "ATR(t) sup: " + DoubleToStr(L4t,4), 8, "Verdana", Yellow);
      }
      else
      {
      ObjectMove("L4tatr label", 0, Time[0]+timeshift, L4t);
      } 

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

Indicatore Metatrader - ATR Channels

//+------------------------------------------------------------------+
//|                                                 ATR Channels.mq4 |
//|                         Copyright © 2005, Luis Guilherme Damiani |
//|                                      http://www.damianifx.com.br |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2005, Luis Guilherme Damiani"
#property link      "http://www.damianifx.com.br"
#property indicator_chart_window
#property  indicator_buffers 7
#property  indicator_color1  Aqua //Moving Average
#property  indicator_color2  DeepSkyBlue // Lower band 1
#property  indicator_color3  DeepSkyBlue // Upper band 1
#property  indicator_color4  RoyalBlue // Lower band 2
#property  indicator_color5  RoyalBlue // Upper band 2
#property  indicator_color6  BlueViolet // Lower band 3
#property  indicator_color7  BlueViolet // Upper band 3
//---- indicator buffers
double     MA_Buffer0[];
double     Ch1up_Buffer1[];
double     Ch1dn_Buffer2[];
double     Ch2up_Buffer3[];
double     Ch2dn_Buffer4[];
double     Ch3up_Buffer5[];
double     Ch3dn_Buffer6[];

//---- input parameters
extern int       PeriodsATR=18;
extern int       MA_Periods=49;
extern int       MA_type=MODE_LWMA;
extern double       Mult_Factor1= 1.6;
extern double       Mult_Factor2= 3.2;
extern double       Mult_Factor3= 4.8;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  string mat;
 
//---7- indicators
// MA
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,MA_Buffer0);
   SetIndexDrawBegin(0,0);
   /*if (MA_type==MODE_LWMA)SetIndexLabel(0,"WMA"+MA_Periods) else 
   {
      if (MA_type==MODE_SMA) SetIndexLabel(0,"SMA"+MA_Periods) else
      {
         if (MA_type==MODE_EMA) SetIndexLabel(0,"EMA"+MA_Periods) else 
         SetIndexLabel(0,"SMMA"+MA_Periods);
      }; 
   };*/      
  // ATR 1 up
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Ch1up_Buffer1);
   SetIndexDrawBegin(1,0);
   SetIndexLabel(1,"ATRu "+PeriodsATR+", "+Mult_Factor1);
  // ATR 1 down
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,Ch1dn_Buffer2);
   SetIndexDrawBegin(2,0);
   SetIndexLabel(2,"ATRd "+PeriodsATR+", "+Mult_Factor1);
// ATR 2 up
   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,Ch2up_Buffer3);
   SetIndexDrawBegin(3,0);
   SetIndexLabel(3,"ATRu "+PeriodsATR+", "+Mult_Factor2);
  // ATR 2 down
   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,Ch2dn_Buffer4);
   SetIndexDrawBegin(4,0);
   SetIndexLabel(4,"ATRd "+PeriodsATR+", "+Mult_Factor2);
   // ATR 3 up
   SetIndexStyle(5,DRAW_LINE);
   SetIndexBuffer(5,Ch3up_Buffer5);
   SetIndexDrawBegin(5,0);
   SetIndexLabel(5,"ATRu "+PeriodsATR+", "+Mult_Factor3);
  // ATR 3 down
   SetIndexStyle(6,DRAW_LINE);
   SetIndexBuffer(6,Ch3dn_Buffer6);
   SetIndexDrawBegin(6,0);
   SetIndexLabel(6,"ATRd "+PeriodsATR+", "+Mult_Factor3);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int fixed_bars=IndicatorCounted();
   for(int i=0;i< Bars - fixed_bars;i++)
     {
         double atr=iATR(NULL,0,PeriodsATR,i);
         double ma=iMA(NULL,0,MA_Periods,0,MA_type,PRICE_TYPICAL,i);
         MA_Buffer0[i]=ma;
         Ch1up_Buffer1[i]=ma+atr*Mult_Factor1;
         Ch1dn_Buffer2[i]=ma-atr*Mult_Factor1;
         
         Ch2up_Buffer3[i]=ma+atr*Mult_Factor2;
         Ch2dn_Buffer4[i]=ma-atr*Mult_Factor2;
         
         Ch3up_Buffer5[i]=ma+atr*Mult_Factor3;
         Ch3dn_Buffer6[i]=ma-atr*Mult_Factor3;
      }  
   
//---- 
   
//----
   return(0);
  }

   

Pagina 4 di 6


Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 94

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 100

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 94

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 100

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 94

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 100

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 94

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 100

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 94

Warning: Illegal string offset 'active' in /home/mhd-01/www.expert-advisor.it/htdocs/templates/rt_solarsentinel_j15/html/pagination.php on line 100

Opzioni Forex.

Piattaforma trading.

Download Fap Turbo

Scarica FapTurbo Adesso.

Expert Advisor MT4

Forex Expert Advisor - Forex Trading automatizzati con un trading system costruito con linguaggio Metaquotes MQL4. Strategy tester per testare le strategie forex. Si possono trovare alcuni interessanti expert advisor costruiti da Trader Usa. Clicca il banner per andare al sito.

Guida Server VPS e MT4

Come Configurare un Server VPS per Piattaforma MT4 in cui far girare degli EA su conti live?

Ecco una utile Guida da Scaricare Gratis!

Disclaimer -Avviso. Gli Expert Advisor ed i mercati finanziari sono rischiosi. Prima di leggere le pagine del sito Ti invitiamo a consultare il " Disclaimer " e "Privacy "

Forex opzioni.

Forex Expert.

Forex Expert.

Forex Expert.

Forex Expert.