start of a new bar in m30 timeframe - page 2

 
ankit29030:

sir this condition executes 2 -3 times during a bar formation....wat to do??
Show your code.  What timeframe is the chart that you have this on ?
 
RaptorUK:
Show your code.  What timeframe is the chart that you have this on ?

on m1 timeframe..i put this on a m1 timeframe..
datetime bartime;


if(iTime(NULL,0, 1) != bartime)
   {
   //  we have a new M1 bar . . . .
   
   bartime = iTime(NULL,0, 1);
   }
 
ankit29030: on m1 timeframe..i put this on a m1 timeframe..
That is NOT your code. That will NOT compile. Post YOUR code.
 
WHRoeder:
That is NOT your code. That will NOT compile. Post YOUR code.
this is compiling perfectly..that is my code...i put this on a m1 timeframe
datetime bartime;





start()
{
if(iTime(NULL,0, 1) != bartime)
   {
   Alert("we have a new M1 bar . . . .");
  
   bartime = iTime(NULL,0, 1);
   }
return(0)
}
 
ankit29030:

hello all,


just wanna know how to identify start of new candle in mq4 ..seen itime but can't understand it what value it returns.


Another vigorous and eventful day in the MQL4 forum, Ha-ha! ;)

Hello Ankit Jain,

If you could please express your thoughts as to what task you wish your EA to perform, I or another devout ;) forum member might assist you to achieve your coding goal (provided you add code to SRC within your post or attach code to your post).

Thank you

 
WhooDoo22:

Another vigorous and eventful day in the MQL4 forum, Ha-ha! ;)

Hello Ankit Jain,

If you could please express your thoughts as to what task you wish your EA to perform, I or another devout ;) forum member might assist you to achieve your coding goal (provided you add code to SRC within your post or attach code to your post).

Thank you


actually im making a EA which tells or e mails us about BEARISH ENGULFING PATTERN.but it should check condition only after closing of bar[0]...

 ie when bar[0] becomes bar[1]. 

 
ankit29030:
this is compiling perfectly..that is my code...i put this on a m1 timeframe
That will Alert once when the first tick of a new M1 bar arrives . . .  maybe you have it on more than one chart ?  if you believe I'm wrong post a screen grab of the Alert window showing the time of the Alerts.
 
ankit29030:
this is compiling perfectly..that is my code...i put this on a m1 timeframe
Original code won't compile.
Of course this code compiles perfectly
datetime bartime;


if(iTime(NULL,0, 1) != bartime)
   {
   //  we have a new M1 bar . . . .
   
   bartime = iTime(NULL,0, 1);
   }
datetime bartime;
start()
{
if(iTime(NULL,0, 1) != bartime)
   {
   Alert("we have a new M1 bar . . . .");
  
   bartime = iTime(NULL,0, 1);
   }
return(0)
}
  1. Different code. Are you a troll?
  2. Have you consciously changed your question from the original start of a M30 bar to the start of a new bar (whatever TF the chart is on?)
  3. What doesn't work?
 
ankit29030:


actually im making a EA which tells or e mails us about BEARISH ENGULFING PATTERN.but it should check condition only after closing of bar[0]...

 ie when bar[0] becomes bar[1]. 

It doesn't matter if you check bar 0 or bar 10 or bar 346  . . .  when bar 0 becomes bar 1 all other bars become bar n + 1
 
WHRoeder:
  1. Different code. Are you a troll?
  2. Have you consciously changed your question from the original start of a M30 bar to the start of a new bar (whatever TF the chart is on?)
  3. What doesn't work?

1. Different code. Are you a troll?

Your words cut like a knife :( I don't believe condescending comments will establish mutual respect between both parties.

2. ...

I believe Ankit wants to code a condition notifying the EA when a new bar has been created (Close[1]-Open[0]). Regardless of time frame. I believe Ankit used M30 as a time frame example.

3. ...

I do not know the answer for this.


Also, I will try the code you provided and will reply with the result given in tester.

Thank you

Reason: