Alert Delay

MQL4 Sripts

Trabajo finalizado

Plazo de ejecución 3 minutos
Comentario del Ejecutor
Good customer. Thank you for your order!
Comentario del Cliente
very professional programmer !!!!!

Tarea técnica

Hi, I wrote this simple code where the alert will appear after 10 seconds after the opening of the bar. I would like to know if you can have 10 real seconds after the end of the bar and not wait for the start of the new bar. (Time [0]).

 

//+------------------------------------------------------------------+
//|                                                  Delay_Alert.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+


//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 2

#property indicator_type1 DRAW_ARROW
#property indicator_width1 1
#property indicator_color1 0xFFAA00
#property indicator_label1 "Buy"

#property indicator_type2 DRAW_ARROW
#property indicator_width2 1
#property indicator_color2 0x0000FF
#property indicator_label2 "Sell"
int CurrentTime;
int extern Period1=2;
 

//--- indicator buffers
double Buffer1[];
double Buffer2[];



//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {   
   IndicatorBuffers(2);
   SetIndexBuffer(0, Buffer1);
   SetIndexEmptyValue(0, 0);
   SetIndexArrow(0, 241);
   SetIndexBuffer(1, Buffer2);
   SetIndexEmptyValue(1, 0);
   SetIndexArrow(1, 242);
   
  
   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[])
 
  
{
  static datetime BarStart=0;
   static bool check=false;
    if(BarStart!=Time[0])
     {
      BarStart=Time[0];
      check=true;
     }
   if(check && TimeCurrent()>=Time[0]+10)
     {
      check=false;
      //Check Condition
    
  
      //Indicator Buffer 1
      if(iRSI(NULL, PERIOD_CURRENT, Period1, PRICE_CLOSE, 0) < 40
      
      )
        {
         Buffer1[0] = Low[0] - 10* Point();  
        }
      else
        {
         Buffer1[0] = 0;
        }
      //Indicator Buffer 2
      if(iRSI(NULL, PERIOD_CURRENT, Period1, PRICE_CLOSE, 0) > 60
     
      )
        {
         Buffer2[0] = High[0] + 10 * Point(); 
         
        }
      else
        {
         Buffer2[0] = 0;
        }
     }
      
return(0);
}
 //-----------------------------------------------------------------------------------------------------------------------------  
 

 

The indicator will use it for OB 60 seconds, so I want to be very precise. When the server timer is equal to 10 seconds to appear the arrow. In the examples that you sent me, the arrow appears in many cases after 12, 15 seconds, and that's not good.



Han respondido

1
Desarrollador 1
Evaluación
(41)
Proyectos
72
8%
Arbitraje
18
11% / 56%
Caducado
18
25%
Libre
2
Desarrollador 2
Evaluación
(26)
Proyectos
34
29%
Arbitraje
0
Caducado
1
3%
Libre
3
Desarrollador 3
Evaluación
(257)
Proyectos
341
58%
Arbitraje
7
14% / 71%
Caducado
9
3%
Libre
4
Desarrollador 4
Evaluación
(164)
Proyectos
218
50%
Arbitraje
6
17% / 67%
Caducado
11
5%
Libre
5
Desarrollador 5
Evaluación
(170)
Proyectos
228
60%
Arbitraje
3
33% / 33%
Caducado
6
3%
Libre
Ha publicado: 1 ejemplo
6
Desarrollador 6
Evaluación
(106)
Proyectos
314
49%
Arbitraje
42
52% / 19%
Caducado
22
7%
Libre
7
Desarrollador 7
Evaluación
(1156)
Proyectos
1462
63%
Arbitraje
21
57% / 10%
Caducado
43
3%
Libre
8
Desarrollador 8
Evaluación
(91)
Proyectos
144
38%
Arbitraje
67
15% / 48%
Caducado
55
38%
Libre
9
Desarrollador 9
Evaluación
(71)
Proyectos
156
44%
Arbitraje
22
41% / 14%
Caducado
16
10%
Libre
Ha publicado: 10 ejemplos
10
Desarrollador 10
Evaluación
(452)
Proyectos
564
26%
Arbitraje
24
42% / 38%
Caducado
85
15%
Trabaja
Ha publicado: 6 ejemplos

Información sobre el proyecto

Presupuesto
10 - 15 USD
Plazo límite de ejecución
de 2 a 5 día(s)