Alert Delay

MQL4 Scripts

Job finished

Execution time 3 minutes
Feedback from employee
Good customer. Thank you for your order!
Feedback from customer
very professional programmer !!!!!

Specification

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.



Responded

1
Developer 1
Rating
(38)
Projects
68
9%
Arbitration
18
11% / 56%
Overdue
17
25%
Working
2
Developer 2
Rating
(26)
Projects
34
29%
Arbitration
0
Overdue
1
3%
Free
3
Developer 3
Rating
(257)
Projects
341
58%
Arbitration
7
14% / 71%
Overdue
9
3%
Free
4
Developer 4
Rating
(169)
Projects
218
50%
Arbitration
6
17% / 67%
Overdue
11
5%
Free
5
Developer 5
Rating
(126)
Projects
182
54%
Arbitration
3
33% / 33%
Overdue
6
3%
Free
6
Developer 6
Rating
(106)
Projects
314
49%
Arbitration
42
52% / 19%
Overdue
22
7%
Free
7
Developer 7
Rating
(1127)
Projects
1429
62%
Arbitration
21
57% / 10%
Overdue
43
3%
Free
8
Developer 8
Rating
(91)
Projects
144
38%
Arbitration
67
15% / 48%
Overdue
55
38%
Free
9
Developer 9
Rating
(71)
Projects
156
44%
Arbitration
22
41% / 14%
Overdue
16
10%
Free
10
Developer 10
Rating
(439)
Projects
545
25%
Arbitration
21
38% / 38%
Overdue
83
15%
Free
Similar orders
Modify an existing Python bot to trade bollinger bands, with iqoption api Currently the bot strategy is wrong, I am limited in my knowledge here and hope to fix this Hope to work with more experience people out there in relation to iqoption api and python
I need an EA to automate Tradingview alerts on MT4 using webhook alerts. The bridge/connector should be python based GUI. Required features at a minimum Mapping Tradingview alert formats to MT4 Automating market, limit and stop orders with entry price, stop loss, multiple TPs and trailing stop Lot sizing - fixed/% of balance/fixed amount breakeven, partial close and trailing stop Mapping pair name prefixes/suffixes
hi guys, I have a script, that I have been struggling to work. most of the work is done, just final touch of an expert is needed. The script Is using Fibonacci and Pivot standard in its base. look forward to hear from an expert! Best regards Sina
Hello all! I'm currently developing a members area web app which users have access to our services, educational content, auto calculators etc... i want to take it to the next level and integrate a system where at a click of a button, a system auto run a strategy test, finds a setfile based on inputs they enter and saves it as a setfile. there will be a fair few inputs but after filling it out, the system will know
I need help with my indicator which is Wave. I'd like to have some changes made to my base code Also I need cooperation for later projects... Thanks alot in advance
Hello, I am looking for someone that can develop for me a trading bot, that can trade on Crash 500 and 1000, and also on Boom 500 and 1000. The bot must buy on Crash 500 and 1000 and sell on Boom 500 and 1000. The indicator we use is the Awesome Oscillator. The CRASH 500/1000 we scalp it by buying. We only place our ENTRY that is to BUY when the Awesome Oscillator changes from VALUE DOWN to VALUE UP and by changing I
I want to find a Developer to perform this work and settle payments in this Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party messengers, personal correspondence or emails. I understand that violators will be banned from publishing Orders in the Freelance service. I have read the Rules of using the Freelance service and accept them. I agree

Project information

Budget
10 - 15 USD
VAT (22%): 2.2 - 3.3 USD
Total: 12.2 - 18.3 USD
For the developer
9 - 13.5 USD
Deadline
from 2 to 5 day(s)