My question is this. How can I control which New Bar the NewBar() code will use?
//--------------------------------------------------------+
if (NewBar() )
{ // if a new bar has opened
} // end new bar
//--------------------------------------------------------+
bool NewBar()
{
static datetime dt = 0;
if (Time[0] != dt)
{
dt = Time[0];
return(true);
}
return(false);
}
//--------------------------------------------------------+
I'm working through an EA and trying to apply the New Bar requirement for entries. I've borrowed the above code from some previous work and think it is correct ... (time will tell).
My question is this. How can I control which New Bar it will use? Hopefully there is a way to code it to a particular window (such as 60, or 240) instead of having it float or simply attached to the open window.
The bool part is at the end of the EA.
Your thoughts, comments & code help is, as always, appreciated.
Pip Parade
//--------------------------------------------------------+
if (NewBar() )
{ // if a new bar has opened
} // end new bar
//--------------------------------------------------------+
bool NewBar()
{
static datetime dt = 0;
if (Time[0] != dt)
{
dt = Time[0];
return(true);
}
return(false);
}
//--------------------------------------------------------+
I'm working through an EA and trying to apply the New Bar requirement for entries. I've borrowed the above code from some previous work and think it is correct ... (time will tell).
My question is this. How can I control which New Bar it will use? Hopefully there is a way to code it to a particular window (such as 60, or 240) instead of having it float or simply attached to the open window.
The bool part is at the end of the EA.
Your thoughts, comments & code help is, as always, appreciated.
Pip Parade