Alert Delay

MQL4 Scripts

Trabalho concluído

Tempo de execução 3 minutos
Comentário do desenvolvedor
Good customer. Thank you for your order!
Comentário do cliente
very professional programmer !!!!!

Termos de Referência

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.



Respondido

1
Desenvolvedor 1
Classificação
(41)
Projetos
72
8%
Arbitragem
18
11% / 56%
Expirado
18
25%
Livre
2
Desenvolvedor 2
Classificação
(26)
Projetos
34
29%
Arbitragem
0
Expirado
1
3%
Livre
3
Desenvolvedor 3
Classificação
(257)
Projetos
341
58%
Arbitragem
7
14% / 71%
Expirado
9
3%
Livre
4
Desenvolvedor 4
Classificação
(164)
Projetos
218
50%
Arbitragem
6
17% / 67%
Expirado
11
5%
Livre
5
Desenvolvedor 5
Classificação
(170)
Projetos
228
60%
Arbitragem
3
33% / 33%
Expirado
6
3%
Livre
Publicou: 1 código
6
Desenvolvedor 6
Classificação
(106)
Projetos
314
49%
Arbitragem
42
52% / 19%
Expirado
22
7%
Livre
7
Desenvolvedor 7
Classificação
(1156)
Projetos
1462
63%
Arbitragem
21
57% / 10%
Expirado
43
3%
Livre
8
Desenvolvedor 8
Classificação
(91)
Projetos
144
38%
Arbitragem
67
15% / 48%
Expirado
55
38%
Livre
9
Desenvolvedor 9
Classificação
(71)
Projetos
156
44%
Arbitragem
22
41% / 14%
Expirado
16
10%
Livre
Publicou: 10 códigos
10
Desenvolvedor 10
Classificação
(452)
Projetos
564
26%
Arbitragem
24
42% / 38%
Expirado
85
15%
Trabalhando
Publicou: 6 códigos

Informações sobre o projeto

Orçamento
10 - 15 USD
Prazo
de 2 para 5 dias