Alert Delay

MQL4 脚本

工作已完成

执行时间3 分钟
员工反馈
Good customer. Thank you for your order!
客户反馈
very professional programmer !!!!!

指定

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.



反馈

1
开发者 1
等级
(41)
项目
72
8%
仲裁
18
11% / 56%
逾期
18
25%
空闲
2
开发者 2
等级
(26)
项目
34
29%
仲裁
0
逾期
1
3%
空闲
3
开发者 3
等级
(257)
项目
341
58%
仲裁
7
14% / 71%
逾期
9
3%
空闲
4
开发者 4
等级
(164)
项目
218
50%
仲裁
6
17% / 67%
逾期
11
5%
空闲
5
开发者 5
等级
(170)
项目
228
60%
仲裁
3
33% / 33%
逾期
6
3%
空闲
发布者: 1 代码
6
开发者 6
等级
(106)
项目
314
49%
仲裁
42
52% / 19%
逾期
22
7%
空闲
7
开发者 7
等级
(1156)
项目
1462
63%
仲裁
21
57% / 10%
逾期
43
3%
空闲
8
开发者 8
等级
(91)
项目
144
38%
仲裁
67
15% / 48%
逾期
55
38%
空闲
9
开发者 9
等级
(71)
项目
156
44%
仲裁
22
41% / 14%
逾期
16
10%
空闲
发布者: 10 代码
10
开发者 10
等级
(452)
项目
564
26%
仲裁
24
42% / 38%
逾期
85
15%
工作中
发布者: 6 代码

项目信息

预算
10 - 15 USD
截止日期
 2  5 天