datetime prevtime=0; ... if(prevtime == Time[0]) return(0); prevtime = Time[0];
bool CheckNewBar()
{
if (lastBars != Bars)
{
lastBars = Bars;
//Print("New Bar: ",mytime);
return(1);
}
else
{
//Print("No New Bar: ",mytime);
return(0);
}
}
{
if (lastBars != Bars)
{
lastBars = Bars;
//Print("New Bar: ",mytime);
return(1);
}
else
{
//Print("No New Bar: ",mytime);
return(0);
}
}
I see, simple. Thanks!
-charliev
-charliev
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Other than using Volume[0]=0, how would I programatically determine when a new BAR begins (under any time period) without getting into messy TIME calculations, etc.
I appreciate all replies.
Thanks!
-charliev