Requests & Ideas - page 651

 

hi,

 I created this EA for MT5 using Expert Advisor.

 but I Need help to add "start time" and "stop time" in trades?

 I need to input:

- start (hour and minute)

- stop (hour and minute)

any help 

thanks ..

 
hi MR Mladen ca you please add alarm to this indicator& arrow also ability to change the color thanks thanks a ton. ! 
Files:
Pin8.mq4  8 kb
 
baraozemo:

hi,

 I created this EA for MT5 using Expert Advisor.

 but I Need help to add "start time" and "stop time" in trades?

 I need to input:

- start (hour and minute)

- stop (hour and minute)

any help 

thanks ..

Check here (it will work the same for mt5 too) : https://www.mql5.com/en/forum/184052
 
manfloy:
hi MR Mladen ca you please add alarm to this indicator& arrow also ability to change the color thanks thanks a ton. ! 
Color changes added. Alerts are not too suitable for this indicator - you would have an alert on almost ever bar
Files:
Pin8.mq4  16 kb
 
mladen:
Color changes added. Alerts are not too suitable for this indicator - you would have an alert on almost ever bar
yeah i know but i need an alert if the candle have body 70% alert is coming on. it is possible ? thanks
 
or for example if candle have 56procent of body lenght also coming alert. thanks
 
mean wick not body. sorry !
 
Dear @mladen,

please help me. Why this EA does not work. Where there is error code.

Thank you.
Files:
 
//+------------------------------------------------------------------+
//|                                                        Teddy.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_plots   4
//--- plot 
#property indicator_label1  "upwick %"
#property indicator_type1  DRAW_LINE
#property indicator_color1  clrDodgerBlue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

//--- plot 
#property indicator_label2  "downwick%"
#property indicator_type2   DRAW_LINE
#property indicator_color2  clrOrangeRed
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- plot 
#property indicator_label3  "up conf"
#property indicator_type3  DRAW_NONE
#property indicator_width3  1

//--- plot 
#property indicator_label4  "down conf"
#property indicator_type4   DRAW_NONE
#property indicator_width4  1


input int Up_Wick=10;//Up Wick %
input int Dw_Wick=10;//Dw Wick %
enum Teds_Method
{
Alert_Both=1,//Alert When Both Are < %
Alert_Separately=2//Alert when either is < %
};
input Teds_Method Method=Alert_Both;//Alert Method :

string Teds_Code="x";
double uwBuffer[];
double dwBuffer[];
double upConf[];
double dwConf[];
double T_Pip_Size=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
  if(Digits()==2||Digits()==3)
    {
    T_Pip_Size=0.01;
    }
  if(Digits()==4||Digits()==5)
    {
    T_Pip_Size=0.0001;
    }
  SetIndexBuffer(0,uwBuffer);
  SetIndexBuffer(1,dwBuffer);
  SetIndexBuffer(2,upConf);
  SetIndexBuffer(3,dwConf);
//--- indicator buffers mapping
  Teds_Code="x"; 
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
     int i,pos,limit;
     pos=prev_calculated-1;
     limit=rates_total;
     if(limit>2)
     {
     limit=limit-5;
     }
     if(pos<0)
     {
     pos=0;
     }
     double cs,uw,dw,unit;
   for(i=pos; i<=limit && !IsStopped(); i++)
     {
    //get candle size 
      cs=Open[i]-Close[i];
      cs=MathAbs(cs/T_Pip_Size);
      if(Open[i]>=Close[i])
      {
      uw=High[i]-Open[i];
      dw=Close[i]-Low[i];
      }         
      if(Open[i]<Close[i])
      {
      uw=High[i]-Close[i];
      dw=Open[i]-Low[i];
      }
      //get unit
      unit=cs/100;
      if(unit!=0)
       {
       //upwick percentage
         uw=(uw/T_Pip_Size)/unit;
       //downwick percentage
         dw=(dw/T_Pip_Size)/unit;
         if(uw>100) 
           {
           uw=100;
           }
         if(dw>100)
           {
           dw=100;
           }
       uwBuffer[i]=uw;
       dwBuffer[i]=dw;
       upConf[i]=1;
       dwConf[i]=1;
       }     
     if(unit==0)
       {
       uwBuffer[i]=0;
       dwBuffer[i]=0;
       }
     }    
    //get candle size 
      cs=Open[0]-Close[0];
      cs=MathAbs(cs/T_Pip_Size);
      if(Open[0]>=Close[0])
      {
      uw=High[0]-Open[0];
      dw=Close[0]-Low[0];
      }         
      if(Open[0]<Close[0])
      {
      uw=High[0]-Close[0];
      dw=Open[0]-Low[0];
      }
      //get unit
      unit=cs/100;
      if(unit!=0)
       {
       //upwick percentage
         uw=(uw/T_Pip_Size)/unit;
       //downwick percentage
         dw=(dw/T_Pip_Size)/unit;
         if(uw>100) 
           {
           uw=100;
           }
         if(dw>100)
           {
           dw=100;
           }
       uwBuffer[0]=uw;
       dwBuffer[0]=dw;
       upConf[0]=1;
       dwConf[0]=1;
       }     
     if(unit==0)
       {
       uwBuffer[0]=0;
       dwBuffer[0]=0;
       }     
  string now_code=Open[1]+"::"+High[1]+"::"+Low[1]+"::"+Close[1]+"::"+Volume[1];
  if(now_code!=Teds_Code)
    {
    //select alert mode
    if(Method==Alert_Both)
      {
      if(uwBuffer[1]<=Up_Wick&&dwBuffer[1]<=Dw_Wick&&upConf[1]==1&&dwConf[1]==1)
         {
         Alert("Alert");
         }
      }
    if(Method==Alert_Separately)
      {
      if((uwBuffer[1]<=Up_Wick||dwBuffer[1]<=Dw_Wick)&&upConf[1]==1&&dwConf[1]==1)
         {
         Alert("Alert");
         }
      }      
    Teds_Code=now_code;
    }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
i have errors can you take a look please thanks ! 
 
jerfin:
Dear @mladen,

please help me. Why this EA does not work. Where there is error code.

Thank you.
Even though the indicator is decompiled, in your EA you are using the wrong buffer number for iCustom() call, Check that
Reason: